diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 5d4c676f9980..30ea2b9d9e75 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -350,7 +350,7 @@ com.azure.resourcemanager:azure-resourcemanager-mariadb;1.0.0-beta.2;1.0.0-beta. com.azure.resourcemanager:azure-resourcemanager-servicefabric;1.0.0-beta.4;1.0.0-beta.5 com.azure.resourcemanager:azure-resourcemanager-peering;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-policyinsights;1.0.0-beta.3;1.0.0-beta.4 -com.azure.resourcemanager:azure-resourcemanager-support;1.0.0-beta.4;1.0.0-beta.5 +com.azure.resourcemanager:azure-resourcemanager-support;1.0.0-beta.4;1.0.0 com.azure.resourcemanager:azure-resourcemanager-subscription;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-powerbidedicated;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-storageimportexport;1.0.0-beta.2;1.0.0-beta.3 diff --git a/sdk/support/azure-resourcemanager-support/CHANGELOG.md b/sdk/support/azure-resourcemanager-support/CHANGELOG.md index 542d58ac81cc..a2f3f4f8cc5f 100644 --- a/sdk/support/azure-resourcemanager-support/CHANGELOG.md +++ b/sdk/support/azure-resourcemanager-support/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.0.0-beta.5 (Unreleased) +## 1.0.0 (2024-04-23) -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Azure Resource Manager support client library for Java. This package contains Microsoft Azure SDK for support Management SDK. Microsoft Azure Support Resource Provider. Package tag package-2024-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.4 (2024-03-20) diff --git a/sdk/support/azure-resourcemanager-support/README.md b/sdk/support/azure-resourcemanager-support/README.md index 17d4a0205822..a61658cd84bb 100644 --- a/sdk/support/azure-resourcemanager-support/README.md +++ b/sdk/support/azure-resourcemanager-support/README.md @@ -2,7 +2,7 @@ Azure Resource Manager support client library for Java. -This package contains Microsoft Azure SDK for support Management SDK. Microsoft Azure Support Resource Provider. Package tag package-preview-2023-06. 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 support Management SDK. Microsoft Azure Support Resource Provider. Package tag package-2024-04. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-support - 1.0.0-beta.4 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/support/azure-resourcemanager-support/SAMPLE.md b/sdk/support/azure-resourcemanager-support/SAMPLE.md index 8d66ba6f7b40..04ce4ddb9589 100644 --- a/sdk/support/azure-resourcemanager-support/SAMPLE.md +++ b/sdk/support/azure-resourcemanager-support/SAMPLE.md @@ -49,32 +49,15 @@ - [List](#filesnosubscription_list) - [Upload](#filesnosubscription_upload) -## LookUpResourceId - -- [Post](#lookupresourceid_post) - ## Operations - [List](#operations_list) ## ProblemClassifications -- [ClassifyProblems](#problemclassifications_classifyproblems) - [Get](#problemclassifications_get) - [List](#problemclassifications_list) -## ProblemClassificationsNoSubscription - -- [ClassifyProblems](#problemclassificationsnosubscription_classifyproblems) - -## ServiceClassifications - -- [ClassifyServices](#serviceclassifications_classifyservices) - -## ServiceClassificationsNoSubscription - -- [ClassifyServices](#serviceclassificationsnosubscription_classifyservices) - ## Services - [Get](#services_get) @@ -103,8 +86,7 @@ */ public final class ChatTranscriptsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetchatTranscriptDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. @@ -113,8 +95,8 @@ public final class ChatTranscriptsGetSamples { */ public static void getChatTranscriptDetailsForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.chatTranscripts().getWithResponse("testticket", "69586795-45e9-45b5-bd9e-c9bb237d3e44", - com.azure.core.util.Context.NONE); + manager.chatTranscripts() + .getWithResponse("testticket", "69586795-45e9-45b5-bd9e-c9bb237d3e44", com.azure.core.util.Context.NONE); } } ``` @@ -127,8 +109,7 @@ public final class ChatTranscriptsGetSamples { */ public final class ChatTranscriptsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListChatTranscriptsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSubscriptionSupportTicket.json */ /** * Sample code: List chat transcripts for a subscription support ticket. @@ -150,8 +131,7 @@ public final class ChatTranscriptsListSamples { */ public final class ChatTranscriptsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetchatTranscriptDetailsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. @@ -160,8 +140,8 @@ public final class ChatTranscriptsNoSubscriptionGetSamples { */ public static void getChatTranscriptDetailsForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.chatTranscriptsNoSubscriptions().getWithResponse("testticket", "b371192a-b094-4a71-b093-7246029b0a54", - com.azure.core.util.Context.NONE); + manager.chatTranscriptsNoSubscriptions() + .getWithResponse("testticket", "b371192a-b094-4a71-b093-7246029b0a54", com.azure.core.util.Context.NONE); } } ``` @@ -174,8 +154,7 @@ public final class ChatTranscriptsNoSubscriptionGetSamples { */ public final class ChatTranscriptsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListChatTranscriptsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSupportTicket.json */ /** * Sample code: List chat transcripts for a no-subscription support ticket. @@ -200,19 +179,19 @@ import com.azure.resourcemanager.support.models.Type; */ public final class CommunicationsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailabilityForSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json */ /** - * Sample code: Checks whether name is available for subscription scoped Communication resource. + * Sample code: Checks whether name is available for Communication resource for a subscription support ticket. * * @param manager Entry point to SupportManager. */ - public static void checksWhetherNameIsAvailableForSubscriptionScopedCommunicationResource( + public static void checksWhetherNameIsAvailableForCommunicationResourceForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().checkNameAvailabilityWithResponse("testticket", - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), - com.azure.core.util.Context.NONE); + manager.communications() + .checkNameAvailabilityWithResponse("testticket", + new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + com.azure.core.util.Context.NONE); } } ``` @@ -225,8 +204,7 @@ public final class CommunicationsCheckNameAvailabilitySamples { */ public final class CommunicationsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToSubscriptionTicket. @@ -234,9 +212,13 @@ public final class CommunicationsCreateSamples { * @param manager Entry point to SupportManager. */ public static void addCommunicationToSubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().define("testcommunication").withExistingSupportTicket("testticket") - .withSender("user@contoso.com").withSubject("This is a test message from a customer!") - .withBody("This is a test message from a customer!").create(); + manager.communications() + .define("testcommunication") + .withExistingSupportTicket("testticket") + .withSubject("This is a test message from a customer!") + .withBody("This is a test message from a customer!") + .withSender("user@contoso.com") + .create(); } } ``` @@ -249,8 +231,7 @@ public final class CommunicationsCreateSamples { */ public final class CommunicationsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetCommunicationDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get communication details for a subscription support ticket. @@ -272,8 +253,7 @@ public final class CommunicationsGetSamples { */ public final class CommunicationsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List communications for a subscription support ticket. @@ -286,8 +266,7 @@ public final class CommunicationsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List web communications for a subscription support ticket. @@ -296,13 +275,12 @@ public final class CommunicationsListSamples { */ public static void listWebCommunicationsForASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().list("testticket", null, "communicationType eq 'web'", - com.azure.core.util.Context.NONE); + manager.communications() + .list("testticket", null, "communicationType eq 'web'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a subscription support ticket. @@ -311,8 +289,9 @@ public final class CommunicationsListSamples { */ public static void listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().list("testticket", null, - "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", com.azure.core.util.Context.NONE); + manager.communications() + .list("testticket", null, "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", + com.azure.core.util.Context.NONE); } } ``` @@ -328,8 +307,7 @@ import com.azure.resourcemanager.support.models.Type; */ public final class CommunicationsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: Checks whether name is available for Communication resource. @@ -338,9 +316,10 @@ public final class CommunicationsNoSubscriptionCheckNameAvailabilitySamples { */ public static void checksWhetherNameIsAvailableForCommunicationResource(com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().checkNameAvailabilityWithResponse("testticket", - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .checkNameAvailabilityWithResponse("testticket", + new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + com.azure.core.util.Context.NONE); } } ``` @@ -355,8 +334,7 @@ import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner */ public final class CommunicationsNoSubscriptionCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToNoSubscriptionTicket. @@ -365,11 +343,12 @@ public final class CommunicationsNoSubscriptionCreateSamples { */ public static void addCommunicationToNoSubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().create("testticket", "testcommunication", - new CommunicationDetailsInner().withSender("user@contoso.com") - .withSubject("This is a test message from a customer!") - .withBody("This is a test message from a customer!"), - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .create("testticket", "testcommunication", + new CommunicationDetailsInner().withSender("user@contoso.com") + .withSubject("This is a test message from a customer!") + .withBody("This is a test message from a customer!"), + com.azure.core.util.Context.NONE); } } ``` @@ -382,8 +361,7 @@ public final class CommunicationsNoSubscriptionCreateSamples { */ public final class CommunicationsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetCommunicationDetailsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSupportTicket.json */ /** * Sample code: Get communication details for a no-subscription support ticket. @@ -392,8 +370,8 @@ public final class CommunicationsNoSubscriptionGetSamples { */ public static void getCommunicationDetailsForANoSubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().getWithResponse("testticket", "testmessage", - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .getWithResponse("testticket", "testmessage", com.azure.core.util.Context.NONE); } } ``` @@ -406,8 +384,7 @@ public final class CommunicationsNoSubscriptionGetSamples { */ public final class CommunicationsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListCommunicationsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSupportTicket.json */ /** * Sample code: List communications for a no-subscription support ticket. @@ -420,8 +397,7 @@ public final class CommunicationsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a no-subscription support ticket. @@ -430,13 +406,13 @@ public final class CommunicationsNoSubscriptionListSamples { */ public static void listWebCommunicationCreatedOnOrAfterASpecificDateForANoSubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().list("testticket", null, - "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .list("testticket", null, "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicket.json */ /** * Sample code: List web communications for a no-subscription support ticket. @@ -445,8 +421,8 @@ public final class CommunicationsNoSubscriptionListSamples { */ public static void listWebCommunicationsForANoSubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().list("testticket", null, "communicationType eq 'web'", - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .list("testticket", null, "communicationType eq 'web'", com.azure.core.util.Context.NONE); } } ``` @@ -459,16 +435,14 @@ public final class CommunicationsNoSubscriptionListSamples { */ public final class FileWorkspacesCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateFileWorkspaceForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspaceForSubscription.json */ /** - * Sample code: Create a subscription scoped file workspace. + * Sample code: Create a file workspace for a subscription. * * @param manager Entry point to SupportManager. */ - public static void - createASubscriptionScopedFileWorkspace(com.azure.resourcemanager.support.SupportManager manager) { + public static void createAFileWorkspaceForASubscription(com.azure.resourcemanager.support.SupportManager manager) { manager.fileWorkspaces().createWithResponse("testworkspace", com.azure.core.util.Context.NONE); } } @@ -482,8 +456,7 @@ public final class FileWorkspacesCreateSamples { */ public final class FileWorkspacesGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetFileWorkspaceDetailsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetailsForSubscription.json */ /** * Sample code: Get details of a subscription file workspace. @@ -505,9 +478,7 @@ public final class FileWorkspacesGetSamples { */ public final class FileWorkspacesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFileWorkspace. - * json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspace.json */ /** * Sample code: Create a file workspace. @@ -528,8 +499,7 @@ public final class FileWorkspacesNoSubscriptionCreateSamples { */ public final class FileWorkspacesNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetFileWorkspaceDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetails.json */ /** * Sample code: Get details of a file workspace. @@ -550,17 +520,22 @@ public final class FileWorkspacesNoSubscriptionGetSamples { */ public final class FilesCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateFileForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileForSubscription.json */ /** - * Sample code: Create a subscription scoped file. + * Sample code: Create a file under a subscription workspace. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedFile(com.azure.resourcemanager.support.SupportManager manager) { - manager.files().define("test.txt").withExistingFileWorkspace("testworkspace").withChunkSize(41423) - .withFileSize(41423).withNumberOfChunks(1).create(); + public static void + createAFileUnderASubscriptionWorkspace(com.azure.resourcemanager.support.SupportManager manager) { + manager.files() + .define("test.txt") + .withExistingFileWorkspace("testworkspace") + .withChunkSize(41423) + .withFileSize(41423) + .withNumberOfChunks(1) + .create(); } } ``` @@ -573,8 +548,7 @@ public final class FilesCreateSamples { */ public final class FilesGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetFileDetailsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetailsForSubscription.json */ /** * Sample code: Get details of a subscription file. @@ -595,8 +569,7 @@ public final class FilesGetSamples { */ public final class FilesListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListFilesForSubscriptionUnderFileWorkspace.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesForSubscriptionUnderFileWorkspace.json */ /** * Sample code: List files under a workspace for a subscription. @@ -620,8 +593,7 @@ import com.azure.resourcemanager.support.models.UploadFile; */ public final class FilesUploadSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UploadFileForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFileForSubscription.json */ /** * Sample code: UploadFileForSubscription. @@ -629,9 +601,10 @@ public final class FilesUploadSamples { * @param manager Entry point to SupportManager. */ public static void uploadFileForSubscription(com.azure.resourcemanager.support.SupportManager manager) { - manager.files().uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( - "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") - .withChunkIndex(0), com.azure.core.util.Context.NONE); + manager.files() + .uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( + "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") + .withChunkIndex(0), com.azure.core.util.Context.NONE); } } ``` @@ -646,8 +619,7 @@ import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; */ public final class FilesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFile.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFile.json */ /** * Sample code: Create a file workspace. @@ -655,9 +627,10 @@ public final class FilesNoSubscriptionCreateSamples { * @param manager Entry point to SupportManager. */ public static void createAFileWorkspace(com.azure.resourcemanager.support.SupportManager manager) { - manager.filesNoSubscriptions().createWithResponse("testworkspace", "test.txt", - new FileDetailsInner().withChunkSize(41423).withFileSize(41423).withNumberOfChunks(1), - com.azure.core.util.Context.NONE); + manager.filesNoSubscriptions() + .createWithResponse("testworkspace", "test.txt", + new FileDetailsInner().withChunkSize(41423).withFileSize(41423).withNumberOfChunks(1), + com.azure.core.util.Context.NONE); } } ``` @@ -670,8 +643,7 @@ public final class FilesNoSubscriptionCreateSamples { */ public final class FilesNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetFileDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetails.json */ /** * Sample code: Get details of a subscription file. @@ -692,8 +664,7 @@ public final class FilesNoSubscriptionGetSamples { */ public final class FilesNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListFilesUnderFileWorkspace.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesUnderFileWorkspace.json */ /** * Sample code: List files under a workspace. @@ -716,8 +687,7 @@ import com.azure.resourcemanager.support.models.UploadFile; */ public final class FilesNoSubscriptionUploadSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UploadFile.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFile.json */ /** * Sample code: UploadFile. @@ -725,36 +695,10 @@ public final class FilesNoSubscriptionUploadSamples { * @param manager Entry point to SupportManager. */ public static void uploadFile(com.azure.resourcemanager.support.SupportManager manager) { - manager.filesNoSubscriptions().uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( - "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") - .withChunkIndex(0), com.azure.core.util.Context.NONE); - } -} -``` - -### LookUpResourceId_Post - -```java -import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; -import com.azure.resourcemanager.support.models.ResourceType; - -/** - * Samples for LookUpResourceId Post. - */ -public final class LookUpResourceIdPostSamples { - /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/LookUpResourceId. - * json - */ - /** - * Sample code: Look up resource id of support resource type. - * - * @param manager Entry point to SupportManager. - */ - public static void lookUpResourceIdOfSupportResourceType(com.azure.resourcemanager.support.SupportManager manager) { - manager.lookUpResourceIds().postWithResponse(new LookUpResourceIdRequest().withIdentifier("1234668596") - .withType(ResourceType.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE); + manager.filesNoSubscriptions() + .uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( + "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") + .withChunkIndex(0), com.azure.core.util.Context.NONE); } } ``` @@ -767,8 +711,7 @@ public final class LookUpResourceIdPostSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListOperations.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListOperations.json */ /** * Sample code: Get all operations. @@ -781,35 +724,6 @@ public final class OperationsListSamples { } ``` -### ProblemClassifications_ClassifyProblems - -```java -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; - -/** - * Samples for ProblemClassifications ClassifyProblems. - */ -public final class ProblemClassificationsClassifyProblemsSamples { - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ClassifyProblemClassificationsForSubscription.json - */ - /** - * Sample code: Classify list of problemClassifications for a specified Azure service for a subscription. - * - * @param manager Entry point to SupportManager. - */ - public static void classifyListOfProblemClassificationsForASpecifiedAzureServiceForASubscription( - com.azure.resourcemanager.support.SupportManager manager) { - manager.problemClassifications().classifyProblemsWithResponse("serviceId1", - new ProblemClassificationsClassificationInput().withIssueSummary("Can not connect to Windows VM") - .withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname"), - com.azure.core.util.Context.NONE); - } -} -``` - ### ProblemClassifications_Get ```java @@ -818,8 +732,7 @@ public final class ProblemClassificationsClassifyProblemsSamples { */ public final class ProblemClassificationsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetProblemClassification.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetProblemClassification.json */ /** * Sample code: Gets details of problemClassification for Azure service. @@ -828,8 +741,8 @@ public final class ProblemClassificationsGetSamples { */ public static void getsDetailsOfProblemClassificationForAzureService(com.azure.resourcemanager.support.SupportManager manager) { - manager.problemClassifications().getWithResponse("service_guid", "problemClassification_guid", - com.azure.core.util.Context.NONE); + manager.problemClassifications() + .getWithResponse("service_guid", "problemClassification_guid", com.azure.core.util.Context.NONE); } } ``` @@ -842,8 +755,7 @@ public final class ProblemClassificationsGetSamples { */ public final class ProblemClassificationsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListProblemClassifications.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListProblemClassifications.json */ /** * Sample code: Gets list of problemClassifications for a service for which a support ticket can be created. @@ -857,89 +769,6 @@ public final class ProblemClassificationsListSamples { } ``` -### ProblemClassificationsNoSubscription_ClassifyProblems - -```java -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; - -/** - * Samples for ProblemClassificationsNoSubscription ClassifyProblems. - */ -public final class ProblemClassificationsNoSubscriptionClassifyProblemsSamples { - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ClassifyProblemClassifications.json - */ - /** - * Sample code: Classify list of problemClassifications for a specified Azure service. - * - * @param manager Entry point to SupportManager. - */ - public static void classifyListOfProblemClassificationsForASpecifiedAzureService( - com.azure.resourcemanager.support.SupportManager manager) { - manager.problemClassificationsNoSubscriptions().classifyProblemsWithResponse("serviceId1", - new ProblemClassificationsClassificationInput().withIssueSummary("Can not connect to Windows VM"), - com.azure.core.util.Context.NONE); - } -} -``` - -### ServiceClassifications_ClassifyServices - -```java -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; - -/** - * Samples for ServiceClassifications ClassifyServices. - */ -public final class ServiceClassificationsClassifyServicesSamples { - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ClassifyServicesForSubscription.json - */ - /** - * Sample code: Classify list of Azure services for a subscription. - * - * @param manager Entry point to SupportManager. - */ - public static void - classifyListOfAzureServicesForASubscription(com.azure.resourcemanager.support.SupportManager manager) { - manager.serviceClassifications().classifyServicesWithResponse( - new ServiceClassificationRequest().withIssueSummary("Can not connect to Windows VM").withResourceId( - "/subscriptions/76cb77fa-8b17-4eab-9493-b65dace99813/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname"), - com.azure.core.util.Context.NONE); - } -} -``` - -### ServiceClassificationsNoSubscription_ClassifyServices - -```java -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; - -/** - * Samples for ServiceClassificationsNoSubscription ClassifyServices. - */ -public final class ServiceClassificationsNoSubscriptionClassifyServicesSamples { - /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ClassifyServices. - * json - */ - /** - * Sample code: Classify list of Azure services. - * - * @param manager Entry point to SupportManager. - */ - public static void classifyListOfAzureServices(com.azure.resourcemanager.support.SupportManager manager) { - manager.serviceClassificationsNoSubscriptions().classifyServicesWithResponse( - new ServiceClassificationRequest().withIssueSummary("Can not connect to Windows VM").withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname"), - com.azure.core.util.Context.NONE); - } -} -``` - ### Services_Get ```java @@ -948,8 +777,7 @@ public final class ServiceClassificationsNoSubscriptionClassifyServicesSamples { */ public final class ServicesGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetService.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetService.json */ /** * Sample code: Gets details of the Azure service. @@ -970,8 +798,7 @@ public final class ServicesGetSamples { */ public final class ServicesListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListServices.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListServices.json */ /** * Sample code: Gets list of services for which a support ticket can be created. @@ -996,19 +823,18 @@ import com.azure.resourcemanager.support.models.Type; */ public final class SupportTicketsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailabilityWithSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityWithSubscription.json */ /** - * Sample code: Checks whether name is available for subscription scoped SupportTicket resource. + * Sample code: Checks whether name is available for a subscription support ticket resource. * * @param manager Entry point to SupportManager. */ - public static void checksWhetherNameIsAvailableForSubscriptionScopedSupportTicketResource( + public static void checksWhetherNameIsAvailableForASubscriptionSupportTicketResource( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().checkNameAvailabilityWithResponse( - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), - com.azure.core.util.Context.NONE); + manager.supportTickets() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE); } } ``` @@ -1032,8 +858,7 @@ import java.util.Arrays; */ public final class SupportTicketsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatawarehouseQuotaTicketForDTUs.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json */ /** * Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics. @@ -1042,80 +867,68 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForDTUsForAzureSynapseAnalytics( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSubMgmtSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json */ /** - * Sample code: Create a subscription scoped ticket for Subscription Management related issues. + * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedTicketForSubscriptionManagementRelatedIssues( + public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066").create(); - } - - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json - */ - /** - * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. - * - * @param manager Entry point to SupportManager. - */ - public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount( - com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle( - "my title") - .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}")))) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateMachineLearningQuotaTicketForLowPriorityCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service. @@ -1124,25 +937,33 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("BatchAml") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription. @@ -1151,25 +972,33 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Subscription") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatabaseQuotaTicketForDTUs.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json */ /** * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. @@ -1178,25 +1007,33 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateGenericQuotaTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json */ /** * Sample code: Create a ticket to request Quota increase for services that do not require additional details in the @@ -1207,21 +1044,27 @@ public final class SupportTicketsCreateSamples { public static void createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket") + manager.supportTickets() + .define("testticket") .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") .withProblemClassificationId( "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid").create(); + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account. @@ -1230,81 +1073,141 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBillingSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json */ /** - * Sample code: Create a subscription scoped ticket for Billing related issues. + * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedTicketForBillingRelatedIssues( + public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/billing_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066").create(); + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("SQLMI") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList( + new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), + new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}")))) + .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlManagedInstanceQuotaTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json */ /** - * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. + * Sample code: Create a ticket for Subscription Management related issues for a subscription. * * @param manager Entry point to SupportManager. */ - public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance( + public static void createATicketForSubscriptionManagementRelatedIssuesForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.NO) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Technical issue related to a specific resource for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForTechnicalIssueRelatedToASpecificResourceForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("SQLMI").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList( - new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), - new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}")))) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withProblemScopingQuestions( + "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId( + "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) + .withSecondaryConsent(Arrays.asList( + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json */ /** * Sample code: Create a ticket to request Quota increase for Pools for a Batch account. @@ -1313,28 +1216,33 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) - .withTitle( - "my title") + .withTitle("my title") .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}")))) + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account. @@ -1343,26 +1251,34 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") .withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload( - "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload( + "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatabaseQuotaTicketForServers.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for SQL Database. @@ -1371,57 +1287,64 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForServersForSQLDatabase( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Servers") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests( + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateTechnicalSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json */ /** - * Sample code: Create a subscription scoped ticket for Technical issue related to a specific resource. + * Sample code: Create a ticket for Billing related issues. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedTicketForTechnicalIssueRelatedToASpecificResource( - com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions( - "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.NO) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withServiceId("/providers/Microsoft.Support/services/billing_service_guid") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId( - "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) - .withSecondaryConsent(Arrays.asList( - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateMachineLearningQuotaTicketForDedicatedCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service. @@ -1430,16 +1353,24 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("BatchAml") .withQuotaChangeRequestVersion("1.0") .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") @@ -1448,8 +1379,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatawarehouseQuotaTicketForServers.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics. @@ -1458,25 +1388,33 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Servers") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests( + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateCoresQuotaTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Compute VM Cores. @@ -1485,16 +1423,24 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForComputeVMCores(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestVersion("1.0") .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") .withPayload("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}")))) @@ -1511,8 +1457,7 @@ public final class SupportTicketsCreateSamples { */ public final class SupportTicketsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetSubscriptionSupportTicketDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSubscriptionSupportTicketDetails.json */ /** * Sample code: Get details of a subscription ticket. @@ -1533,8 +1478,7 @@ public final class SupportTicketsGetSamples { */ public final class SupportTicketsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsServiceIdEqualsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain service id for a subscription. @@ -1547,8 +1491,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in open state for a subscription. @@ -1557,13 +1500,12 @@ public final class SupportTicketsListSamples { */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", - com.azure.core.util.Context.NONE); + manager.supportTickets() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInUpdatingStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets in updating state for a subscription. @@ -1576,8 +1518,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state for a subscription. @@ -1586,13 +1527,13 @@ public final class SupportTicketsListSamples { */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingStateForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", - com.azure.core.util.Context.NONE); + manager.supportTickets() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsProblemClassificationIdEqualsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain problem classification id for a subscription. @@ -1601,13 +1542,13 @@ public final class SupportTicketsListSamples { */ public static void listSupportTicketsWithACertainProblemClassificationIdForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().list(null, "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", - com.azure.core.util.Context.NONE); + manager.supportTickets() + .list(null, "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsBySubscription.json */ /** * Sample code: List support tickets for a subscription. @@ -1619,8 +1560,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInOpenStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json */ /** * Sample code: List support tickets in open state for a subscription. @@ -1650,74 +1590,73 @@ import java.util.Arrays; */ public final class SupportTicketsUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json */ /** - * Sample code: Update advanced diagnostic consent of a support ticket. + * Sample code: Update advanced diagnostic consent of a subscription support ticket. * * @param manager Entry point to SupportManager. */ - public static void - updateAdvancedDiagnosticConsentOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + public static void updateAdvancedDiagnosticConsentOfASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); resource.update().withAdvancedDiagnosticConsent(Consent.YES).apply(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateContactDetailsOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json */ /** - * Sample code: Update contact details of a subscription scoped support ticket. + * Sample code: Update severity of a subscription support ticket. * * @param manager Entry point to SupportManager. */ - public static void updateContactDetailsOfASubscriptionScopedSupportTicket( - com.azure.resourcemanager.support.SupportManager manager) { + public static void + updateSeverityOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); - resource.update() - .withContactDetails(new UpdateContactProfile().withFirstName("first name").withLastName("last name") - .withPreferredContactMethod(PreferredContactMethod.EMAIL) - .withPrimaryEmailAddress("test.name@contoso.com") - .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) - .withPhoneNumber("123-456-7890").withPreferredTimeZone("Pacific Standard Time").withCountry("USA") - .withPreferredSupportLanguage("en-US")) - .apply(); + resource.update().withSeverity(SeverityLevel.CRITICAL).apply(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateStatusOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json */ /** - * Sample code: Update status of a subscription scoped support ticket. + * Sample code: Update status of a subscription support ticket. * * @param manager Entry point to SupportManager. */ public static void - updateStatusOfASubscriptionScopedSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + updateStatusOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); resource.update().withStatus(Status.CLOSED).apply(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateSeverityOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json */ /** - * Sample code: Update severity of a subscription scoped support ticket. + * Sample code: Update contact details of a subscription support ticket. * * @param manager Entry point to SupportManager. */ public static void - updateSeverityOfASubscriptionScopedSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + updateContactDetailsOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); - resource.update().withSeverity(SeverityLevel.CRITICAL).apply(); + resource.update() + .withContactDetails(new UpdateContactProfile().withFirstName("first name") + .withLastName("last name") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("test.name@contoso.com") + .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) + .withPhoneNumber("123-456-7890") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("USA") + .withPreferredSupportLanguage("en-US")) + .apply(); } } ``` @@ -1733,8 +1672,7 @@ import com.azure.resourcemanager.support.models.Type; */ public final class SupportTicketsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailability.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailability.json */ /** * Sample code: Checks whether name is available for SupportTicket resource. @@ -1743,9 +1681,9 @@ public final class SupportTicketsNoSubscriptionCheckNameAvailabilitySamples { */ public static void checksWhetherNameIsAvailableForSupportTicketResource(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().checkNameAvailabilityWithResponse( - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE); } } ``` @@ -1767,8 +1705,7 @@ import java.util.Arrays; */ public final class SupportTicketsNoSubscriptionCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBillingSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicket.json */ /** * Sample code: Create a ticket for Billing related issues. @@ -1776,25 +1713,29 @@ public final class SupportTicketsNoSubscriptionCreateSamples { * @param manager Entry point to SupportManager. */ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().create("testticket", new SupportTicketDetailsInner() - .withDescription("my description") - .withProblemClassificationId( - "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/billing_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSubMgmtSupportTicket.json + manager.supportTicketsNoSubscriptions() + .create("testticket", new SupportTicketDetailsInner().withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.NO) + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/billing_service_guid") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicket.json */ /** * Sample code: Create a ticket for Subscription Management related issues. @@ -1803,26 +1744,29 @@ public final class SupportTicketsNoSubscriptionCreateSamples { */ public static void createATicketForSubscriptionManagementRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().create("testticket", new SupportTicketDetailsInner() - .withDescription("my description") - .withProblemClassificationId( - "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateTechnicalSupportTicket.json + manager.supportTicketsNoSubscriptions() + .create("testticket", new SupportTicketDetailsInner().withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicket.json */ /** * Sample code: Create a ticket for Technical issue related to a specific resource. @@ -1831,25 +1775,29 @@ public final class SupportTicketsNoSubscriptionCreateSamples { */ public static void createATicketForTechnicalIssueRelatedToASpecificResource( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().create("testticket", new SupportTicketDetailsInner() - .withDescription("my description") - .withProblemClassificationId( - "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions( - "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") - .withSecondaryConsent(Arrays.asList( - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .create("testticket", new SupportTicketDetailsInner().withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions( + "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") + .withSecondaryConsent(Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES) + .withType("virtualmachinerunninglinuxservice"))), + com.azure.core.util.Context.NONE); } } ``` @@ -1862,8 +1810,7 @@ public final class SupportTicketsNoSubscriptionCreateSamples { */ public final class SupportTicketsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetSupportTicketDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSupportTicketDetails.json */ /** * Sample code: Get details of a ticket. @@ -1884,8 +1831,7 @@ public final class SupportTicketsNoSubscriptionGetSamples { */ public final class SupportTicketsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state. @@ -1894,13 +1840,13 @@ public final class SupportTicketsNoSubscriptionListSamples { */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingState( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, - "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInOpenState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenState.json */ /** * Sample code: List support tickets in open state. @@ -1912,9 +1858,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTickets. - * json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTickets.json */ /** * Sample code: List support tickets. @@ -1926,8 +1870,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInUpdatingState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingState.json */ /** * Sample code: List support tickets in updating state. @@ -1939,8 +1882,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json */ /** * Sample code: List support tickets created on or after a certain date and in open state. @@ -1949,13 +1891,12 @@ public final class SupportTicketsNoSubscriptionListSamples { */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsServiceIdEquals.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEquals.json */ /** * Sample code: List support tickets with a certain service id. @@ -1964,13 +1905,12 @@ public final class SupportTicketsNoSubscriptionListSamples { */ public static void listSupportTicketsWithACertainServiceId(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, "ServiceId eq 'vm_windows_service_guid'", - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "ServiceId eq 'vm_windows_service_guid'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsProblemClassificationIdEquals.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEquals.json */ /** * Sample code: List support tickets with a certain problem classification id. @@ -1979,8 +1919,9 @@ public final class SupportTicketsNoSubscriptionListSamples { */ public static void listSupportTicketsWithACertainProblemClassificationId( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, - "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", + com.azure.core.util.Context.NONE); } } ``` @@ -2001,8 +1942,7 @@ import java.util.Arrays; */ public final class SupportTicketsNoSubscriptionUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicket.json */ /** * Sample code: Update advanced diagnostic consent of a support ticket. @@ -2011,13 +1951,13 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { */ public static void updateAdvancedDiagnosticConsentOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withAdvancedDiagnosticConsent(Consent.YES), com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", new UpdateSupportTicket().withAdvancedDiagnosticConsent(Consent.YES), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateSeverityOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicket.json */ /** * Sample code: Update severity of a support ticket. @@ -2025,13 +1965,13 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { * @param manager Entry point to SupportManager. */ public static void updateSeverityOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL), com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateStatusOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicket.json */ /** * Sample code: Update status of a support ticket. @@ -2039,13 +1979,13 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { * @param manager Entry point to SupportManager. */ public static void updateStatusOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withStatus(Status.CLOSED), com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", new UpdateSupportTicket().withStatus(Status.CLOSED), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateContactDetailsOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicket.json */ /** * Sample code: Update contact details of a support ticket. @@ -2053,14 +1993,18 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { * @param manager Entry point to SupportManager. */ public static void updateContactDetailsOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withContactDetails(new UpdateContactProfile().withFirstName("first name") - .withLastName("last name").withPreferredContactMethod(PreferredContactMethod.EMAIL) - .withPrimaryEmailAddress("test.name@contoso.com") - .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) - .withPhoneNumber("123-456-7890").withPreferredTimeZone("Pacific Standard Time").withCountry("USA") - .withPreferredSupportLanguage("en-US")), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", + new UpdateSupportTicket().withContactDetails(new UpdateContactProfile().withFirstName("first name") + .withLastName("last name") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("test.name@contoso.com") + .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) + .withPhoneNumber("123-456-7890") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("USA") + .withPreferredSupportLanguage("en-US")), + com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/support/azure-resourcemanager-support/pom.xml b/sdk/support/azure-resourcemanager-support/pom.xml index 8178fa30850a..374bf33d72ef 100644 --- a/sdk/support/azure-resourcemanager-support/pom.xml +++ b/sdk/support/azure-resourcemanager-support/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-support - 1.0.0-beta.5 + 1.0.0 jar Microsoft Azure SDK for support Management - This package contains Microsoft Azure SDK for support Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Support Resource Provider. Package tag package-preview-2023-06. + This package contains Microsoft Azure SDK for support Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Support Resource Provider. Package tag package-2024-04. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - true @@ -82,6 +81,12 @@ 5.9.3 test + + org.slf4j + slf4j-simple + 1.7.36 + test + org.mockito mockito-core @@ -100,11 +105,5 @@ 1.14.12 test - - org.slf4j - slf4j-simple - 1.7.36 - test - diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/SupportManager.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/SupportManager.java index 81090daca9be..2380d78ea1ee 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/SupportManager.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/SupportManager.java @@ -11,8 +11,8 @@ import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -28,17 +28,13 @@ import com.azure.resourcemanager.support.implementation.ChatTranscriptsNoSubscriptionsImpl; import com.azure.resourcemanager.support.implementation.CommunicationsImpl; import com.azure.resourcemanager.support.implementation.CommunicationsNoSubscriptionsImpl; -import com.azure.resourcemanager.support.implementation.FileWorkspacesImpl; -import com.azure.resourcemanager.support.implementation.FileWorkspacesNoSubscriptionsImpl; import com.azure.resourcemanager.support.implementation.FilesImpl; import com.azure.resourcemanager.support.implementation.FilesNoSubscriptionsImpl; -import com.azure.resourcemanager.support.implementation.LookUpResourceIdsImpl; +import com.azure.resourcemanager.support.implementation.FileWorkspacesImpl; +import com.azure.resourcemanager.support.implementation.FileWorkspacesNoSubscriptionsImpl; import com.azure.resourcemanager.support.implementation.MicrosoftSupportBuilder; import com.azure.resourcemanager.support.implementation.OperationsImpl; import com.azure.resourcemanager.support.implementation.ProblemClassificationsImpl; -import com.azure.resourcemanager.support.implementation.ProblemClassificationsNoSubscriptionsImpl; -import com.azure.resourcemanager.support.implementation.ServiceClassificationsImpl; -import com.azure.resourcemanager.support.implementation.ServiceClassificationsNoSubscriptionsImpl; import com.azure.resourcemanager.support.implementation.ServicesImpl; import com.azure.resourcemanager.support.implementation.SupportTicketsImpl; import com.azure.resourcemanager.support.implementation.SupportTicketsNoSubscriptionsImpl; @@ -46,16 +42,12 @@ import com.azure.resourcemanager.support.models.ChatTranscriptsNoSubscriptions; import com.azure.resourcemanager.support.models.Communications; import com.azure.resourcemanager.support.models.CommunicationsNoSubscriptions; -import com.azure.resourcemanager.support.models.FileWorkspaces; -import com.azure.resourcemanager.support.models.FileWorkspacesNoSubscriptions; import com.azure.resourcemanager.support.models.Files; import com.azure.resourcemanager.support.models.FilesNoSubscriptions; -import com.azure.resourcemanager.support.models.LookUpResourceIds; +import com.azure.resourcemanager.support.models.FileWorkspaces; +import com.azure.resourcemanager.support.models.FileWorkspacesNoSubscriptions; import com.azure.resourcemanager.support.models.Operations; import com.azure.resourcemanager.support.models.ProblemClassifications; -import com.azure.resourcemanager.support.models.ProblemClassificationsNoSubscriptions; -import com.azure.resourcemanager.support.models.ServiceClassifications; -import com.azure.resourcemanager.support.models.ServiceClassificationsNoSubscriptions; import com.azure.resourcemanager.support.models.Services; import com.azure.resourcemanager.support.models.SupportTickets; import com.azure.resourcemanager.support.models.SupportTicketsNoSubscriptions; @@ -75,12 +67,6 @@ public final class SupportManager { private Services services; - private ServiceClassificationsNoSubscriptions serviceClassificationsNoSubscriptions; - - private ServiceClassifications serviceClassifications; - - private ProblemClassificationsNoSubscriptions problemClassificationsNoSubscriptions; - private ProblemClassifications problemClassifications; private SupportTickets supportTickets; @@ -103,16 +89,16 @@ public final class SupportManager { private FilesNoSubscriptions filesNoSubscriptions; - private LookUpResourceIds lookUpResourceIds; - private final MicrosoftSupport clientObject; private SupportManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new MicrosoftSupportBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval).buildClient(); + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** @@ -263,12 +249,19 @@ public SupportManager authenticate(TokenCredential credential, AzureProfile prof Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.support").append("/") - .append("1.0.0-beta.4"); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.support") + .append("/") + .append("1.0.0"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -287,18 +280,21 @@ public SupportManager authenticate(TokenCredential credential, AzureProfile prof policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new SupportManager(httpPipeline, profile, defaultPollInterval); } } @@ -327,45 +323,6 @@ public Services services() { return services; } - /** - * Gets the resource collection API of ServiceClassificationsNoSubscriptions. - * - * @return Resource collection API of ServiceClassificationsNoSubscriptions. - */ - public ServiceClassificationsNoSubscriptions serviceClassificationsNoSubscriptions() { - if (this.serviceClassificationsNoSubscriptions == null) { - this.serviceClassificationsNoSubscriptions = new ServiceClassificationsNoSubscriptionsImpl( - clientObject.getServiceClassificationsNoSubscriptions(), this); - } - return serviceClassificationsNoSubscriptions; - } - - /** - * Gets the resource collection API of ServiceClassifications. - * - * @return Resource collection API of ServiceClassifications. - */ - public ServiceClassifications serviceClassifications() { - if (this.serviceClassifications == null) { - this.serviceClassifications - = new ServiceClassificationsImpl(clientObject.getServiceClassifications(), this); - } - return serviceClassifications; - } - - /** - * Gets the resource collection API of ProblemClassificationsNoSubscriptions. - * - * @return Resource collection API of ProblemClassificationsNoSubscriptions. - */ - public ProblemClassificationsNoSubscriptions problemClassificationsNoSubscriptions() { - if (this.problemClassificationsNoSubscriptions == null) { - this.problemClassificationsNoSubscriptions = new ProblemClassificationsNoSubscriptionsImpl( - clientObject.getProblemClassificationsNoSubscriptions(), this); - } - return problemClassificationsNoSubscriptions; - } - /** * Gets the resource collection API of ProblemClassifications. * @@ -503,18 +460,6 @@ public FilesNoSubscriptions filesNoSubscriptions() { return filesNoSubscriptions; } - /** - * Gets the resource collection API of LookUpResourceIds. - * - * @return Resource collection API of LookUpResourceIds. - */ - public LookUpResourceIds lookUpResourceIds() { - if (this.lookUpResourceIds == null) { - this.lookUpResourceIds = new LookUpResourceIdsImpl(clientObject.getLookUpResourceIds(), this); - } - return lookUpResourceIds; - } - /** * Gets wrapped service client MicrosoftSupport providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/LookUpResourceIdsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/LookUpResourceIdsClient.java deleted file mode 100644 index ca725f44cda9..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/LookUpResourceIdsClient.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.support.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; -import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; - -/** - * An instance of this class provides access to all the operations defined in LookUpResourceIdsClient. - */ -public interface LookUpResourceIdsClient { - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response postWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, - Context context); - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - LookUpResourceIdResponseInner post(LookUpResourceIdRequest lookUpResourceIdRequest); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/MicrosoftSupport.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/MicrosoftSupport.java index a4376dbf2714..e45ad9ccd5d3 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/MicrosoftSupport.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/MicrosoftSupport.java @@ -60,27 +60,6 @@ public interface MicrosoftSupport { */ ServicesClient getServices(); - /** - * Gets the ServiceClassificationsNoSubscriptionsClient object to access its operations. - * - * @return the ServiceClassificationsNoSubscriptionsClient object. - */ - ServiceClassificationsNoSubscriptionsClient getServiceClassificationsNoSubscriptions(); - - /** - * Gets the ServiceClassificationsClient object to access its operations. - * - * @return the ServiceClassificationsClient object. - */ - ServiceClassificationsClient getServiceClassifications(); - - /** - * Gets the ProblemClassificationsNoSubscriptionsClient object to access its operations. - * - * @return the ProblemClassificationsNoSubscriptionsClient object. - */ - ProblemClassificationsNoSubscriptionsClient getProblemClassificationsNoSubscriptions(); - /** * Gets the ProblemClassificationsClient object to access its operations. * @@ -157,11 +136,4 @@ public interface MicrosoftSupport { * @return the FilesNoSubscriptionsClient object. */ FilesNoSubscriptionsClient getFilesNoSubscriptions(); - - /** - * Gets the LookUpResourceIdsClient object to access its operations. - * - * @return the LookUpResourceIdsClient object. - */ - LookUpResourceIdsClient getLookUpResourceIds(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsClient.java index fec7b982a82d..361c1fb240af 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsClient.java @@ -10,42 +10,11 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; /** * An instance of this class provides access to all the operations defined in ProblemClassificationsClient. */ public interface ProblemClassificationsClient { - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response classifyProblemsWithResponse(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput, Context context); - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProblemClassificationsClassificationOutputInner classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput); - /** * Lists all the problem classifications (categories) available for a specific Azure service. Always use the service * and problem classifications obtained programmatically. This practice ensures that you always have the most recent @@ -78,7 +47,7 @@ ProblemClassificationsClassificationOutputInner classifyProblems(String problemS /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -93,7 +62,7 @@ Response getWithResponse(String serviceName, String /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsNoSubscriptionsClient.java deleted file mode 100644 index b408a537a314..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsNoSubscriptionsClient.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.support.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; - -/** - * An instance of this class provides access to all the operations defined in - * ProblemClassificationsNoSubscriptionsClient. - */ -public interface ProblemClassificationsNoSubscriptionsClient { - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response classifyProblemsWithResponse(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput, Context context); - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProblemClassificationsClassificationOutputInner classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServiceClassificationsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServiceClassificationsClient.java deleted file mode 100644 index 0dc16a071fc1..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServiceClassificationsClient.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.support.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; - -/** - * An instance of this class provides access to all the operations defined in ServiceClassificationsClient. - */ -public interface ServiceClassificationsClient { - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context); - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceClassificationOutputInner classifyServices(ServiceClassificationRequest serviceClassificationRequest); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServiceClassificationsNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServiceClassificationsNoSubscriptionsClient.java deleted file mode 100644 index a695bec8f58c..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServiceClassificationsNoSubscriptionsClient.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.support.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; - -/** - * An instance of this class provides access to all the operations defined in - * ServiceClassificationsNoSubscriptionsClient. - */ -public interface ServiceClassificationsNoSubscriptionsClient { - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context); - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceClassificationOutputInner classifyServices(ServiceClassificationRequest serviceClassificationRequest); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServicesClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServicesClient.java index c6a9f674d54e..67669e94c1a7 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServicesClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ServicesClient.java @@ -50,7 +50,7 @@ public interface ServicesClient { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. @@ -63,7 +63,7 @@ public interface ServicesClient { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ClassificationService.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ClassificationService.java deleted file mode 100644 index f48a4c9bbd22..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ClassificationService.java +++ /dev/null @@ -1,85 +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.support.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Service Classification result object. - */ -@Fluent -public class ClassificationService { - /* - * Azure resource Id of the service. - */ - @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) - private String serviceId; - - /* - * Localized name of the azure service. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * List of applicable ARM resource types for this service. - */ - @JsonProperty(value = "resourceTypes") - private List resourceTypes; - - /** - * Creates an instance of ClassificationService class. - */ - public ClassificationService() { - } - - /** - * Get the serviceId property: Azure resource Id of the service. - * - * @return the serviceId value. - */ - public String serviceId() { - return this.serviceId; - } - - /** - * Get the displayName property: Localized name of the azure service. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the resourceTypes property: List of applicable ARM resource types for this service. - * - * @return the resourceTypes value. - */ - public List resourceTypes() { - return this.resourceTypes; - } - - /** - * Set the resourceTypes property: List of applicable ARM resource types for this service. - * - * @param resourceTypes the resourceTypes value to set. - * @return the ClassificationService object itself. - */ - public ClassificationService withResourceTypes(List resourceTypes) { - this.resourceTypes = resourceTypes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsInner.java index f57dc2f0c332..231a77344109 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.models.CommunicationDirection; import com.azure.resourcemanager.support.models.CommunicationType; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,8 +20,8 @@ public final class CommunicationDetailsInner extends ProxyResource { /* * Properties of the resource. */ - @JsonProperty(value = "properties") - private CommunicationDetailsProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private CommunicationDetailsProperties innerProperties = new CommunicationDetailsProperties(); /** * Creates an instance of CommunicationDetailsInner class. @@ -56,8 +57,7 @@ public CommunicationDirection communicationDirection() { } /** - * Get the sender property: Email address of the sender. This property is required if called by a service - * principal. + * Get the sender property: Email address of the sender. This property is required if called by a service principal. * * @return the sender value. */ @@ -66,8 +66,7 @@ public String sender() { } /** - * Set the sender property: Email address of the sender. This property is required if called by a service - * principal. + * Set the sender property: Email address of the sender. This property is required if called by a service principal. * * @param sender the sender value to set. * @return the CommunicationDetailsInner object itself. @@ -141,8 +140,14 @@ public OffsetDateTime createdDate() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model CommunicationDetailsInner")); + } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(CommunicationDetailsInner.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsProperties.java index 815cee35e58d..7c820948ea09 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsProperties.java @@ -77,8 +77,7 @@ public CommunicationDirection communicationDirection() { } /** - * Get the sender property: Email address of the sender. This property is required if called by a service - * principal. + * Get the sender property: Email address of the sender. This property is required if called by a service principal. * * @return the sender value. */ @@ -87,8 +86,7 @@ public String sender() { } /** - * Set the sender property: Email address of the sender. This property is required if called by a service - * principal. + * Set the sender property: Email address of the sender. This property is required if called by a service principal. * * @param sender the sender value to set. * @return the CommunicationDetailsProperties object itself. @@ -154,12 +152,14 @@ public OffsetDateTime createdDate() { */ public void validate() { if (subject() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property subject in model CommunicationDetailsProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property subject in model CommunicationDetailsProperties")); } if (body() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property body in model CommunicationDetailsProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property body in model CommunicationDetailsProperties")); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsInner.java index 02f78f51d94c..17da44152251 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsInner.java @@ -61,7 +61,8 @@ public OffsetDateTime createdOn() { } /** - * Get the chunkSize property: Size of each chunk. + * Get the chunkSize property: Size of each chunk. The size of each chunk should be provided in bytes and must not + * exceed 2.5 megabytes (MB). * * @return the chunkSize value. */ @@ -70,7 +71,8 @@ public Integer chunkSize() { } /** - * Set the chunkSize property: Size of each chunk. + * Set the chunkSize property: Size of each chunk. The size of each chunk should be provided in bytes and must not + * exceed 2.5 megabytes (MB). * * @param chunkSize the chunkSize value to set. * @return the FileDetailsInner object itself. @@ -84,7 +86,8 @@ public FileDetailsInner withChunkSize(Integer chunkSize) { } /** - * Get the fileSize property: Size of the file to be uploaded. + * Get the fileSize property: Size of the file to be uploaded. The file size must not exceed 5 MB and should be + * provided in bytes. * * @return the fileSize value. */ @@ -93,7 +96,8 @@ public Integer fileSize() { } /** - * Set the fileSize property: Size of the file to be uploaded. + * Set the fileSize property: Size of the file to be uploaded. The file size must not exceed 5 MB and should be + * provided in bytes. * * @param fileSize the fileSize value to set. * @return the FileDetailsInner object itself. @@ -107,7 +111,7 @@ public FileDetailsInner withFileSize(Integer fileSize) { } /** - * Get the numberOfChunks property: Number of chunks to be uploaded. + * Get the numberOfChunks property: Number of chunks to be uploaded. The maximum number of allowed chunks is 2. * * @return the numberOfChunks value. */ @@ -116,7 +120,7 @@ public Integer numberOfChunks() { } /** - * Set the numberOfChunks property: Number of chunks to be uploaded. + * Set the numberOfChunks property: Number of chunks to be uploaded. The maximum number of allowed chunks is 2. * * @param numberOfChunks the numberOfChunks value to set. * @return the FileDetailsInner object itself. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsProperties.java index 4bb89bbd7c51..a7c163a257ee 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsProperties.java @@ -20,19 +20,19 @@ public final class FileDetailsProperties { private OffsetDateTime createdOn; /* - * Size of each chunk + * Size of each chunk. The size of each chunk should be provided in bytes and must not exceed 2.5 megabytes (MB). */ @JsonProperty(value = "chunkSize") private Integer chunkSize; /* - * Size of the file to be uploaded + * Size of the file to be uploaded. The file size must not exceed 5 MB and should be provided in bytes. */ @JsonProperty(value = "fileSize") private Integer fileSize; /* - * Number of chunks to be uploaded + * Number of chunks to be uploaded. The maximum number of allowed chunks is 2. */ @JsonProperty(value = "numberOfChunks") private Integer numberOfChunks; @@ -53,7 +53,8 @@ public OffsetDateTime createdOn() { } /** - * Get the chunkSize property: Size of each chunk. + * Get the chunkSize property: Size of each chunk. The size of each chunk should be provided in bytes and must not + * exceed 2.5 megabytes (MB). * * @return the chunkSize value. */ @@ -62,7 +63,8 @@ public Integer chunkSize() { } /** - * Set the chunkSize property: Size of each chunk. + * Set the chunkSize property: Size of each chunk. The size of each chunk should be provided in bytes and must not + * exceed 2.5 megabytes (MB). * * @param chunkSize the chunkSize value to set. * @return the FileDetailsProperties object itself. @@ -73,7 +75,8 @@ public FileDetailsProperties withChunkSize(Integer chunkSize) { } /** - * Get the fileSize property: Size of the file to be uploaded. + * Get the fileSize property: Size of the file to be uploaded. The file size must not exceed 5 MB and should be + * provided in bytes. * * @return the fileSize value. */ @@ -82,7 +85,8 @@ public Integer fileSize() { } /** - * Set the fileSize property: Size of the file to be uploaded. + * Set the fileSize property: Size of the file to be uploaded. The file size must not exceed 5 MB and should be + * provided in bytes. * * @param fileSize the fileSize value to set. * @return the FileDetailsProperties object itself. @@ -93,7 +97,7 @@ public FileDetailsProperties withFileSize(Integer fileSize) { } /** - * Get the numberOfChunks property: Number of chunks to be uploaded. + * Get the numberOfChunks property: Number of chunks to be uploaded. The maximum number of allowed chunks is 2. * * @return the numberOfChunks value. */ @@ -102,7 +106,7 @@ public Integer numberOfChunks() { } /** - * Set the numberOfChunks property: Number of chunks to be uploaded. + * Set the numberOfChunks property: Number of chunks to be uploaded. The maximum number of allowed chunks is 2. * * @param numberOfChunks the numberOfChunks value to set. * @return the FileDetailsProperties object itself. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/LookUpResourceIdResponseInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/LookUpResourceIdResponseInner.java deleted file mode 100644 index f703cdc6c76a..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/LookUpResourceIdResponseInner.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.support.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The look up resource id response. - */ -@Fluent -public final class LookUpResourceIdResponseInner { - /* - * The resource Id of support resource type. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /** - * Creates an instance of LookUpResourceIdResponseInner class. - */ - public LookUpResourceIdResponseInner() { - } - - /** - * Get the resourceId property: The resource Id of support resource type. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The resource Id of support resource type. - * - * @param resourceId the resourceId value to set. - * @return the LookUpResourceIdResponseInner object itself. - */ - public LookUpResourceIdResponseInner withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationInner.java index 836b106ce8b0..c3203115b43a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationInner.java @@ -8,7 +8,6 @@ import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -import java.util.Map; /** * ProblemClassification resource object. @@ -37,7 +36,7 @@ public final class ProblemClassificationInner { * Properties of the resource. */ @JsonProperty(value = "properties") - private ProblemClassificationPropertiesInner innerProperties; + private ProblemClassificationProperties innerProperties; /** * Creates an instance of ProblemClassificationInner class. @@ -77,7 +76,7 @@ public String type() { * * @return the innerProperties value. */ - private ProblemClassificationPropertiesInner innerProperties() { + private ProblemClassificationProperties innerProperties() { return this.innerProperties; } @@ -98,7 +97,7 @@ public String displayName() { */ public ProblemClassificationInner withDisplayName(String displayName) { if (this.innerProperties() == null) { - this.innerProperties = new ProblemClassificationPropertiesInner(); + this.innerProperties = new ProblemClassificationProperties(); } this.innerProperties().withDisplayName(displayName); return this; @@ -124,47 +123,12 @@ public List secondaryConsentEnabled() { public ProblemClassificationInner withSecondaryConsentEnabled(List secondaryConsentEnabled) { if (this.innerProperties() == null) { - this.innerProperties = new ProblemClassificationPropertiesInner(); + this.innerProperties = new ProblemClassificationProperties(); } this.innerProperties().withSecondaryConsentEnabled(secondaryConsentEnabled); return this; } - /** - * Get the metadata property: String-to-string dictionary for additional metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Get the parentProblemClassification property: Reference to the parent problem classification which has same - * structure as problem classification. - * - * @return the parentProblemClassification value. - */ - public ProblemClassificationInner parentProblemClassification() { - return this.innerProperties() == null ? null : this.innerProperties().parentProblemClassification(); - } - - /** - * Set the parentProblemClassification property: Reference to the parent problem classification which has same - * structure as problem classification. - * - * @param parentProblemClassification the parentProblemClassification value to set. - * @return the ProblemClassificationInner object itself. - */ - public ProblemClassificationInner - withParentProblemClassification(ProblemClassificationInner parentProblemClassification) { - if (this.innerProperties() == null) { - this.innerProperties = new ProblemClassificationPropertiesInner(); - } - this.innerProperties().withParentProblemClassification(parentProblemClassification); - return this; - } - /** * Validates the instance. * diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationPropertiesInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java similarity index 50% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationPropertiesInner.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java index 7ea558dff96e..927aeaa0b4a8 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationPropertiesInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java @@ -6,16 +6,14 @@ import com.azure.core.annotation.Fluent; import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -import java.util.Map; /** * Details about a problem classification available for an Azure service. */ @Fluent -public final class ProblemClassificationPropertiesInner { +public final class ProblemClassificationProperties { /* * Localized name of problem classification. */ @@ -28,23 +26,10 @@ public final class ProblemClassificationPropertiesInner { @JsonProperty(value = "secondaryConsentEnabled") private List secondaryConsentEnabled; - /* - * String-to-string dictionary for additional metadata. - */ - @JsonProperty(value = "metadata", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - - /* - * Reference to the parent problem classification which has same structure as problem classification - */ - @JsonProperty(value = "parentProblemClassification") - private ProblemClassificationInner parentProblemClassification; - /** - * Creates an instance of ProblemClassificationPropertiesInner class. + * Creates an instance of ProblemClassificationProperties class. */ - public ProblemClassificationPropertiesInner() { + public ProblemClassificationProperties() { } /** @@ -60,9 +45,9 @@ public String displayName() { * Set the displayName property: Localized name of problem classification. * * @param displayName the displayName value to set. - * @return the ProblemClassificationPropertiesInner object itself. + * @return the ProblemClassificationProperties object itself. */ - public ProblemClassificationPropertiesInner withDisplayName(String displayName) { + public ProblemClassificationProperties withDisplayName(String displayName) { this.displayName = displayName; return this; } @@ -82,46 +67,14 @@ public List secondaryConsentEnabled() { * problem classification. * * @param secondaryConsentEnabled the secondaryConsentEnabled value to set. - * @return the ProblemClassificationPropertiesInner object itself. + * @return the ProblemClassificationProperties object itself. */ - public ProblemClassificationPropertiesInner + public ProblemClassificationProperties withSecondaryConsentEnabled(List secondaryConsentEnabled) { this.secondaryConsentEnabled = secondaryConsentEnabled; return this; } - /** - * Get the metadata property: String-to-string dictionary for additional metadata. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - - /** - * Get the parentProblemClassification property: Reference to the parent problem classification which has same - * structure as problem classification. - * - * @return the parentProblemClassification value. - */ - public ProblemClassificationInner parentProblemClassification() { - return this.parentProblemClassification; - } - - /** - * Set the parentProblemClassification property: Reference to the parent problem classification which has same - * structure as problem classification. - * - * @param parentProblemClassification the parentProblemClassification value to set. - * @return the ProblemClassificationPropertiesInner object itself. - */ - public ProblemClassificationPropertiesInner - withParentProblemClassification(ProblemClassificationInner parentProblemClassification) { - this.parentProblemClassification = parentProblemClassification; - return this; - } - /** * Validates the instance. * @@ -131,8 +84,5 @@ public void validate() { if (secondaryConsentEnabled() != null) { secondaryConsentEnabled().forEach(e -> e.validate()); } - if (parentProblemClassification() != null) { - parentProblemClassification().validate(); - } } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationsClassificationOutputInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationsClassificationOutputInner.java deleted file mode 100644 index 9c369f1c15b8..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationsClassificationOutputInner.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.support.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Output of the problem classification Classification API. - */ -@Fluent -public final class ProblemClassificationsClassificationOutputInner { - /* - * Set of problem classification objects classified. - */ - @JsonProperty(value = "problemClassificationResults") - private List problemClassificationResults; - - /** - * Creates an instance of ProblemClassificationsClassificationOutputInner class. - */ - public ProblemClassificationsClassificationOutputInner() { - } - - /** - * Get the problemClassificationResults property: Set of problem classification objects classified. - * - * @return the problemClassificationResults value. - */ - public List problemClassificationResults() { - return this.problemClassificationResults; - } - - /** - * Set the problemClassificationResults property: Set of problem classification objects classified. - * - * @param problemClassificationResults the problemClassificationResults value to set. - * @return the ProblemClassificationsClassificationOutputInner object itself. - */ - public ProblemClassificationsClassificationOutputInner withProblemClassificationResults( - List problemClassificationResults) { - this.problemClassificationResults = problemClassificationResults; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (problemClassificationResults() != null) { - problemClassificationResults().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceClassificationOutputInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceClassificationOutputInner.java deleted file mode 100644 index c602c841c76e..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceClassificationOutputInner.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.support.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.support.models.ServiceClassificationAnswer; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Output of the service classification API. - */ -@Fluent -public final class ServiceClassificationOutputInner { - /* - * Set of problem classification objects classified. - */ - @JsonProperty(value = "serviceClassificationResults") - private List serviceClassificationResults; - - /** - * Creates an instance of ServiceClassificationOutputInner class. - */ - public ServiceClassificationOutputInner() { - } - - /** - * Get the serviceClassificationResults property: Set of problem classification objects classified. - * - * @return the serviceClassificationResults value. - */ - public List serviceClassificationResults() { - return this.serviceClassificationResults; - } - - /** - * Set the serviceClassificationResults property: Set of problem classification objects classified. - * - * @param serviceClassificationResults the serviceClassificationResults value to set. - * @return the ServiceClassificationOutputInner object itself. - */ - public ServiceClassificationOutputInner - withServiceClassificationResults(List serviceClassificationResults) { - this.serviceClassificationResults = serviceClassificationResults; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (serviceClassificationResults() != null) { - serviceClassificationResults().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceInner.java index f7f1db7b1664..f42fa6de09bd 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -import java.util.Map; /** * Object that represents a Service resource. @@ -126,15 +125,6 @@ public ServiceInner withResourceTypes(List resourceTypes) { return this; } - /** - * Get the metadata property: Metadata about the service, only visible for 1P clients. - * - * @return the metadata value. - */ - public Map metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - /** * Validates the instance. * diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceProperties.java index 6d4095ed989f..206ab7b20f04 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceProperties.java @@ -5,10 +5,8 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -import java.util.Map; /** * Details about an Azure service available for support ticket creation. @@ -27,13 +25,6 @@ public final class ServiceProperties { @JsonProperty(value = "resourceTypes") private List resourceTypes; - /* - * Metadata about the service, only visible for 1P clients - */ - @JsonProperty(value = "metadata", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map metadata; - /** * Creates an instance of ServiceProperties class. */ @@ -80,15 +71,6 @@ public ServiceProperties withResourceTypes(List resourceTypes) { return this; } - /** - * Get the metadata property: Metadata about the service, only visible for 1P clients. - * - * @return the metadata value. - */ - public Map metadata() { - return this.metadata; - } - /** * Validates the instance. * diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsInner.java index 8154b75565a1..13ca838be138 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsInner.java @@ -6,6 +6,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; import com.azure.resourcemanager.support.models.IsTemporaryTicket; @@ -27,8 +28,8 @@ public final class SupportTicketDetailsInner extends ProxyResource { /* * Properties of the resource. */ - @JsonProperty(value = "properties") - private SupportTicketDetailsProperties innerProperties; + @JsonProperty(value = "properties", required = true) + private SupportTicketDetailsProperties innerProperties = new SupportTicketDetailsProperties(); /** * Creates an instance of SupportTicketDetailsInner class. @@ -572,8 +573,14 @@ public SupportTicketDetailsInner withSecondaryConsent(List sec * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model SupportTicketDetailsInner")); + } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(SupportTicketDetailsInner.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsProperties.java index bcf203bbc74f..454157be1649 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsProperties.java @@ -37,8 +37,7 @@ public final class SupportTicketDetailsProperties { private String description; /* - * Each Azure service has its own set of issue categories, also known as problem classification. This parameter is - * the unique Id for the type of problem you are experiencing. + * Each Azure service has its own set of issue categories, also known as problem classification. This parameter is the unique Id for the type of problem you are experiencing. */ @JsonProperty(value = "problemClassificationId", required = true) private String problemClassificationId; @@ -50,9 +49,7 @@ public final class SupportTicketDetailsProperties { private String problemClassificationDisplayName; /* - * A value that indicates the urgency of the case, which in turn determines the response time according to the - * service level agreement of the technical support plan you have with Azure. Note: 'Highest critical impact', also - * known as the 'Emergency - Severe impact' level in the Azure portal is reserved only for our Premium customers. + * A value that indicates the urgency of the case, which in turn determines the response time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest critical impact', also known as the 'Emergency - Severe impact' level in the Azure portal is reserved only for our Premium customers. */ @JsonProperty(value = "severity", required = true) private SeverityLevel severity; @@ -72,7 +69,7 @@ public final class SupportTicketDetailsProperties { /* * Advanced diagnostic consent to be updated on the support ticket. */ - @JsonProperty(value = "advancedDiagnosticConsent") + @JsonProperty(value = "advancedDiagnosticConsent", required = true) private Consent advancedDiagnosticConsent; /* @@ -666,20 +663,29 @@ public SupportTicketDetailsProperties withSecondaryConsent(List> post(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") LookUpResourceIdRequest lookUpResourceIdRequest, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - postWithResponseAsync(LookUpResourceIdRequest lookUpResourceIdRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lookUpResourceIdRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter lookUpResourceIdRequest is required and cannot be null.")); - } else { - lookUpResourceIdRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.post(this.client.getEndpoint(), this.client.getApiVersion(), - lookUpResourceIdRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - postWithResponseAsync(LookUpResourceIdRequest lookUpResourceIdRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (lookUpResourceIdRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter lookUpResourceIdRequest is required and cannot be null.")); - } else { - lookUpResourceIdRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.post(this.client.getEndpoint(), this.client.getApiVersion(), lookUpResourceIdRequest, accept, - context); - } - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono postAsync(LookUpResourceIdRequest lookUpResourceIdRequest) { - return postWithResponseAsync(lookUpResourceIdRequest).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response postWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, - Context context) { - return postWithResponseAsync(lookUpResourceIdRequest, context).block(); - } - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LookUpResourceIdResponseInner post(LookUpResourceIdRequest lookUpResourceIdRequest) { - return postWithResponse(lookUpResourceIdRequest, Context.NONE).getValue(); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdsImpl.java deleted file mode 100644 index a1aaff5f5b21..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdsImpl.java +++ /dev/null @@ -1,58 +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.support.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.support.fluent.LookUpResourceIdsClient; -import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; -import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; -import com.azure.resourcemanager.support.models.LookUpResourceIdResponse; -import com.azure.resourcemanager.support.models.LookUpResourceIds; - -public final class LookUpResourceIdsImpl implements LookUpResourceIds { - private static final ClientLogger LOGGER = new ClientLogger(LookUpResourceIdsImpl.class); - - private final LookUpResourceIdsClient innerClient; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - public LookUpResourceIdsImpl(LookUpResourceIdsClient innerClient, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response postWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, - Context context) { - Response inner - = this.serviceClient().postWithResponse(lookUpResourceIdRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new LookUpResourceIdResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public LookUpResourceIdResponse post(LookUpResourceIdRequest lookUpResourceIdRequest) { - LookUpResourceIdResponseInner inner = this.serviceClient().post(lookUpResourceIdRequest); - if (inner != null) { - return new LookUpResourceIdResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private LookUpResourceIdsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportBuilder.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportBuilder.java index 6e2841a949b8..16d30af2e3af 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportBuilder.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportBuilder.java @@ -123,11 +123,13 @@ public MicrosoftSupportBuilder serializerAdapter(SerializerAdapter serializerAda public MicrosoftSupportImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = (pipeline != null) ? pipeline + HttpPipeline localPipeline = (pipeline != null) + ? pipeline : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); Duration localDefaultPollInterval = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); MicrosoftSupportImpl client = new MicrosoftSupportImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java index f4adcecb0963..b952f8eeb32e 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.support.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -26,17 +27,13 @@ import com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.CommunicationsClient; import com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.FileWorkspacesClient; -import com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.FilesClient; import com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.LookUpResourceIdsClient; +import com.azure.resourcemanager.support.fluent.FileWorkspacesClient; +import com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.MicrosoftSupport; import com.azure.resourcemanager.support.fluent.OperationsClient; import com.azure.resourcemanager.support.fluent.ProblemClassificationsClient; -import com.azure.resourcemanager.support.fluent.ProblemClassificationsNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.ServiceClassificationsClient; -import com.azure.resourcemanager.support.fluent.ServiceClassificationsNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.ServicesClient; import com.azure.resourcemanager.support.fluent.SupportTicketsClient; import com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient; @@ -166,48 +163,6 @@ public ServicesClient getServices() { return this.services; } - /** - * The ServiceClassificationsNoSubscriptionsClient object to access its operations. - */ - private final ServiceClassificationsNoSubscriptionsClient serviceClassificationsNoSubscriptions; - - /** - * Gets the ServiceClassificationsNoSubscriptionsClient object to access its operations. - * - * @return the ServiceClassificationsNoSubscriptionsClient object. - */ - public ServiceClassificationsNoSubscriptionsClient getServiceClassificationsNoSubscriptions() { - return this.serviceClassificationsNoSubscriptions; - } - - /** - * The ServiceClassificationsClient object to access its operations. - */ - private final ServiceClassificationsClient serviceClassifications; - - /** - * Gets the ServiceClassificationsClient object to access its operations. - * - * @return the ServiceClassificationsClient object. - */ - public ServiceClassificationsClient getServiceClassifications() { - return this.serviceClassifications; - } - - /** - * The ProblemClassificationsNoSubscriptionsClient object to access its operations. - */ - private final ProblemClassificationsNoSubscriptionsClient problemClassificationsNoSubscriptions; - - /** - * Gets the ProblemClassificationsNoSubscriptionsClient object to access its operations. - * - * @return the ProblemClassificationsNoSubscriptionsClient object. - */ - public ProblemClassificationsNoSubscriptionsClient getProblemClassificationsNoSubscriptions() { - return this.problemClassificationsNoSubscriptions; - } - /** * The ProblemClassificationsClient object to access its operations. */ @@ -362,20 +317,6 @@ public FilesNoSubscriptionsClient getFilesNoSubscriptions() { return this.filesNoSubscriptions; } - /** - * The LookUpResourceIdsClient object to access its operations. - */ - private final LookUpResourceIdsClient lookUpResourceIds; - - /** - * Gets the LookUpResourceIdsClient object to access its operations. - * - * @return the LookUpResourceIdsClient object. - */ - public LookUpResourceIdsClient getLookUpResourceIds() { - return this.lookUpResourceIds; - } - /** * Initializes an instance of MicrosoftSupport client. * @@ -393,12 +334,9 @@ public LookUpResourceIdsClient getLookUpResourceIds() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-06-01-preview"; + this.apiVersion = "2024-04-01"; this.operations = new OperationsClientImpl(this); this.services = new ServicesClientImpl(this); - this.serviceClassificationsNoSubscriptions = new ServiceClassificationsNoSubscriptionsClientImpl(this); - this.serviceClassifications = new ServiceClassificationsClientImpl(this); - this.problemClassificationsNoSubscriptions = new ProblemClassificationsNoSubscriptionsClientImpl(this); this.problemClassifications = new ProblemClassificationsClientImpl(this); this.supportTickets = new SupportTicketsClientImpl(this); this.supportTicketsNoSubscriptions = new SupportTicketsNoSubscriptionsClientImpl(this); @@ -410,7 +348,6 @@ public LookUpResourceIdsClient getLookUpResourceIds() { this.fileWorkspacesNoSubscriptions = new FileWorkspacesNoSubscriptionsClientImpl(this); this.files = new FilesClientImpl(this); this.filesNoSubscriptions = new FilesNoSubscriptionsClientImpl(this); - this.lookUpResourceIds = new LookUpResourceIdsClientImpl(this); } /** @@ -473,8 +410,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, - SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -515,7 +452,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsClientImpl.java index 43e07f50fa20..1497df6ae3e8 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsClientImpl.java @@ -55,8 +55,8 @@ public final class OperationsClientImpl implements OperationsClient { } /** - * The interface defining all the services for MicrosoftSupportOperations to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for MicrosoftSupportOperations to be used by the proxy service to perform + * REST calls. */ @Host("{$host}") @ServiceInterface(name = "MicrosoftSupportOper") diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationImpl.java index 07f473412ad2..41c1ce02aa57 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationImpl.java @@ -9,7 +9,6 @@ import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; import java.util.Collections; import java.util.List; -import java.util.Map; public final class ProblemClassificationImpl implements ProblemClassification { private ProblemClassificationInner innerObject; @@ -47,24 +46,6 @@ public List secondaryConsentEnabled() { } } - public Map metadata() { - Map inner = this.innerModel().metadata(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ProblemClassification parentProblemClassification() { - ProblemClassificationInner inner = this.innerModel().parentProblemClassification(); - if (inner != null) { - return new ProblemClassificationImpl(inner, this.manager()); - } else { - return null; - } - } - public ProblemClassificationInner innerModel() { return this.innerObject; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationPropertiesImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationPropertiesImpl.java deleted file mode 100644 index 15655315d6e4..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationPropertiesImpl.java +++ /dev/null @@ -1,65 +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.support.implementation; - -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationPropertiesInner; -import com.azure.resourcemanager.support.models.ProblemClassification; -import com.azure.resourcemanager.support.models.ProblemClassificationProperties; -import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class ProblemClassificationPropertiesImpl implements ProblemClassificationProperties { - private ProblemClassificationPropertiesInner innerObject; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - ProblemClassificationPropertiesImpl(ProblemClassificationPropertiesInner innerObject, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public List secondaryConsentEnabled() { - List inner = this.innerModel().secondaryConsentEnabled(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Map metadata() { - Map inner = this.innerModel().metadata(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ProblemClassification parentProblemClassification() { - ProblemClassificationInner inner = this.innerModel().parentProblemClassification(); - if (inner != null) { - return new ProblemClassificationImpl(inner, this.manager()); - } else { - return null; - } - } - - public ProblemClassificationPropertiesInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClassificationOutputImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClassificationOutputImpl.java deleted file mode 100644 index 98ee7dcb6baf..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClassificationOutputImpl.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.support.implementation; - -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult; -import java.util.Collections; -import java.util.List; - -public final class ProblemClassificationsClassificationOutputImpl - implements ProblemClassificationsClassificationOutput { - private ProblemClassificationsClassificationOutputInner innerObject; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - ProblemClassificationsClassificationOutputImpl(ProblemClassificationsClassificationOutputInner innerObject, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List problemClassificationResults() { - List inner = this.innerModel().problemClassificationResults(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ProblemClassificationsClassificationOutputInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClientImpl.java index cc33ff55b9a9..370451d51899 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClientImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.support.implementation; -import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.Get; import com.azure.core.annotation.HeaderParam; @@ -12,7 +11,6 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -29,8 +27,6 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.ProblemClassificationsClient; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; import com.azure.resourcemanager.support.models.ProblemClassificationsListResult; import reactor.core.publisher.Mono; @@ -66,16 +62,6 @@ public final class ProblemClassificationsClientImpl implements ProblemClassifica @Host("{$host}") @ServiceInterface(name = "MicrosoftSupportProb") public interface ProblemClassificationsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> classifyProblems( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("problemServiceName") String problemServiceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ProblemClassificationsClassificationInput problemClassificationsClassificationInput, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/services/{serviceName}/problemClassifications") @ExpectedResponses({ 200 }) @@ -94,140 +80,6 @@ Mono> get(@HostParam("$host") String endpoi @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> classifyProblemsWithResponseAsync( - String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - 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 (problemServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter problemServiceName is required and cannot be null.")); - } - if (problemClassificationsClassificationInput == null) { - return Mono.error(new IllegalArgumentException( - "Parameter problemClassificationsClassificationInput is required and cannot be null.")); - } else { - problemClassificationsClassificationInput.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.classifyProblems(this.client.getEndpoint(), this.client.getSubscriptionId(), - problemServiceName, this.client.getApiVersion(), problemClassificationsClassificationInput, accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> classifyProblemsWithResponseAsync( - String problemServiceName, ProblemClassificationsClassificationInput problemClassificationsClassificationInput, - 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 (problemServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter problemServiceName is required and cannot be null.")); - } - if (problemClassificationsClassificationInput == null) { - return Mono.error(new IllegalArgumentException( - "Parameter problemClassificationsClassificationInput is required and cannot be null.")); - } else { - problemClassificationsClassificationInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.classifyProblems(this.client.getEndpoint(), this.client.getSubscriptionId(), problemServiceName, - this.client.getApiVersion(), problemClassificationsClassificationInput, accept, context); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono classifyProblemsAsync(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - return classifyProblemsWithResponseAsync(problemServiceName, problemClassificationsClassificationInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response classifyProblemsWithResponse( - String problemServiceName, ProblemClassificationsClassificationInput problemClassificationsClassificationInput, - Context context) { - return classifyProblemsWithResponseAsync(problemServiceName, problemClassificationsClassificationInput, context) - .block(); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProblemClassificationsClassificationOutputInner classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - return classifyProblemsWithResponse(problemServiceName, problemClassificationsClassificationInput, Context.NONE) - .getValue(); - } - /** * Lists all the problem classifications (categories) available for a specific Azure service. Always use the service * and problem classifications obtained programmatically. This practice ensures that you always have the most recent @@ -356,7 +208,7 @@ public PagedIterable list(String serviceName, Contex /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -388,7 +240,7 @@ private Mono> getWithResponseAsync(String s /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -420,7 +272,7 @@ private Mono> getWithResponseAsync(String s /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -436,7 +288,7 @@ private Mono getAsync(String serviceName, String pro /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -453,7 +305,7 @@ public Response getWithResponse(String serviceName, /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsImpl.java index d7544944a60e..8b7e3dc2cc57 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsImpl.java @@ -11,11 +11,8 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.ProblemClassificationsClient; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; import com.azure.resourcemanager.support.models.ProblemClassification; import com.azure.resourcemanager.support.models.ProblemClassifications; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; public final class ProblemClassificationsImpl implements ProblemClassifications { private static final ClientLogger LOGGER = new ClientLogger(ProblemClassificationsImpl.class); @@ -30,29 +27,6 @@ public ProblemClassificationsImpl(ProblemClassificationsClient innerClient, this.serviceManager = serviceManager; } - public Response classifyProblemsWithResponse(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput, Context context) { - Response inner = this.serviceClient() - .classifyProblemsWithResponse(problemServiceName, problemClassificationsClassificationInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProblemClassificationsClassificationOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ProblemClassificationsClassificationOutput classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - ProblemClassificationsClassificationOutputInner inner - = this.serviceClient().classifyProblems(problemServiceName, problemClassificationsClassificationInput); - if (inner != null) { - return new ProblemClassificationsClassificationOutputImpl(inner, this.manager()); - } else { - return null; - } - } - public PagedIterable list(String serviceName) { PagedIterable inner = this.serviceClient().list(serviceName); return ResourceManagerUtils.mapPage(inner, inner1 -> new ProblemClassificationImpl(inner1, this.manager())); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsNoSubscriptionsClientImpl.java deleted file mode 100644 index 3b9adce8bf38..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsNoSubscriptionsClientImpl.java +++ /dev/null @@ -1,199 +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.support.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.support.fluent.ProblemClassificationsNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * ProblemClassificationsNoSubscriptionsClient. - */ -public final class ProblemClassificationsNoSubscriptionsClientImpl - implements ProblemClassificationsNoSubscriptionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ProblemClassificationsNoSubscriptionsService service; - - /** - * The service client containing this operation class. - */ - private final MicrosoftSupportImpl client; - - /** - * Initializes an instance of ProblemClassificationsNoSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ProblemClassificationsNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { - this.service = RestProxy.create(ProblemClassificationsNoSubscriptionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MicrosoftSupportProblemClassificationsNoSubscriptions to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportProb") - public interface ProblemClassificationsNoSubscriptionsService { - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> classifyProblems( - @HostParam("$host") String endpoint, @PathParam("problemServiceName") String problemServiceName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ProblemClassificationsClassificationInput problemClassificationsClassificationInput, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> classifyProblemsWithResponseAsync( - String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (problemServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter problemServiceName is required and cannot be null.")); - } - if (problemClassificationsClassificationInput == null) { - return Mono.error(new IllegalArgumentException( - "Parameter problemClassificationsClassificationInput is required and cannot be null.")); - } else { - problemClassificationsClassificationInput.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.classifyProblems(this.client.getEndpoint(), problemServiceName, - this.client.getApiVersion(), problemClassificationsClassificationInput, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> classifyProblemsWithResponseAsync( - String problemServiceName, ProblemClassificationsClassificationInput problemClassificationsClassificationInput, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (problemServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter problemServiceName is required and cannot be null.")); - } - if (problemClassificationsClassificationInput == null) { - return Mono.error(new IllegalArgumentException( - "Parameter problemClassificationsClassificationInput is required and cannot be null.")); - } else { - problemClassificationsClassificationInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.classifyProblems(this.client.getEndpoint(), problemServiceName, this.client.getApiVersion(), - problemClassificationsClassificationInput, accept, context); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono classifyProblemsAsync(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - return classifyProblemsWithResponseAsync(problemServiceName, problemClassificationsClassificationInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response classifyProblemsWithResponse( - String problemServiceName, ProblemClassificationsClassificationInput problemClassificationsClassificationInput, - Context context) { - return classifyProblemsWithResponseAsync(problemServiceName, problemClassificationsClassificationInput, context) - .block(); - } - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ProblemClassificationsClassificationOutputInner classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - return classifyProblemsWithResponse(problemServiceName, problemClassificationsClassificationInput, Context.NONE) - .getValue(); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsNoSubscriptionsImpl.java deleted file mode 100644 index b2a10059c2f6..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsNoSubscriptionsImpl.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.support.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.support.fluent.ProblemClassificationsNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; -import com.azure.resourcemanager.support.models.ProblemClassificationsNoSubscriptions; - -public final class ProblemClassificationsNoSubscriptionsImpl implements ProblemClassificationsNoSubscriptions { - private static final ClientLogger LOGGER = new ClientLogger(ProblemClassificationsNoSubscriptionsImpl.class); - - private final ProblemClassificationsNoSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - public ProblemClassificationsNoSubscriptionsImpl(ProblemClassificationsNoSubscriptionsClient innerClient, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response classifyProblemsWithResponse(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput, Context context) { - Response inner = this.serviceClient() - .classifyProblemsWithResponse(problemServiceName, problemClassificationsClassificationInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProblemClassificationsClassificationOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ProblemClassificationsClassificationOutput classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput) { - ProblemClassificationsClassificationOutputInner inner - = this.serviceClient().classifyProblems(problemServiceName, problemClassificationsClassificationInput); - if (inner != null) { - return new ProblemClassificationsClassificationOutputImpl(inner, this.manager()); - } else { - return null; - } - } - - private ProblemClassificationsNoSubscriptionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ResourceManagerUtils.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ResourceManagerUtils.java index 446f6f2ce1c5..5ea3d4a24adc 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ResourceManagerUtils.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationOutputImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationOutputImpl.java deleted file mode 100644 index 7686a14d865e..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationOutputImpl.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.support.implementation; - -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationAnswer; -import com.azure.resourcemanager.support.models.ServiceClassificationOutput; -import java.util.Collections; -import java.util.List; - -public final class ServiceClassificationOutputImpl implements ServiceClassificationOutput { - private ServiceClassificationOutputInner innerObject; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - ServiceClassificationOutputImpl(ServiceClassificationOutputInner innerObject, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List serviceClassificationResults() { - List inner = this.innerModel().serviceClassificationResults(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ServiceClassificationOutputInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsClientImpl.java deleted file mode 100644 index 0f537bd1278b..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsClientImpl.java +++ /dev/null @@ -1,186 +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.support.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.support.fluent.ServiceClassificationsClient; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in ServiceClassificationsClient. - */ -public final class ServiceClassificationsClientImpl implements ServiceClassificationsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ServiceClassificationsService service; - - /** - * The service client containing this operation class. - */ - private final MicrosoftSupportImpl client; - - /** - * Initializes an instance of ServiceClassificationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServiceClassificationsClientImpl(MicrosoftSupportImpl client) { - this.service = RestProxy.create(ServiceClassificationsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MicrosoftSupportServiceClassifications to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportServ") - public interface ServiceClassificationsService { - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/classifyServices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> classifyServices(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceClassificationRequest serviceClassificationRequest, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - classifyServicesWithResponseAsync(ServiceClassificationRequest serviceClassificationRequest) { - 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 (serviceClassificationRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter serviceClassificationRequest is required and cannot be null.")); - } else { - serviceClassificationRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.classifyServices(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), serviceClassificationRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - classifyServicesWithResponseAsync(ServiceClassificationRequest serviceClassificationRequest, 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 (serviceClassificationRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter serviceClassificationRequest is required and cannot be null.")); - } else { - serviceClassificationRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.classifyServices(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), serviceClassificationRequest, accept, context); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - classifyServicesAsync(ServiceClassificationRequest serviceClassificationRequest) { - return classifyServicesWithResponseAsync(serviceClassificationRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context) { - return classifyServicesWithResponseAsync(serviceClassificationRequest, context).block(); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceClassificationOutputInner - classifyServices(ServiceClassificationRequest serviceClassificationRequest) { - return classifyServicesWithResponse(serviceClassificationRequest, Context.NONE).getValue(); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsImpl.java deleted file mode 100644 index 9b5c824469fd..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsImpl.java +++ /dev/null @@ -1,58 +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.support.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.support.fluent.ServiceClassificationsClient; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationOutput; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import com.azure.resourcemanager.support.models.ServiceClassifications; - -public final class ServiceClassificationsImpl implements ServiceClassifications { - private static final ClientLogger LOGGER = new ClientLogger(ServiceClassificationsImpl.class); - - private final ServiceClassificationsClient innerClient; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - public ServiceClassificationsImpl(ServiceClassificationsClient innerClient, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context) { - Response inner - = this.serviceClient().classifyServicesWithResponse(serviceClassificationRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceClassificationOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServiceClassificationOutput classifyServices(ServiceClassificationRequest serviceClassificationRequest) { - ServiceClassificationOutputInner inner = this.serviceClient().classifyServices(serviceClassificationRequest); - if (inner != null) { - return new ServiceClassificationOutputImpl(inner, this.manager()); - } else { - return null; - } - } - - private ServiceClassificationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsNoSubscriptionsClientImpl.java deleted file mode 100644 index ac87e685f25d..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsNoSubscriptionsClientImpl.java +++ /dev/null @@ -1,179 +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.support.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.support.fluent.ServiceClassificationsNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * ServiceClassificationsNoSubscriptionsClient. - */ -public final class ServiceClassificationsNoSubscriptionsClientImpl - implements ServiceClassificationsNoSubscriptionsClient { - /** - * The proxy service used to perform REST calls. - */ - private final ServiceClassificationsNoSubscriptionsService service; - - /** - * The service client containing this operation class. - */ - private final MicrosoftSupportImpl client; - - /** - * Initializes an instance of ServiceClassificationsNoSubscriptionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServiceClassificationsNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { - this.service = RestProxy.create(ServiceClassificationsNoSubscriptionsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for MicrosoftSupportServiceClassificationsNoSubscriptions to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportServ") - public interface ServiceClassificationsNoSubscriptionsService { - @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Support/classifyServices") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> classifyServices(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ServiceClassificationRequest serviceClassificationRequest, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - classifyServicesWithResponseAsync(ServiceClassificationRequest serviceClassificationRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceClassificationRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter serviceClassificationRequest is required and cannot be null.")); - } else { - serviceClassificationRequest.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.classifyServices(this.client.getEndpoint(), this.client.getApiVersion(), - serviceClassificationRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - classifyServicesWithResponseAsync(ServiceClassificationRequest serviceClassificationRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceClassificationRequest == null) { - return Mono.error( - new IllegalArgumentException("Parameter serviceClassificationRequest is required and cannot be null.")); - } else { - serviceClassificationRequest.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.classifyServices(this.client.getEndpoint(), this.client.getApiVersion(), - serviceClassificationRequest, accept, context); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - classifyServicesAsync(ServiceClassificationRequest serviceClassificationRequest) { - return classifyServicesWithResponseAsync(serviceClassificationRequest) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context) { - return classifyServicesWithResponseAsync(serviceClassificationRequest, context).block(); - } - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceClassificationOutputInner - classifyServices(ServiceClassificationRequest serviceClassificationRequest) { - return classifyServicesWithResponse(serviceClassificationRequest, Context.NONE).getValue(); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsNoSubscriptionsImpl.java deleted file mode 100644 index 21ec14ad7ac7..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationsNoSubscriptionsImpl.java +++ /dev/null @@ -1,58 +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.support.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.support.fluent.ServiceClassificationsNoSubscriptionsClient; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationOutput; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import com.azure.resourcemanager.support.models.ServiceClassificationsNoSubscriptions; - -public final class ServiceClassificationsNoSubscriptionsImpl implements ServiceClassificationsNoSubscriptions { - private static final ClientLogger LOGGER = new ClientLogger(ServiceClassificationsNoSubscriptionsImpl.class); - - private final ServiceClassificationsNoSubscriptionsClient innerClient; - - private final com.azure.resourcemanager.support.SupportManager serviceManager; - - public ServiceClassificationsNoSubscriptionsImpl(ServiceClassificationsNoSubscriptionsClient innerClient, - com.azure.resourcemanager.support.SupportManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context) { - Response inner - = this.serviceClient().classifyServicesWithResponse(serviceClassificationRequest, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceClassificationOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServiceClassificationOutput classifyServices(ServiceClassificationRequest serviceClassificationRequest) { - ServiceClassificationOutputInner inner = this.serviceClient().classifyServices(serviceClassificationRequest); - if (inner != null) { - return new ServiceClassificationOutputImpl(inner, this.manager()); - } else { - return null; - } - } - - private ServiceClassificationsNoSubscriptionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.support.SupportManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceImpl.java index 0b47c5126fa4..d9c67d45023e 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceImpl.java @@ -8,7 +8,6 @@ import com.azure.resourcemanager.support.models.Service; import java.util.Collections; import java.util.List; -import java.util.Map; public final class ServiceImpl implements Service { private ServiceInner innerObject; @@ -45,15 +44,6 @@ public List resourceTypes() { } } - public Map metadata() { - Map inner = this.innerModel().metadata(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public ServiceInner innerModel() { return this.innerObject; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesClientImpl.java index 5a027938c0f3..7dfdec31a05c 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesClientImpl.java @@ -208,7 +208,7 @@ public PagedIterable list(Context context) { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. @@ -234,7 +234,7 @@ private Mono> getWithResponseAsync(String serviceName) { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. @@ -259,7 +259,7 @@ private Mono> getWithResponseAsync(String serviceName, Co /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. @@ -273,7 +273,7 @@ private Mono getAsync(String serviceName) { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. @@ -288,7 +288,7 @@ public Response getWithResponse(String serviceName, Context contex /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketDetailsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketDetailsImpl.java index 587928a6457c..b8b40b27d5a7 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketDetailsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketDetailsImpl.java @@ -167,8 +167,9 @@ private com.azure.resourcemanager.support.SupportManager manager() { private UpdateSupportTicket updateUpdateSupportTicket; public SupportTicketDetails create() { - this.innerObject = serviceManager.serviceClient().getSupportTickets().create(supportTicketName, - this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getSupportTickets() + .create(supportTicketName, this.innerModel(), Context.NONE); return this; } @@ -190,14 +191,18 @@ public SupportTicketDetailsImpl update() { } public SupportTicketDetails apply() { - this.innerObject = serviceManager.serviceClient().getSupportTickets() - .updateWithResponse(supportTicketName, updateUpdateSupportTicket, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getSupportTickets() + .updateWithResponse(supportTicketName, updateUpdateSupportTicket, Context.NONE) + .getValue(); return this; } public SupportTicketDetails apply(Context context) { - this.innerObject = serviceManager.serviceClient().getSupportTickets() - .updateWithResponse(supportTicketName, updateUpdateSupportTicket, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getSupportTickets() + .updateWithResponse(supportTicketName, updateUpdateSupportTicket, context) + .getValue(); return this; } @@ -209,8 +214,10 @@ public SupportTicketDetails apply(Context context) { } public SupportTicketDetails refresh() { - this.innerObject = serviceManager.serviceClient().getSupportTickets() - .getWithResponse(supportTicketName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getSupportTickets() + .getWithResponse(supportTicketName, Context.NONE) + .getValue(); return this; } @@ -220,11 +227,6 @@ public SupportTicketDetails refresh(Context context) { return this; } - public SupportTicketDetailsImpl withSupportTicketId(String supportTicketId) { - this.innerModel().withSupportTicketId(supportTicketId); - return this; - } - public SupportTicketDetailsImpl withDescription(String description) { this.innerModel().withDescription(description); return this; @@ -245,16 +247,6 @@ public SupportTicketDetailsImpl withSeverity(SeverityLevel severity) { } } - public SupportTicketDetailsImpl withEnrollmentId(String enrollmentId) { - this.innerModel().withEnrollmentId(enrollmentId); - return this; - } - - public SupportTicketDetailsImpl withRequire24X7Response(Boolean require24X7Response) { - this.innerModel().withRequire24X7Response(require24X7Response); - return this; - } - public SupportTicketDetailsImpl withAdvancedDiagnosticConsent(Consent advancedDiagnosticConsent) { if (isInCreateMode()) { this.innerModel().withAdvancedDiagnosticConsent(advancedDiagnosticConsent); @@ -265,6 +257,36 @@ public SupportTicketDetailsImpl withAdvancedDiagnosticConsent(Consent advancedDi } } + public SupportTicketDetailsImpl withContactDetails(ContactProfile contactDetails) { + this.innerModel().withContactDetails(contactDetails); + return this; + } + + public SupportTicketDetailsImpl withTitle(String title) { + this.innerModel().withTitle(title); + return this; + } + + public SupportTicketDetailsImpl withServiceId(String serviceId) { + this.innerModel().withServiceId(serviceId); + return this; + } + + public SupportTicketDetailsImpl withSupportTicketId(String supportTicketId) { + this.innerModel().withSupportTicketId(supportTicketId); + return this; + } + + public SupportTicketDetailsImpl withEnrollmentId(String enrollmentId) { + this.innerModel().withEnrollmentId(enrollmentId); + return this; + } + + public SupportTicketDetailsImpl withRequire24X7Response(Boolean require24X7Response) { + this.innerModel().withRequire24X7Response(require24X7Response); + return this; + } + public SupportTicketDetailsImpl withProblemScopingQuestions(String problemScopingQuestions) { this.innerModel().withProblemScopingQuestions(problemScopingQuestions); return this; @@ -275,11 +297,6 @@ public SupportTicketDetailsImpl withSupportPlanId(String supportPlanId) { return this; } - public SupportTicketDetailsImpl withContactDetails(ContactProfile contactDetails) { - this.innerModel().withContactDetails(contactDetails); - return this; - } - public SupportTicketDetailsImpl withServiceLevelAgreement(ServiceLevelAgreement serviceLevelAgreement) { this.innerModel().withServiceLevelAgreement(serviceLevelAgreement); return this; @@ -290,21 +307,11 @@ public SupportTicketDetailsImpl withSupportEngineer(SupportEngineer supportEngin return this; } - public SupportTicketDetailsImpl withTitle(String title) { - this.innerModel().withTitle(title); - return this; - } - public SupportTicketDetailsImpl withProblemStartTime(OffsetDateTime problemStartTime) { this.innerModel().withProblemStartTime(problemStartTime); return this; } - public SupportTicketDetailsImpl withServiceId(String serviceId) { - this.innerModel().withServiceId(serviceId); - return this; - } - public SupportTicketDetailsImpl withFileWorkspaceName(String fileWorkspaceName) { this.innerModel().withFileWorkspaceName(fileWorkspaceName); return this; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsClientImpl.java index d6e784cbf61e..21b23140db46 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsClientImpl.java @@ -68,8 +68,8 @@ public final class SupportTicketsNoSubscriptionsClientImpl implements SupportTic } /** - * The interface defining all the services for MicrosoftSupportSupportTicketsNoSubscriptions to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for MicrosoftSupportSupportTicketsNoSubscriptions to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "MicrosoftSupportSupp") diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityInput.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityInput.java index a1d43a3dd9ab..4e0b4d60aba5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityInput.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityInput.java @@ -78,12 +78,14 @@ public CheckNameAvailabilityInput withType(Type type) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); } if (type() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDetails.java index 9d5c21ca506c..7964dd4bcf49 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDetails.java @@ -86,8 +86,8 @@ public interface CommunicationDetails { /** * The entirety of the CommunicationDetails definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithParentResource, + DefinitionStages.WithSubject, DefinitionStages.WithBody, DefinitionStages.WithCreate { } /** @@ -110,15 +110,40 @@ interface WithParentResource { * @param supportTicketName Support ticket name. * @return the next definition stage. */ - WithCreate withExistingSupportTicket(String supportTicketName); + WithSubject withExistingSupportTicket(String supportTicketName); + } + + /** + * The stage of the CommunicationDetails definition allowing to specify subject. + */ + interface WithSubject { + /** + * Specifies the subject property: Subject of the communication.. + * + * @param subject Subject of the communication. + * @return the next definition stage. + */ + WithBody withSubject(String subject); + } + + /** + * The stage of the CommunicationDetails definition allowing to specify body. + */ + interface WithBody { + /** + * Specifies the body property: Body of the communication.. + * + * @param body Body of the communication. + * @return the next definition stage. + */ + WithCreate withBody(String body); } /** * The stage of the CommunicationDetails 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.WithSender, DefinitionStages.WithSubject, DefinitionStages.WithBody { + interface WithCreate extends DefinitionStages.WithSender { /** * Executes the create request. * @@ -148,32 +173,6 @@ interface WithSender { */ WithCreate withSender(String sender); } - - /** - * The stage of the CommunicationDetails definition allowing to specify subject. - */ - interface WithSubject { - /** - * Specifies the subject property: Subject of the communication.. - * - * @param subject Subject of the communication. - * @return the next definition stage. - */ - WithCreate withSubject(String subject); - } - - /** - * The stage of the CommunicationDetails definition allowing to specify body. - */ - interface WithBody { - /** - * Specifies the body property: Body of the communication.. - * - * @param body Body of the communication. - * @return the next definition stage. - */ - WithCreate withBody(String body); - } } /** diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ContactProfile.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ContactProfile.java index 9ee337237e04..59617eb70747 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ContactProfile.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ContactProfile.java @@ -51,8 +51,7 @@ public final class ContactProfile { private String phoneNumber; /* - * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index - * Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). + * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). */ @JsonProperty(value = "preferredTimeZone", required = true) private String preferredTimeZone; @@ -64,12 +63,7 @@ public final class ContactProfile { private String country; /* - * Preferred language of support from Azure. Support languages vary based on the severity you choose for your - * support ticket. Learn more at [Azure Severity and - * responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard language-country code. - * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' - * for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for - * Chinese and 'de-de' for German. + * Preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at [Azure Severity and responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. */ @JsonProperty(value = "preferredSupportLanguage", required = true) private String preferredSupportLanguage; @@ -161,8 +155,8 @@ public ContactProfile withPrimaryEmailAddress(String primaryEmailAddress) { } /** - * Get the additionalEmailAddresses property: Additional email addresses listed will be copied on any - * correspondence about the support ticket. + * Get the additionalEmailAddresses property: Additional email addresses listed will be copied on any correspondence + * about the support ticket. * * @return the additionalEmailAddresses value. */ @@ -171,8 +165,8 @@ public List additionalEmailAddresses() { } /** - * Set the additionalEmailAddresses property: Additional email addresses listed will be copied on any - * correspondence about the support ticket. + * Set the additionalEmailAddresses property: Additional email addresses listed will be copied on any correspondence + * about the support ticket. * * @param additionalEmailAddresses the additionalEmailAddresses value to set. * @return the ContactProfile object itself. @@ -203,8 +197,8 @@ public ContactProfile withPhoneNumber(String phoneNumber) { } /** - * Get the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft - * Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). + * Get the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft Time + * Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). * * @return the preferredTimeZone value. */ @@ -213,8 +207,8 @@ public String preferredTimeZone() { } /** - * Set the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft - * Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). + * Set the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft Time + * Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). * * @param preferredTimeZone the preferredTimeZone value to set. * @return the ContactProfile object itself. @@ -245,11 +239,11 @@ public ContactProfile withCountry(String country) { } /** - * Get the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary - * based on the severity you choose for your support ticket. Learn more at [Azure Severity and + * Get the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary based + * on the severity you choose for your support ticket. Learn more at [Azure Severity and * responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard language-country code. - * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' - * for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for + * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for + * Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for * Chinese and 'de-de' for German. * * @return the preferredSupportLanguage value. @@ -259,11 +253,11 @@ public String preferredSupportLanguage() { } /** - * Set the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary - * based on the severity you choose for your support ticket. Learn more at [Azure Severity and + * Set the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary based + * on the severity you choose for your support ticket. Learn more at [Azure Severity and * responsiveness](https://azure.microsoft.com/support/plans/response). Use the standard language-country code. - * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' - * for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for + * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for + * Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for * Chinese and 'de-de' for German. * * @param preferredSupportLanguage the preferredSupportLanguage value to set. @@ -281,32 +275,36 @@ public ContactProfile withPreferredSupportLanguage(String preferredSupportLangua */ public void validate() { if (firstName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property firstName in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property firstName in model ContactProfile")); } if (lastName() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property lastName in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property lastName in model ContactProfile")); } if (preferredContactMethod() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property preferredContactMethod in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property preferredContactMethod in model ContactProfile")); } if (primaryEmailAddress() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property primaryEmailAddress in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property primaryEmailAddress in model ContactProfile")); } if (preferredTimeZone() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property preferredTimeZone in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property preferredTimeZone in model ContactProfile")); } if (country() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property country in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property country in model ContactProfile")); } if (preferredSupportLanguage() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property preferredSupportLanguage in model ContactProfile")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property preferredSupportLanguage in model ContactProfile")); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileDetails.java index 075dcaef4152..ecb0f5034aeb 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileDetails.java @@ -50,21 +50,23 @@ public interface FileDetails { OffsetDateTime createdOn(); /** - * Gets the chunkSize property: Size of each chunk. + * Gets the chunkSize property: Size of each chunk. The size of each chunk should be provided in bytes and must not + * exceed 2.5 megabytes (MB). * * @return the chunkSize value. */ Integer chunkSize(); /** - * Gets the fileSize property: Size of the file to be uploaded. + * Gets the fileSize property: Size of the file to be uploaded. The file size must not exceed 5 MB and should be + * provided in bytes. * * @return the fileSize value. */ Integer fileSize(); /** - * Gets the numberOfChunks property: Number of chunks to be uploaded. + * Gets the numberOfChunks property: Number of chunks to be uploaded. The maximum number of allowed chunks is 2. * * @return the numberOfChunks value. */ @@ -134,9 +136,11 @@ interface WithCreate */ interface WithChunkSize { /** - * Specifies the chunkSize property: Size of each chunk. + * Specifies the chunkSize property: Size of each chunk. The size of each chunk should be provided in bytes + * and must not exceed 2.5 megabytes (MB).. * - * @param chunkSize Size of each chunk. + * @param chunkSize Size of each chunk. The size of each chunk should be provided in bytes and must not + * exceed 2.5 megabytes (MB). * @return the next definition stage. */ WithCreate withChunkSize(Integer chunkSize); @@ -147,9 +151,11 @@ interface WithChunkSize { */ interface WithFileSize { /** - * Specifies the fileSize property: Size of the file to be uploaded. + * Specifies the fileSize property: Size of the file to be uploaded. The file size must not exceed 5 MB and + * should be provided in bytes.. * - * @param fileSize Size of the file to be uploaded. + * @param fileSize Size of the file to be uploaded. The file size must not exceed 5 MB and should be + * provided in bytes. * @return the next definition stage. */ WithCreate withFileSize(Integer fileSize); @@ -160,9 +166,10 @@ interface WithFileSize { */ interface WithNumberOfChunks { /** - * Specifies the numberOfChunks property: Number of chunks to be uploaded. + * Specifies the numberOfChunks property: Number of chunks to be uploaded. The maximum number of allowed + * chunks is 2.. * - * @param numberOfChunks Number of chunks to be uploaded. + * @param numberOfChunks Number of chunks to be uploaded. The maximum number of allowed chunks is 2. * @return the next definition stage. */ WithCreate withNumberOfChunks(Integer numberOfChunks); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequest.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequest.java deleted file mode 100644 index b266433ca723..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequest.java +++ /dev/null @@ -1,83 +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.support.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The look up resource Id request body. - */ -@Fluent -public final class LookUpResourceIdRequest { - /* - * The System generated Id that is unique. Use supportTicketId property for Microsoft.Support/supportTickets - * resource type. - */ - @JsonProperty(value = "identifier") - private String identifier; - - /* - * The type of resource. - */ - @JsonProperty(value = "type") - private ResourceType type; - - /** - * Creates an instance of LookUpResourceIdRequest class. - */ - public LookUpResourceIdRequest() { - } - - /** - * Get the identifier property: The System generated Id that is unique. Use supportTicketId property for - * Microsoft.Support/supportTickets resource type. - * - * @return the identifier value. - */ - public String identifier() { - return this.identifier; - } - - /** - * Set the identifier property: The System generated Id that is unique. Use supportTicketId property for - * Microsoft.Support/supportTickets resource type. - * - * @param identifier the identifier value to set. - * @return the LookUpResourceIdRequest object itself. - */ - public LookUpResourceIdRequest withIdentifier(String identifier) { - this.identifier = identifier; - return this; - } - - /** - * Get the type property: The type of resource. - * - * @return the type value. - */ - public ResourceType type() { - return this.type; - } - - /** - * Set the type property: The type of resource. - * - * @param type the type value to set. - * @return the LookUpResourceIdRequest object itself. - */ - public LookUpResourceIdRequest withType(ResourceType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdResponse.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdResponse.java deleted file mode 100644 index e0229e274055..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdResponse.java +++ /dev/null @@ -1,26 +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.support.models; - -import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; - -/** - * An immutable client-side representation of LookUpResourceIdResponse. - */ -public interface LookUpResourceIdResponse { - /** - * Gets the resourceId property: The resource Id of support resource type. - * - * @return the resourceId value. - */ - String resourceId(); - - /** - * Gets the inner com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner object. - * - * @return the inner object. - */ - LookUpResourceIdResponseInner innerModel(); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIds.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIds.java deleted file mode 100644 index eeacdb93c129..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIds.java +++ /dev/null @@ -1,37 +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.support.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of LookUpResourceIds. - */ -public interface LookUpResourceIds { - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response along with {@link Response}. - */ - Response postWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, - Context context); - - /** - * This operation fetches ARM resource id of support resource type. - * - * @param lookUpResourceIdRequest Look up resource id request body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the look up resource id response. - */ - LookUpResourceIdResponse post(LookUpResourceIdRequest lookUpResourceIdRequest); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/MessageProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/MessageProperties.java index ab9d094f84d0..1bdd8e0c3bf6 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/MessageProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/MessageProperties.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -35,7 +34,7 @@ public final class MessageProperties { /* * Body of the communication. */ - @JsonProperty(value = "body", required = true) + @JsonProperty(value = "body") private String body; /* @@ -123,11 +122,5 @@ public OffsetDateTime createdDate() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (body() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property body in model MessageProperties")); - } } - - private static final ClientLogger LOGGER = new ClientLogger(MessageProperties.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassification.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassification.java index 2d1a342d508e..7a7440a6b908 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassification.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassification.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; import java.util.List; -import java.util.Map; /** * An immutable client-side representation of ProblemClassification. @@ -48,21 +47,6 @@ public interface ProblemClassification { */ List secondaryConsentEnabled(); - /** - * Gets the metadata property: String-to-string dictionary for additional metadata. - * - * @return the metadata value. - */ - Map metadata(); - - /** - * Gets the parentProblemClassification property: Reference to the parent problem classification which has same - * structure as problem classification. - * - * @return the parentProblemClassification value. - */ - ProblemClassification parentProblemClassification(); - /** * Gets the inner com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner object. * diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationProperties.java deleted file mode 100644 index bf3a8cbdbeb9..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationProperties.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.support.models; - -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationPropertiesInner; -import java.util.List; -import java.util.Map; - -/** - * An immutable client-side representation of ProblemClassificationProperties. - */ -public interface ProblemClassificationProperties { - /** - * Gets the displayName property: Localized name of problem classification. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the secondaryConsentEnabled property: This property indicates whether secondary consent is present for - * problem classification. - * - * @return the secondaryConsentEnabled value. - */ - List secondaryConsentEnabled(); - - /** - * Gets the metadata property: String-to-string dictionary for additional metadata. - * - * @return the metadata value. - */ - Map metadata(); - - /** - * Gets the parentProblemClassification property: Reference to the parent problem classification which has same - * structure as problem classification. - * - * @return the parentProblemClassification value. - */ - ProblemClassification parentProblemClassification(); - - /** - * Gets the inner com.azure.resourcemanager.support.fluent.models.ProblemClassificationPropertiesInner object. - * - * @return the inner object. - */ - ProblemClassificationPropertiesInner innerModel(); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassifications.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassifications.java index caa1375197ae..960a9159ccc9 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassifications.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassifications.java @@ -12,33 +12,6 @@ * Resource collection API of ProblemClassifications. */ public interface ProblemClassifications { - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response}. - */ - Response classifyProblemsWithResponse(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput, Context context); - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API. - */ - ProblemClassificationsClassificationOutput classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput); - /** * Lists all the problem classifications (categories) available for a specific Azure service. Always use the service * and problem classifications obtained programmatically. This practice ensures that you always have the most recent @@ -69,7 +42,7 @@ ProblemClassificationsClassificationOutput classifyProblems(String problemServic /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -83,7 +56,7 @@ Response getWithResponse(String serviceName, String probl /** * Get problem classification details for a specific Azure service. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure service available for support. * @param problemClassificationName Name of problem classification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationInput.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationInput.java deleted file mode 100644 index b5e616a697f1..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationInput.java +++ /dev/null @@ -1,87 +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.support.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Input to problem classification Classification API. - */ -@Fluent -public final class ProblemClassificationsClassificationInput { - /* - * Natural language description of the customer’s issue. - */ - @JsonProperty(value = "issueSummary", required = true) - private String issueSummary; - - /* - * ARM resource Id of the resource that is having the issue. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /** - * Creates an instance of ProblemClassificationsClassificationInput class. - */ - public ProblemClassificationsClassificationInput() { - } - - /** - * Get the issueSummary property: Natural language description of the customer’s issue. - * - * @return the issueSummary value. - */ - public String issueSummary() { - return this.issueSummary; - } - - /** - * Set the issueSummary property: Natural language description of the customer’s issue. - * - * @param issueSummary the issueSummary value to set. - * @return the ProblemClassificationsClassificationInput object itself. - */ - public ProblemClassificationsClassificationInput withIssueSummary(String issueSummary) { - this.issueSummary = issueSummary; - return this; - } - - /** - * Get the resourceId property: ARM resource Id of the resource that is having the issue. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: ARM resource Id of the resource that is having the issue. - * - * @param resourceId the resourceId value to set. - * @return the ProblemClassificationsClassificationInput object itself. - */ - public ProblemClassificationsClassificationInput withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (issueSummary() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property issueSummary in model ProblemClassificationsClassificationInput")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ProblemClassificationsClassificationInput.class); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationOutput.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationOutput.java deleted file mode 100644 index 6e37ddb34096..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationOutput.java +++ /dev/null @@ -1,28 +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.support.models; - -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import java.util.List; - -/** - * An immutable client-side representation of ProblemClassificationsClassificationOutput. - */ -public interface ProblemClassificationsClassificationOutput { - /** - * Gets the problemClassificationResults property: Set of problem classification objects classified. - * - * @return the problemClassificationResults value. - */ - List problemClassificationResults(); - - /** - * Gets the inner com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner - * object. - * - * @return the inner object. - */ - ProblemClassificationsClassificationOutputInner innerModel(); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationResult.java deleted file mode 100644 index 30166acf99d5..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationResult.java +++ /dev/null @@ -1,164 +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.support.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.support.fluent.models.ClassificationService; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * ProblemClassification Classification result object. - */ -@Fluent -public final class ProblemClassificationsClassificationResult { - /* - * Identifier that may be used for solution discovery or some other purposes. - */ - @JsonProperty(value = "problemId", access = JsonProperty.Access.WRITE_ONLY) - private String problemId; - - /* - * Title of the problem classification result. - */ - @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) - private String title; - - /* - * Description of the problem classification result. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Identifier of the service associated with this problem classification result. - */ - @JsonProperty(value = "serviceId", access = JsonProperty.Access.WRITE_ONLY) - private String serviceId; - - /* - * Identifier that may be used for support ticket creation. - */ - @JsonProperty(value = "problemClassificationId", access = JsonProperty.Access.WRITE_ONLY) - private String problemClassificationId; - - /* - * Related service. - */ - @JsonProperty(value = "relatedService") - private ClassificationService innerRelatedService; - - /** - * Creates an instance of ProblemClassificationsClassificationResult class. - */ - public ProblemClassificationsClassificationResult() { - } - - /** - * Get the problemId property: Identifier that may be used for solution discovery or some other purposes. - * - * @return the problemId value. - */ - public String problemId() { - return this.problemId; - } - - /** - * Get the title property: Title of the problem classification result. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Get the description property: Description of the problem classification result. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the serviceId property: Identifier of the service associated with this problem classification result. - * - * @return the serviceId value. - */ - public String serviceId() { - return this.serviceId; - } - - /** - * Get the problemClassificationId property: Identifier that may be used for support ticket creation. - * - * @return the problemClassificationId value. - */ - public String problemClassificationId() { - return this.problemClassificationId; - } - - /** - * Get the innerRelatedService property: Related service. - * - * @return the innerRelatedService value. - */ - private ClassificationService innerRelatedService() { - return this.innerRelatedService; - } - - /** - * Get the serviceId property: Azure resource Id of the service. - * - * @return the serviceId value. - */ - public String serviceIdRelatedServiceServiceId() { - return this.innerRelatedService() == null ? null : this.innerRelatedService().serviceId(); - } - - /** - * Get the displayName property: Localized name of the azure service. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerRelatedService() == null ? null : this.innerRelatedService().displayName(); - } - - /** - * Get the resourceTypes property: List of applicable ARM resource types for this service. - * - * @return the resourceTypes value. - */ - public List resourceTypes() { - return this.innerRelatedService() == null ? null : this.innerRelatedService().resourceTypes(); - } - - /** - * Set the resourceTypes property: List of applicable ARM resource types for this service. - * - * @param resourceTypes the resourceTypes value to set. - * @return the ProblemClassificationsClassificationResult object itself. - */ - public ProblemClassificationsClassificationResult withResourceTypes(List resourceTypes) { - if (this.innerRelatedService() == null) { - this.innerRelatedService = new ClassificationService(); - } - this.innerRelatedService().withResourceTypes(resourceTypes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerRelatedService() != null) { - innerRelatedService().validate(); - } - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsNoSubscriptions.java deleted file mode 100644 index 13bd5e2b6929..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsNoSubscriptions.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.support.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ProblemClassificationsNoSubscriptions. - */ -public interface ProblemClassificationsNoSubscriptions { - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API along with {@link Response}. - */ - Response classifyProblemsWithResponse(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput, Context context); - - /** - * Classify the right problem classifications (categories) available for a specific Azure service. - * - * @param problemServiceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param problemClassificationsClassificationInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the problem classification Classification API. - */ - ProblemClassificationsClassificationOutput classifyProblems(String problemServiceName, - ProblemClassificationsClassificationInput problemClassificationsClassificationInput); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaTicketDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaTicketDetails.java index 118a5f245831..a63506c41a9c 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaTicketDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaTicketDetails.java @@ -16,8 +16,7 @@ @Fluent public final class QuotaTicketDetails { /* - * Required for certain quota types when there is a sub type, such as Batch, for which you are requesting a quota - * increase. + * Required for certain quota types when there is a sub type, such as Batch, for which you are requesting a quota increase. */ @JsonProperty(value = "quotaChangeRequestSubType") private String quotaChangeRequestSubType; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ResourceType.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ResourceType.java deleted file mode 100644 index 6a0b0d2d5da3..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ResourceType.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.support.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * The type of resource. - */ -public enum ResourceType { - /** - * Enum value Microsoft.Support/supportTickets. - */ - MICROSOFT_SUPPORT_SUPPORT_TICKETS("Microsoft.Support/supportTickets"); - - /** - * The actual serialized value for a ResourceType instance. - */ - private final String value; - - ResourceType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceType fromString(String value) { - if (value == null) { - return null; - } - ResourceType[] items = ResourceType.values(); - for (ResourceType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsent.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsent.java index 04b65495bbde..aefd114b2454 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsent.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsent.java @@ -19,8 +19,7 @@ public final class SecondaryConsent { private UserConsent userConsent; /* - * The service name for which the secondary consent is being provided. The value needs to be retrieved from the - * Problem Classification API response. + * The service name for which the secondary consent is being provided. The value needs to be retrieved from the Problem Classification API response. */ @JsonProperty(value = "type") private String type; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Service.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Service.java index ca2d13311028..0bbe9ffbeedd 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Service.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Service.java @@ -6,7 +6,6 @@ import com.azure.resourcemanager.support.fluent.models.ServiceInner; import java.util.List; -import java.util.Map; /** * An immutable client-side representation of Service. @@ -47,13 +46,6 @@ public interface Service { */ List resourceTypes(); - /** - * Gets the metadata property: Metadata about the service, only visible for 1P clients. - * - * @return the metadata value. - */ - Map metadata(); - /** * Gets the inner com.azure.resourcemanager.support.fluent.models.ServiceInner object. * diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationAnswer.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationAnswer.java deleted file mode 100644 index 6d372948913d..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationAnswer.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.support.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.support.fluent.models.ClassificationService; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Service Classification result object. - */ -@Fluent -public final class ServiceClassificationAnswer extends ClassificationService { - /* - * Child service. - */ - @JsonProperty(value = "childService") - private ClassificationService childService; - - /** - * Creates an instance of ServiceClassificationAnswer class. - */ - public ServiceClassificationAnswer() { - } - - /** - * Get the childService property: Child service. - * - * @return the childService value. - */ - public ClassificationService childService() { - return this.childService; - } - - /** - * Set the childService property: Child service. - * - * @param childService the childService value to set. - * @return the ServiceClassificationAnswer object itself. - */ - public ServiceClassificationAnswer withChildService(ClassificationService childService) { - this.childService = childService; - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ServiceClassificationAnswer withResourceTypes(List resourceTypes) { - super.withResourceTypes(resourceTypes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (childService() != null) { - childService().validate(); - } - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationOutput.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationOutput.java deleted file mode 100644 index defb211ec179..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationOutput.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.support.models; - -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import java.util.List; - -/** - * An immutable client-side representation of ServiceClassificationOutput. - */ -public interface ServiceClassificationOutput { - /** - * Gets the serviceClassificationResults property: Set of problem classification objects classified. - * - * @return the serviceClassificationResults value. - */ - List serviceClassificationResults(); - - /** - * Gets the inner com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner object. - * - * @return the inner object. - */ - ServiceClassificationOutputInner innerModel(); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationRequest.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationRequest.java deleted file mode 100644 index 478ece4c4619..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationRequest.java +++ /dev/null @@ -1,106 +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.support.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Input to problem classification Classification API. - */ -@Fluent -public final class ServiceClassificationRequest { - /* - * Natural language description of the customer’s issue. - */ - @JsonProperty(value = "issueSummary") - private String issueSummary; - - /* - * ARM resource Id of the resource that is having the issue. - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * Additional information in the form of a string. - */ - @JsonProperty(value = "additionalContext") - private String additionalContext; - - /** - * Creates an instance of ServiceClassificationRequest class. - */ - public ServiceClassificationRequest() { - } - - /** - * Get the issueSummary property: Natural language description of the customer’s issue. - * - * @return the issueSummary value. - */ - public String issueSummary() { - return this.issueSummary; - } - - /** - * Set the issueSummary property: Natural language description of the customer’s issue. - * - * @param issueSummary the issueSummary value to set. - * @return the ServiceClassificationRequest object itself. - */ - public ServiceClassificationRequest withIssueSummary(String issueSummary) { - this.issueSummary = issueSummary; - return this; - } - - /** - * Get the resourceId property: ARM resource Id of the resource that is having the issue. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: ARM resource Id of the resource that is having the issue. - * - * @param resourceId the resourceId value to set. - * @return the ServiceClassificationRequest object itself. - */ - public ServiceClassificationRequest withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the additionalContext property: Additional information in the form of a string. - * - * @return the additionalContext value. - */ - public String additionalContext() { - return this.additionalContext; - } - - /** - * Set the additionalContext property: Additional information in the form of a string. - * - * @param additionalContext the additionalContext value to set. - * @return the ServiceClassificationRequest object itself. - */ - public ServiceClassificationRequest withAdditionalContext(String additionalContext) { - this.additionalContext = additionalContext; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassifications.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassifications.java deleted file mode 100644 index fc2b8c5fd0d4..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassifications.java +++ /dev/null @@ -1,37 +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.support.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ServiceClassifications. - */ -public interface ServiceClassifications { - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response}. - */ - Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context); - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API. - */ - ServiceClassificationOutput classifyServices(ServiceClassificationRequest serviceClassificationRequest); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationsNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationsNoSubscriptions.java deleted file mode 100644 index 448bed22db2e..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationsNoSubscriptions.java +++ /dev/null @@ -1,37 +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.support.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** - * Resource collection API of ServiceClassificationsNoSubscriptions. - */ -public interface ServiceClassificationsNoSubscriptions { - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API along with {@link Response}. - */ - Response - classifyServicesWithResponse(ServiceClassificationRequest serviceClassificationRequest, Context context); - - /** - * Classify the list of right Azure services. - * - * @param serviceClassificationRequest Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of the service classification API. - */ - ServiceClassificationOutput classifyServices(ServiceClassificationRequest serviceClassificationRequest); -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Services.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Services.java index a226576c8253..efb6616dc3b5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Services.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Services.java @@ -45,7 +45,7 @@ public interface Services { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. @@ -57,7 +57,7 @@ public interface Services { /** * Gets a specific Azure service for support ticket creation. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. + * @param serviceName Name of the Azure 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. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketDetails.java index 5cb44ce97970..a6a51f34692f 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketDetails.java @@ -239,7 +239,10 @@ public interface SupportTicketDetails { /** * The entirety of the SupportTicketDetails definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDescription, + DefinitionStages.WithProblemClassificationId, DefinitionStages.WithSeverity, + DefinitionStages.WithAdvancedDiagnosticConsent, DefinitionStages.WithContactDetails, DefinitionStages.WithTitle, + DefinitionStages.WithServiceId, DefinitionStages.WithCreate { } /** @@ -249,49 +252,7 @@ interface DefinitionStages { /** * The first stage of the SupportTicketDetails definition. */ - interface Blank extends WithCreate { - } - - /** - * The stage of the SupportTicketDetails 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.WithSupportTicketId, DefinitionStages.WithDescription, - DefinitionStages.WithProblemClassificationId, DefinitionStages.WithSeverity, - DefinitionStages.WithEnrollmentId, DefinitionStages.WithRequire24X7Response, - DefinitionStages.WithAdvancedDiagnosticConsent, DefinitionStages.WithProblemScopingQuestions, - DefinitionStages.WithSupportPlanId, DefinitionStages.WithContactDetails, - DefinitionStages.WithServiceLevelAgreement, DefinitionStages.WithSupportEngineer, - DefinitionStages.WithTitle, DefinitionStages.WithProblemStartTime, DefinitionStages.WithServiceId, - DefinitionStages.WithFileWorkspaceName, DefinitionStages.WithTechnicalTicketDetails, - DefinitionStages.WithQuotaTicketDetails, DefinitionStages.WithSecondaryConsent { - /** - * Executes the create request. - * - * @return the created resource. - */ - SupportTicketDetails create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SupportTicketDetails create(Context context); - } - - /** - * The stage of the SupportTicketDetails definition allowing to specify supportTicketId. - */ - interface WithSupportTicketId { - /** - * Specifies the supportTicketId property: System generated support ticket Id that is unique.. - * - * @param supportTicketId System generated support ticket Id that is unique. - * @return the next definition stage. - */ - WithCreate withSupportTicketId(String supportTicketId); + interface Blank extends WithDescription { } /** @@ -304,7 +265,7 @@ interface WithDescription { * @param description Detailed description of the question or issue. * @return the next definition stage. */ - WithCreate withDescription(String description); + WithProblemClassificationId withDescription(String description); } /** @@ -320,7 +281,7 @@ interface WithProblemClassificationId { * problem classification. This parameter is the unique Id for the type of problem you are experiencing. * @return the next definition stage. */ - WithCreate withProblemClassificationId(String problemClassificationId); + WithSeverity withProblemClassificationId(String problemClassificationId); } /** @@ -339,7 +300,102 @@ interface WithSeverity { * reserved only for our Premium customers. * @return the next definition stage. */ - WithCreate withSeverity(SeverityLevel severity); + WithAdvancedDiagnosticConsent withSeverity(SeverityLevel severity); + } + + /** + * The stage of the SupportTicketDetails definition allowing to specify advancedDiagnosticConsent. + */ + interface WithAdvancedDiagnosticConsent { + /** + * Specifies the advancedDiagnosticConsent property: Advanced diagnostic consent to be updated on the + * support ticket.. + * + * @param advancedDiagnosticConsent Advanced diagnostic consent to be updated on the support ticket. + * @return the next definition stage. + */ + WithContactDetails withAdvancedDiagnosticConsent(Consent advancedDiagnosticConsent); + } + + /** + * The stage of the SupportTicketDetails definition allowing to specify contactDetails. + */ + interface WithContactDetails { + /** + * Specifies the contactDetails property: Contact information of the user requesting to create a support + * ticket.. + * + * @param contactDetails Contact information of the user requesting to create a support ticket. + * @return the next definition stage. + */ + WithTitle withContactDetails(ContactProfile contactDetails); + } + + /** + * The stage of the SupportTicketDetails definition allowing to specify title. + */ + interface WithTitle { + /** + * Specifies the title property: Title of the support ticket.. + * + * @param title Title of the support ticket. + * @return the next definition stage. + */ + WithServiceId withTitle(String title); + } + + /** + * The stage of the SupportTicketDetails definition allowing to specify serviceId. + */ + interface WithServiceId { + /** + * Specifies the serviceId property: This is the resource Id of the Azure service resource associated with + * the support ticket.. + * + * @param serviceId This is the resource Id of the Azure service resource associated with the support + * ticket. + * @return the next definition stage. + */ + WithCreate withServiceId(String serviceId); + } + + /** + * The stage of the SupportTicketDetails 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.WithSupportTicketId, DefinitionStages.WithEnrollmentId, + DefinitionStages.WithRequire24X7Response, DefinitionStages.WithProblemScopingQuestions, + DefinitionStages.WithSupportPlanId, DefinitionStages.WithServiceLevelAgreement, + DefinitionStages.WithSupportEngineer, DefinitionStages.WithProblemStartTime, + DefinitionStages.WithFileWorkspaceName, DefinitionStages.WithTechnicalTicketDetails, + DefinitionStages.WithQuotaTicketDetails, DefinitionStages.WithSecondaryConsent { + /** + * Executes the create request. + * + * @return the created resource. + */ + SupportTicketDetails create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SupportTicketDetails create(Context context); + } + + /** + * The stage of the SupportTicketDetails definition allowing to specify supportTicketId. + */ + interface WithSupportTicketId { + /** + * Specifies the supportTicketId property: System generated support ticket Id that is unique.. + * + * @param supportTicketId System generated support ticket Id that is unique. + * @return the next definition stage. + */ + WithCreate withSupportTicketId(String supportTicketId); } /** @@ -368,20 +424,6 @@ interface WithRequire24X7Response { WithCreate withRequire24X7Response(Boolean require24X7Response); } - /** - * The stage of the SupportTicketDetails definition allowing to specify advancedDiagnosticConsent. - */ - interface WithAdvancedDiagnosticConsent { - /** - * Specifies the advancedDiagnosticConsent property: Advanced diagnostic consent to be updated on the - * support ticket.. - * - * @param advancedDiagnosticConsent Advanced diagnostic consent to be updated on the support ticket. - * @return the next definition stage. - */ - WithCreate withAdvancedDiagnosticConsent(Consent advancedDiagnosticConsent); - } - /** * The stage of the SupportTicketDetails definition allowing to specify problemScopingQuestions. */ @@ -409,20 +451,6 @@ interface WithSupportPlanId { WithCreate withSupportPlanId(String supportPlanId); } - /** - * The stage of the SupportTicketDetails definition allowing to specify contactDetails. - */ - interface WithContactDetails { - /** - * Specifies the contactDetails property: Contact information of the user requesting to create a support - * ticket.. - * - * @param contactDetails Contact information of the user requesting to create a support ticket. - * @return the next definition stage. - */ - WithCreate withContactDetails(ContactProfile contactDetails); - } - /** * The stage of the SupportTicketDetails definition allowing to specify serviceLevelAgreement. */ @@ -451,19 +479,6 @@ interface WithSupportEngineer { WithCreate withSupportEngineer(SupportEngineer supportEngineer); } - /** - * The stage of the SupportTicketDetails definition allowing to specify title. - */ - interface WithTitle { - /** - * Specifies the title property: Title of the support ticket.. - * - * @param title Title of the support ticket. - * @return the next definition stage. - */ - WithCreate withTitle(String title); - } - /** * The stage of the SupportTicketDetails definition allowing to specify problemStartTime. */ @@ -477,21 +492,6 @@ interface WithProblemStartTime { WithCreate withProblemStartTime(OffsetDateTime problemStartTime); } - /** - * The stage of the SupportTicketDetails definition allowing to specify serviceId. - */ - interface WithServiceId { - /** - * Specifies the serviceId property: This is the resource Id of the Azure service resource associated with - * the support ticket.. - * - * @param serviceId This is the resource Id of the Azure service resource associated with the support - * ticket. - * @return the next definition stage. - */ - WithCreate withServiceId(String serviceId); - } - /** * The stage of the SupportTicketDetails definition allowing to specify fileWorkspaceName. */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TechnicalTicketDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TechnicalTicketDetails.java index 79b540671ab7..d4fb2be97c5d 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TechnicalTicketDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TechnicalTicketDetails.java @@ -13,8 +13,7 @@ @Fluent public final class TechnicalTicketDetails { /* - * This is the resource Id of the Azure service resource (For example: A virtual machine resource or an HDInsight - * resource) for which the support ticket is created. + * This is the resource Id of the Azure service resource (For example: A virtual machine resource or an HDInsight resource) for which the support ticket is created. */ @JsonProperty(value = "resourceId") private String resourceId; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateContactProfile.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateContactProfile.java index b40b08c0be3b..8f307cad3929 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateContactProfile.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateContactProfile.java @@ -50,8 +50,7 @@ public final class UpdateContactProfile { private String phoneNumber; /* - * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index - * Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). + * Time zone of the user. This is the name of the time zone from [Microsoft Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). */ @JsonProperty(value = "preferredTimeZone") private String preferredTimeZone; @@ -63,12 +62,7 @@ public final class UpdateContactProfile { private String country; /* - * Preferred language of support from Azure. Support languages vary based on the severity you choose for your - * support ticket. Learn more at [Azure Severity and - * responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard language-country code. - * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' - * for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for - * Chinese and 'de-de' for German. + * Preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at [Azure Severity and responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. */ @JsonProperty(value = "preferredSupportLanguage") private String preferredSupportLanguage; @@ -202,8 +196,8 @@ public UpdateContactProfile withPhoneNumber(String phoneNumber) { } /** - * Get the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft - * Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). + * Get the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft Time + * Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). * * @return the preferredTimeZone value. */ @@ -212,8 +206,8 @@ public String preferredTimeZone() { } /** - * Set the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft - * Time Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). + * Set the preferredTimeZone property: Time zone of the user. This is the name of the time zone from [Microsoft Time + * Zone Index Values](https://support.microsoft.com/help/973627/microsoft-time-zone-index-values). * * @param preferredTimeZone the preferredTimeZone value to set. * @return the UpdateContactProfile object itself. @@ -244,11 +238,11 @@ public UpdateContactProfile withCountry(String country) { } /** - * Get the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary - * based on the severity you choose for your support ticket. Learn more at [Azure Severity and + * Get the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary based + * on the severity you choose for your support ticket. Learn more at [Azure Severity and * responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard language-country code. - * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' - * for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for + * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for + * Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for * Chinese and 'de-de' for German. * * @return the preferredSupportLanguage value. @@ -258,11 +252,11 @@ public String preferredSupportLanguage() { } /** - * Set the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary - * based on the severity you choose for your support ticket. Learn more at [Azure Severity and + * Set the preferredSupportLanguage property: Preferred language of support from Azure. Support languages vary based + * on the severity you choose for your support ticket. Learn more at [Azure Severity and * responsiveness](https://azure.microsoft.com/support/plans/response/). Use the standard language-country code. - * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' - * for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for + * Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for + * Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for * Chinese and 'de-de' for German. * * @param preferredSupportLanguage the preferredSupportLanguage value to set. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateSupportTicket.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateSupportTicket.java index 8a77ab0c246c..00a703fef9bc 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateSupportTicket.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UpdateSupportTicket.java @@ -9,7 +9,8 @@ import java.util.List; /** - * Updates severity, ticket status, and contact details in the support ticket. + * Updates severity, ticket status, contact details, advanced diagnostic consent and secondary consent in the support + * ticket. */ @Fluent public final class UpdateSupportTicket { diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/module-info.java b/sdk/support/azure-resourcemanager-support/src/main/java/module-info.java index 9dfaab15d55b..de2b3678dccc 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/module-info.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/module-info.java @@ -10,4 +10,4 @@ exports com.azure.resourcemanager.support.models; opens com.azure.resourcemanager.support.fluent.models to com.azure.core, com.fasterxml.jackson.databind; opens com.azure.resourcemanager.support.models to com.azure.core, com.fasterxml.jackson.databind; -} +} \ No newline at end of file diff --git a/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/proxy-config.json b/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/proxy-config.json index 3c50f48ef406..df749671510e 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/proxy-config.json +++ b/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.support.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.support.implementation.ServicesClientImpl$ServicesService" ], [ "com.azure.resourcemanager.support.implementation.ServiceClassificationsNoSubscriptionsClientImpl$ServiceClassificationsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.ServiceClassificationsClientImpl$ServiceClassificationsService" ], [ "com.azure.resourcemanager.support.implementation.ProblemClassificationsNoSubscriptionsClientImpl$ProblemClassificationsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.ProblemClassificationsClientImpl$ProblemClassificationsService" ], [ "com.azure.resourcemanager.support.implementation.SupportTicketsClientImpl$SupportTicketsService" ], [ "com.azure.resourcemanager.support.implementation.SupportTicketsNoSubscriptionsClientImpl$SupportTicketsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.CommunicationsClientImpl$CommunicationsService" ], [ "com.azure.resourcemanager.support.implementation.CommunicationsNoSubscriptionsClientImpl$CommunicationsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.ChatTranscriptsClientImpl$ChatTranscriptsService" ], [ "com.azure.resourcemanager.support.implementation.ChatTranscriptsNoSubscriptionsClientImpl$ChatTranscriptsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.FileWorkspacesClientImpl$FileWorkspacesService" ], [ "com.azure.resourcemanager.support.implementation.FileWorkspacesNoSubscriptionsClientImpl$FileWorkspacesNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.FilesClientImpl$FilesService" ], [ "com.azure.resourcemanager.support.implementation.FilesNoSubscriptionsClientImpl$FilesNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.LookUpResourceIdsClientImpl$LookUpResourceIdsService" ] ] \ No newline at end of file +[ [ "com.azure.resourcemanager.support.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.support.implementation.ServicesClientImpl$ServicesService" ], [ "com.azure.resourcemanager.support.implementation.ProblemClassificationsClientImpl$ProblemClassificationsService" ], [ "com.azure.resourcemanager.support.implementation.SupportTicketsClientImpl$SupportTicketsService" ], [ "com.azure.resourcemanager.support.implementation.SupportTicketsNoSubscriptionsClientImpl$SupportTicketsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.CommunicationsClientImpl$CommunicationsService" ], [ "com.azure.resourcemanager.support.implementation.CommunicationsNoSubscriptionsClientImpl$CommunicationsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.ChatTranscriptsClientImpl$ChatTranscriptsService" ], [ "com.azure.resourcemanager.support.implementation.ChatTranscriptsNoSubscriptionsClientImpl$ChatTranscriptsNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.FileWorkspacesClientImpl$FileWorkspacesService" ], [ "com.azure.resourcemanager.support.implementation.FileWorkspacesNoSubscriptionsClientImpl$FileWorkspacesNoSubscriptionsService" ], [ "com.azure.resourcemanager.support.implementation.FilesClientImpl$FilesService" ], [ "com.azure.resourcemanager.support.implementation.FilesNoSubscriptionsClientImpl$FilesNoSubscriptionsService" ] ] \ No newline at end of file diff --git a/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/reflect-config.json b/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/reflect-config.json index 6f4e2dc9d4a5..1952d22bc154 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/reflect-config.json +++ b/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-support/reflect-config.json @@ -28,41 +28,6 @@ "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.models.ServiceClassificationRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.models.ServiceClassificationAnswer", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.fluent.models.ClassificationService", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true }, { "name" : "com.azure.resourcemanager.support.models.ProblemClassificationsListResult", "allDeclaredConstructors" : true, @@ -74,7 +39,7 @@ "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.support.fluent.models.ProblemClassificationPropertiesInner", + "name" : "com.azure.resourcemanager.support.fluent.models.ProblemClassificationProperties", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true @@ -218,16 +183,6 @@ "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.models.LookUpResourceIdRequest", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true }, { "name" : "com.azure.resourcemanager.support.models.SeverityLevel", "allDeclaredConstructors" : true, @@ -278,9 +233,4 @@ "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.support.models.ResourceType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true } ] \ No newline at end of file diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetSamples.java index c3fe213cd802..2bd605ffca21 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetSamples.java @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetchatTranscriptDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. @@ -19,7 +18,7 @@ public final class ChatTranscriptsGetSamples { */ public static void getChatTranscriptDetailsForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.chatTranscripts().getWithResponse("testticket", "69586795-45e9-45b5-bd9e-c9bb237d3e44", - com.azure.core.util.Context.NONE); + manager.chatTranscripts() + .getWithResponse("testticket", "69586795-45e9-45b5-bd9e-c9bb237d3e44", com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListSamples.java index 0acb94c4c4b7..65532a036d30 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListSamples.java @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListChatTranscriptsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSubscriptionSupportTicket.json */ /** * Sample code: List chat transcripts for a subscription support ticket. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionGetSamples.java index 028162909992..ef69b954d077 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionGetSamples.java @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetchatTranscriptDetailsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetchatTranscriptDetailsForSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. @@ -19,7 +18,7 @@ public final class ChatTranscriptsNoSubscriptionGetSamples { */ public static void getChatTranscriptDetailsForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.chatTranscriptsNoSubscriptions().getWithResponse("testticket", "b371192a-b094-4a71-b093-7246029b0a54", - com.azure.core.util.Context.NONE); + manager.chatTranscriptsNoSubscriptions() + .getWithResponse("testticket", "b371192a-b094-4a71-b093-7246029b0a54", com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionListSamples.java index 98849dcf35f4..4d715469dc16 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionListSamples.java @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListChatTranscriptsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListChatTranscriptsForSupportTicket.json */ /** * Sample code: List chat transcripts for a no-subscription support ticket. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilitySamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilitySamples.java index 93946f1ae373..d2206faf96e0 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilitySamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilitySamples.java @@ -12,18 +12,18 @@ */ public final class CommunicationsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailabilityForSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json */ /** - * Sample code: Checks whether name is available for subscription scoped Communication resource. + * Sample code: Checks whether name is available for Communication resource for a subscription support ticket. * * @param manager Entry point to SupportManager. */ - public static void checksWhetherNameIsAvailableForSubscriptionScopedCommunicationResource( + public static void checksWhetherNameIsAvailableForCommunicationResourceForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().checkNameAvailabilityWithResponse("testticket", - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), - com.azure.core.util.Context.NONE); + manager.communications() + .checkNameAvailabilityWithResponse("testticket", + new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java index 9931d58c465d..6c4a36226a4c 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java @@ -9,8 +9,7 @@ */ public final class CommunicationsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToSubscriptionTicket. @@ -18,8 +17,12 @@ public final class CommunicationsCreateSamples { * @param manager Entry point to SupportManager. */ public static void addCommunicationToSubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().define("testcommunication").withExistingSupportTicket("testticket") - .withSender("user@contoso.com").withSubject("This is a test message from a customer!") - .withBody("This is a test message from a customer!").create(); + manager.communications() + .define("testcommunication") + .withExistingSupportTicket("testticket") + .withSubject("This is a test message from a customer!") + .withBody("This is a test message from a customer!") + .withSender("user@contoso.com") + .create(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsGetSamples.java index c9d971b8a786..a456d4fb47a0 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsGetSamples.java @@ -9,8 +9,7 @@ */ public final class CommunicationsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetCommunicationDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get communication details for a subscription support ticket. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsListSamples.java index 5e3a72e38a0b..3ddbba853e42 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsListSamples.java @@ -9,8 +9,7 @@ */ public final class CommunicationsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List communications for a subscription support ticket. @@ -23,8 +22,7 @@ public final class CommunicationsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List web communications for a subscription support ticket. @@ -33,13 +31,12 @@ public final class CommunicationsListSamples { */ public static void listWebCommunicationsForASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().list("testticket", null, "communicationType eq 'web'", - com.azure.core.util.Context.NONE); + manager.communications() + .list("testticket", null, "communicationType eq 'web'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a subscription support ticket. @@ -48,7 +45,8 @@ public final class CommunicationsListSamples { */ public static void listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communications().list("testticket", null, - "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", com.azure.core.util.Context.NONE); + manager.communications() + .list("testticket", null, "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCheckNameAvailabilitySamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCheckNameAvailabilitySamples.java index f73785ee0585..04d9e471661a 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCheckNameAvailabilitySamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCheckNameAvailabilitySamples.java @@ -12,8 +12,7 @@ */ public final class CommunicationsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: Checks whether name is available for Communication resource. @@ -22,8 +21,9 @@ public final class CommunicationsNoSubscriptionCheckNameAvailabilitySamples { */ public static void checksWhetherNameIsAvailableForCommunicationResource(com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().checkNameAvailabilityWithResponse("testticket", - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .checkNameAvailabilityWithResponse("testticket", + new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCreateSamples.java index c889dda0fe29..cdeff17a7fed 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionCreateSamples.java @@ -11,8 +11,7 @@ */ public final class CommunicationsNoSubscriptionCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToNoSubscriptionTicket. @@ -21,10 +20,11 @@ public final class CommunicationsNoSubscriptionCreateSamples { */ public static void addCommunicationToNoSubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().create("testticket", "testcommunication", - new CommunicationDetailsInner().withSender("user@contoso.com") - .withSubject("This is a test message from a customer!") - .withBody("This is a test message from a customer!"), - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .create("testticket", "testcommunication", + new CommunicationDetailsInner().withSender("user@contoso.com") + .withSubject("This is a test message from a customer!") + .withBody("This is a test message from a customer!"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionGetSamples.java index 207e66d1bb7b..74ebdd5fc0b8 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionGetSamples.java @@ -9,8 +9,7 @@ */ public final class CommunicationsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetCommunicationDetailsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetCommunicationDetailsForSupportTicket.json */ /** * Sample code: Get communication details for a no-subscription support ticket. @@ -19,7 +18,7 @@ public final class CommunicationsNoSubscriptionGetSamples { */ public static void getCommunicationDetailsForANoSubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().getWithResponse("testticket", "testmessage", - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .getWithResponse("testticket", "testmessage", com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionListSamples.java index 6d894710d54d..4f0f89438e73 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionListSamples.java @@ -9,8 +9,7 @@ */ public final class CommunicationsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListCommunicationsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListCommunicationsForSupportTicket.json */ /** * Sample code: List communications for a no-subscription support ticket. @@ -23,8 +22,7 @@ public final class CommunicationsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a no-subscription support ticket. @@ -33,13 +31,13 @@ public final class CommunicationsNoSubscriptionListSamples { */ public static void listWebCommunicationCreatedOnOrAfterASpecificDateForANoSubscriptionSupportTicket( com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().list("testticket", null, - "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .list("testticket", null, "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListWebCommunicationsForSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListWebCommunicationsForSupportTicket.json */ /** * Sample code: List web communications for a no-subscription support ticket. @@ -48,7 +46,7 @@ public static void listWebCommunicationCreatedOnOrAfterASpecificDateForANoSubscr */ public static void listWebCommunicationsForANoSubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.communicationsNoSubscriptions().list("testticket", null, "communicationType eq 'web'", - com.azure.core.util.Context.NONE); + manager.communicationsNoSubscriptions() + .list("testticket", null, "communicationType eq 'web'", com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateSamples.java index dccac23422e9..793df4a4b75d 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateSamples.java @@ -9,16 +9,14 @@ */ public final class FileWorkspacesCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateFileWorkspaceForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspaceForSubscription.json */ /** - * Sample code: Create a subscription scoped file workspace. + * Sample code: Create a file workspace for a subscription. * * @param manager Entry point to SupportManager. */ - public static void - createASubscriptionScopedFileWorkspace(com.azure.resourcemanager.support.SupportManager manager) { + public static void createAFileWorkspaceForASubscription(com.azure.resourcemanager.support.SupportManager manager) { manager.fileWorkspaces().createWithResponse("testworkspace", com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetSamples.java index d0f34ce4089b..a7b714644a63 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetSamples.java @@ -9,8 +9,7 @@ */ public final class FileWorkspacesGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetFileWorkspaceDetailsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetailsForSubscription.json */ /** * Sample code: Get details of a subscription file workspace. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionCreateSamples.java index a3ba795d2fe5..a9bd828af9a7 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionCreateSamples.java @@ -9,9 +9,7 @@ */ public final class FileWorkspacesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFileWorkspace. - * json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspace.json */ /** * Sample code: Create a file workspace. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionGetSamples.java index 42b567b450f2..bc7b90418d0d 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionGetSamples.java @@ -9,8 +9,7 @@ */ public final class FileWorkspacesNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetFileWorkspaceDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetails.json */ /** * Sample code: Get details of a file workspace. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesCreateSamples.java index 50e2aee4aad5..a810a2be2a95 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesCreateSamples.java @@ -9,16 +9,21 @@ */ public final class FilesCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateFileForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileForSubscription.json */ /** - * Sample code: Create a subscription scoped file. + * Sample code: Create a file under a subscription workspace. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedFile(com.azure.resourcemanager.support.SupportManager manager) { - manager.files().define("test.txt").withExistingFileWorkspace("testworkspace").withChunkSize(41423) - .withFileSize(41423).withNumberOfChunks(1).create(); + public static void + createAFileUnderASubscriptionWorkspace(com.azure.resourcemanager.support.SupportManager manager) { + manager.files() + .define("test.txt") + .withExistingFileWorkspace("testworkspace") + .withChunkSize(41423) + .withFileSize(41423) + .withNumberOfChunks(1) + .create(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesGetSamples.java index 5fc989453713..731f96366810 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesGetSamples.java @@ -9,8 +9,7 @@ */ public final class FilesGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetFileDetailsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetailsForSubscription.json */ /** * Sample code: Get details of a subscription file. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesListSamples.java index 2f0eeb6eb413..12125c757474 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesListSamples.java @@ -9,8 +9,7 @@ */ public final class FilesListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListFilesForSubscriptionUnderFileWorkspace.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesForSubscriptionUnderFileWorkspace.json */ /** * Sample code: List files under a workspace for a subscription. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionCreateSamples.java index 72eb4a5d1927..f7b9d45f310b 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionCreateSamples.java @@ -11,8 +11,7 @@ */ public final class FilesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/CreateFile.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFile.json */ /** * Sample code: Create a file workspace. @@ -20,8 +19,9 @@ public final class FilesNoSubscriptionCreateSamples { * @param manager Entry point to SupportManager. */ public static void createAFileWorkspace(com.azure.resourcemanager.support.SupportManager manager) { - manager.filesNoSubscriptions().createWithResponse("testworkspace", "test.txt", - new FileDetailsInner().withChunkSize(41423).withFileSize(41423).withNumberOfChunks(1), - com.azure.core.util.Context.NONE); + manager.filesNoSubscriptions() + .createWithResponse("testworkspace", "test.txt", + new FileDetailsInner().withChunkSize(41423).withFileSize(41423).withNumberOfChunks(1), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionGetSamples.java index d4058f45cffb..3f35525f8468 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionGetSamples.java @@ -9,8 +9,7 @@ */ public final class FilesNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetFileDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetails.json */ /** * Sample code: Get details of a subscription file. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionListSamples.java index 4972fb8927af..715b84c8419b 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionListSamples.java @@ -9,8 +9,7 @@ */ public final class FilesNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListFilesUnderFileWorkspace.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesUnderFileWorkspace.json */ /** * Sample code: List files under a workspace. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionUploadSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionUploadSamples.java index ccd0c3a18d00..13d6c28be55b 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionUploadSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionUploadSamples.java @@ -11,8 +11,7 @@ */ public final class FilesNoSubscriptionUploadSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/UploadFile.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFile.json */ /** * Sample code: UploadFile. @@ -20,8 +19,9 @@ public final class FilesNoSubscriptionUploadSamples { * @param manager Entry point to SupportManager. */ public static void uploadFile(com.azure.resourcemanager.support.SupportManager manager) { - manager.filesNoSubscriptions().uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( - "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") - .withChunkIndex(0), com.azure.core.util.Context.NONE); + manager.filesNoSubscriptions() + .uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( + "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") + .withChunkIndex(0), com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesUploadSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesUploadSamples.java index 8178945d779f..267a9ad5bc09 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesUploadSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/FilesUploadSamples.java @@ -11,8 +11,7 @@ */ public final class FilesUploadSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UploadFileForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFileForSubscription.json */ /** * Sample code: UploadFileForSubscription. @@ -20,8 +19,9 @@ public final class FilesUploadSamples { * @param manager Entry point to SupportManager. */ public static void uploadFileForSubscription(com.azure.resourcemanager.support.SupportManager manager) { - manager.files().uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( - "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") - .withChunkIndex(0), com.azure.core.util.Context.NONE); + manager.files() + .uploadWithResponse("testworkspaceName", "test.txt", new UploadFile().withContent( + "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABd") + .withChunkIndex(0), com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/LookUpResourceIdPostSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/LookUpResourceIdPostSamples.java deleted file mode 100644 index 3abac2cc1d2a..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/LookUpResourceIdPostSamples.java +++ /dev/null @@ -1,28 +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.support.generated; - -import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; -import com.azure.resourcemanager.support.models.ResourceType; - -/** - * Samples for LookUpResourceId Post. - */ -public final class LookUpResourceIdPostSamples { - /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/LookUpResourceId. - * json - */ - /** - * Sample code: Look up resource id of support resource type. - * - * @param manager Entry point to SupportManager. - */ - public static void lookUpResourceIdOfSupportResourceType(com.azure.resourcemanager.support.SupportManager manager) { - manager.lookUpResourceIds().postWithResponse(new LookUpResourceIdRequest().withIdentifier("1234668596") - .withType(ResourceType.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java index d97033865a40..c34b796afd17 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListOperations.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListOperations.json */ /** * Sample code: Get all operations. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassifyProblemsSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassifyProblemsSamples.java deleted file mode 100644 index d0fcbd6d4735..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassifyProblemsSamples.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.support.generated; - -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; - -/** - * Samples for ProblemClassifications ClassifyProblems. - */ -public final class ProblemClassificationsClassifyProblemsSamples { - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ClassifyProblemClassificationsForSubscription.json - */ - /** - * Sample code: Classify list of problemClassifications for a specified Azure service for a subscription. - * - * @param manager Entry point to SupportManager. - */ - public static void classifyListOfProblemClassificationsForASpecifiedAzureServiceForASubscription( - com.azure.resourcemanager.support.SupportManager manager) { - manager.problemClassifications().classifyProblemsWithResponse("serviceId1", - new ProblemClassificationsClassificationInput().withIssueSummary("Can not connect to Windows VM") - .withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java index 23b1bacf5952..2a30cb55c9a4 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java @@ -9,8 +9,7 @@ */ public final class ProblemClassificationsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetProblemClassification.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetProblemClassification.json */ /** * Sample code: Gets details of problemClassification for Azure service. @@ -19,7 +18,7 @@ public final class ProblemClassificationsGetSamples { */ public static void getsDetailsOfProblemClassificationForAzureService(com.azure.resourcemanager.support.SupportManager manager) { - manager.problemClassifications().getWithResponse("service_guid", "problemClassification_guid", - com.azure.core.util.Context.NONE); + manager.problemClassifications() + .getWithResponse("service_guid", "problemClassification_guid", com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java index 4ca782b955c9..207cb11b577e 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java @@ -9,8 +9,7 @@ */ public final class ProblemClassificationsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListProblemClassifications.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListProblemClassifications.json */ /** * Sample code: Gets list of problemClassifications for a service for which a support ticket can be created. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsNoSubscriptionClassifyProblemsSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsNoSubscriptionClassifyProblemsSamples.java deleted file mode 100644 index 1c959e99964a..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsNoSubscriptionClassifyProblemsSamples.java +++ /dev/null @@ -1,28 +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.support.generated; - -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; - -/** - * Samples for ProblemClassificationsNoSubscription ClassifyProblems. - */ -public final class ProblemClassificationsNoSubscriptionClassifyProblemsSamples { - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ClassifyProblemClassifications.json - */ - /** - * Sample code: Classify list of problemClassifications for a specified Azure service. - * - * @param manager Entry point to SupportManager. - */ - public static void classifyListOfProblemClassificationsForASpecifiedAzureService( - com.azure.resourcemanager.support.SupportManager manager) { - manager.problemClassificationsNoSubscriptions().classifyProblemsWithResponse("serviceId1", - new ProblemClassificationsClassificationInput().withIssueSummary("Can not connect to Windows VM"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServiceClassificationsClassifyServicesSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServiceClassificationsClassifyServicesSamples.java deleted file mode 100644 index a512e566535b..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServiceClassificationsClassifyServicesSamples.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.support.generated; - -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; - -/** - * Samples for ServiceClassifications ClassifyServices. - */ -public final class ServiceClassificationsClassifyServicesSamples { - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ClassifyServicesForSubscription.json - */ - /** - * Sample code: Classify list of Azure services for a subscription. - * - * @param manager Entry point to SupportManager. - */ - public static void - classifyListOfAzureServicesForASubscription(com.azure.resourcemanager.support.SupportManager manager) { - manager.serviceClassifications().classifyServicesWithResponse( - new ServiceClassificationRequest().withIssueSummary("Can not connect to Windows VM").withResourceId( - "/subscriptions/76cb77fa-8b17-4eab-9493-b65dace99813/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServiceClassificationsNoSubscriptionClassifyServicesSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServiceClassificationsNoSubscriptionClassifyServicesSamples.java deleted file mode 100644 index ca2e52bd5bd4..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServiceClassificationsNoSubscriptionClassifyServicesSamples.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.support.generated; - -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; - -/** - * Samples for ServiceClassificationsNoSubscription ClassifyServices. - */ -public final class ServiceClassificationsNoSubscriptionClassifyServicesSamples { - /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ClassifyServices. - * json - */ - /** - * Sample code: Classify list of Azure services. - * - * @param manager Entry point to SupportManager. - */ - public static void classifyListOfAzureServices(com.azure.resourcemanager.support.SupportManager manager) { - manager.serviceClassificationsNoSubscriptions().classifyServicesWithResponse( - new ServiceClassificationRequest().withIssueSummary("Can not connect to Windows VM").withResourceId( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgname/providers/Microsoft.Compute/virtualMachines/vmname"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java index b863d1636278..b1c9e65a2d2a 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java @@ -9,8 +9,7 @@ */ public final class ServicesGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/GetService.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetService.json */ /** * Sample code: Gets details of the Azure service. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesListSamples.java index 84e0e936f3e8..0d898e6ad619 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesListSamples.java @@ -9,8 +9,7 @@ */ public final class ServicesListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListServices.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListServices.json */ /** * Sample code: Gets list of services for which a support ticket can be created. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilitySamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilitySamples.java index f77550350183..541622e31279 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilitySamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilitySamples.java @@ -12,18 +12,17 @@ */ public final class SupportTicketsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailabilityWithSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailabilityWithSubscription.json */ /** - * Sample code: Checks whether name is available for subscription scoped SupportTicket resource. + * Sample code: Checks whether name is available for a subscription support ticket resource. * * @param manager Entry point to SupportManager. */ - public static void checksWhetherNameIsAvailableForSubscriptionScopedSupportTicketResource( + public static void checksWhetherNameIsAvailableForASubscriptionSupportTicketResource( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().checkNameAvailabilityWithResponse( - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), - com.azure.core.util.Context.NONE); + manager.supportTickets() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java index e41857b3313c..13a1fa8a9963 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java @@ -20,8 +20,7 @@ */ public final class SupportTicketsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatawarehouseQuotaTicketForDTUs.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json */ /** * Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics. @@ -30,80 +29,68 @@ public final class SupportTicketsCreateSamples { */ public static void createATicketToRequestQuotaIncreaseForDTUsForAzureSynapseAnalytics( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSubMgmtSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json */ /** - * Sample code: Create a subscription scoped ticket for Subscription Management related issues. + * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedTicketForSubscriptionManagementRelatedIssues( + public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066").create(); - } - - /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json - */ - /** - * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. - * - * @param manager Entry point to SupportManager. - */ - public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount( - com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle( - "my title") - .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}")))) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateMachineLearningQuotaTicketForLowPriorityCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service. @@ -112,25 +99,33 @@ public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedul */ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("BatchAml") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription. @@ -139,25 +134,33 @@ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMach */ public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Subscription") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatabaseQuotaTicketForDTUs.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json */ /** * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. @@ -166,25 +169,33 @@ public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscr */ public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest() - .withRegion("EastUS").withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateGenericQuotaTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateGenericQuotaTicket.json */ /** * Sample code: Create a ticket to request Quota increase for services that do not require additional details in the @@ -195,21 +206,27 @@ public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( public static void createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket") + manager.supportTickets() + .define("testticket") .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") .withProblemClassificationId( "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid").create(); + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account. @@ -218,81 +235,141 @@ public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( */ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBillingSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json */ /** - * Sample code: Create a subscription scoped ticket for Billing related issues. + * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedTicketForBillingRelatedIssues( + public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/billing_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066").create(); + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("SQLMI") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList( + new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), + new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}")))) + .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlManagedInstanceQuotaTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json */ /** - * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. + * Sample code: Create a ticket for Subscription Management related issues for a subscription. * * @param manager Entry point to SupportManager. */ - public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance( + public static void createATicketForSubscriptionManagementRelatedIssuesForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.NO) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Technical issue related to a specific resource for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForTechnicalIssueRelatedToASpecificResourceForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("SQLMI").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList( - new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), - new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}")))) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withProblemScopingQuestions( + "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId( + "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) + .withSecondaryConsent(Arrays.asList( + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json */ /** * Sample code: Create a ticket to request Quota increase for Pools for a Batch account. @@ -301,28 +378,33 @@ public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance */ public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) - .withTitle( - "my title") + .withTitle("my title") .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withQuotaTicketDetails( - new QuotaTicketDetails().withQuotaChangeRequestSubType("Account").withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") - .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}")))) + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account. @@ -331,26 +413,34 @@ public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount( */ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Account") .withQuotaChangeRequestVersion("1.0") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload( - "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") + .withPayload( + "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatabaseQuotaTicketForServers.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for SQL Database. @@ -359,57 +449,64 @@ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresFo */ public static void createATicketToRequestQuotaIncreaseForServersForSQLDatabase( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Servers") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests( + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateTechnicalSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicketForSubscription.json */ /** - * Sample code: Create a subscription scoped ticket for Technical issue related to a specific resource. + * Sample code: Create a ticket for Billing related issues. * * @param manager Entry point to SupportManager. */ - public static void createASubscriptionScopedTicketForTechnicalIssueRelatedToASpecificResource( - com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions( - "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") + public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.NO) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") .withPreferredSupportLanguage("en-US")) .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withServiceId("/providers/Microsoft.Support/services/billing_service_guid") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId( - "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) - .withSecondaryConsent(Arrays.asList( - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateMachineLearningQuotaTicketForDedicatedCores.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service. @@ -418,16 +515,24 @@ public static void createASubscriptionScopedTicketForTechnicalIssueRelatedToASpe */ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("BatchAml") .withQuotaChangeRequestVersion("1.0") .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") @@ -436,8 +541,7 @@ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresFo } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSqlDatawarehouseQuotaTicketForServers.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics. @@ -446,25 +550,33 @@ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresFo */ public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("Servers") - .withQuotaChangeRequestVersion("1.0").withQuotaChangeRequests( + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateCoresQuotaTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateCoresQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Compute VM Cores. @@ -473,16 +585,24 @@ public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseA */ public static void createATicketToRequestQuotaIncreaseForComputeVMCores(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().define("testticket").withDescription("my description").withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) + manager.supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withSupportPlanId( "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/quota_service_guid") .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestVersion("1.0") .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("EastUS") .withPayload("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}")))) diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsGetSamples.java index 74fdb52002d3..0bfdaad9a878 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsGetSamples.java @@ -9,8 +9,7 @@ */ public final class SupportTicketsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetSubscriptionSupportTicketDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSubscriptionSupportTicketDetails.json */ /** * Sample code: Get details of a subscription ticket. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsListSamples.java index 425cba1085a7..9d2a91efb6b0 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsListSamples.java @@ -9,8 +9,7 @@ */ public final class SupportTicketsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsServiceIdEqualsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain service id for a subscription. @@ -23,8 +22,7 @@ public static void listSupportTicketsWithACertainServiceIdForASubscription( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in open state for a subscription. @@ -33,13 +31,12 @@ public static void listSupportTicketsWithACertainServiceIdForASubscription( */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", - com.azure.core.util.Context.NONE); + manager.supportTickets() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInUpdatingStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets in updating state for a subscription. @@ -52,8 +49,7 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateF } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state for a subscription. @@ -62,13 +58,13 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateF */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingStateForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", - com.azure.core.util.Context.NONE); + manager.supportTickets() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsProblemClassificationIdEqualsForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain problem classification id for a subscription. @@ -77,13 +73,13 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingSt */ public static void listSupportTicketsWithACertainProblemClassificationIdForASubscription( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTickets().list(null, "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", - com.azure.core.util.Context.NONE); + manager.supportTickets() + .list(null, "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsBySubscription.json */ /** * Sample code: List support tickets for a subscription. @@ -95,8 +91,7 @@ public static void listSupportTicketsForASubscription(com.azure.resourcemanager. } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInOpenStateBySubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json */ /** * Sample code: List support tickets in open state for a subscription. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCheckNameAvailabilitySamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCheckNameAvailabilitySamples.java index 2d777d55e854..b6062b457a9a 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCheckNameAvailabilitySamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCheckNameAvailabilitySamples.java @@ -12,8 +12,7 @@ */ public final class SupportTicketsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CheckNameAvailability.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailability.json */ /** * Sample code: Checks whether name is available for SupportTicket resource. @@ -22,8 +21,8 @@ public final class SupportTicketsNoSubscriptionCheckNameAvailabilitySamples { */ public static void checksWhetherNameIsAvailableForSupportTicketResource(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().checkNameAvailabilityWithResponse( - new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("sampleName") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCreateSamples.java index bef7a1a53285..e6174802fe58 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCreateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCreateSamples.java @@ -18,8 +18,7 @@ */ public final class SupportTicketsNoSubscriptionCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateBillingSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicket.json */ /** * Sample code: Create a ticket for Billing related issues. @@ -27,25 +26,29 @@ public final class SupportTicketsNoSubscriptionCreateSamples { * @param manager Entry point to SupportManager. */ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().create("testticket", new SupportTicketDetailsInner() - .withDescription("my description") - .withProblemClassificationId( - "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title").withServiceId("/providers/Microsoft.Support/services/billing_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .create("testticket", new SupportTicketDetailsInner().withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.NO) + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/billing_service_guid") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateSubMgmtSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicket.json */ /** * Sample code: Create a ticket for Subscription Management related issues. @@ -54,26 +57,29 @@ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanage */ public static void createATicketForSubscriptionManagementRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().create("testticket", new SupportTicketDetailsInner() - .withDescription("my description") - .withProblemClassificationId( - "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE) - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .create("testticket", new SupportTicketDetailsInner().withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066"), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * CreateTechnicalSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicket.json */ /** * Sample code: Create a ticket for Technical issue related to a specific resource. @@ -82,24 +88,28 @@ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanage */ public static void createATicketForTechnicalIssueRelatedToASpecificResource( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().create("testticket", new SupportTicketDetailsInner() - .withDescription("my description") - .withProblemClassificationId( - "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") - .withSeverity(SeverityLevel.MODERATE).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions( - "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withContactDetails(new ContactProfile().withFirstName("abc").withLastName("xyz") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("abc@contoso.com") - .withPreferredTimeZone("Pacific Standard Time").withCountry("usa") - .withPreferredSupportLanguage("en-US")) - .withTitle("my title") - .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") - .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") - .withSecondaryConsent(Arrays.asList( - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .create("testticket", new SupportTicketDetailsInner().withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions( + "{\"articleId\":\"076846c1-4c0b-4b21-91c6-1a30246b3867\",\"scopingDetails\":[{\"question\":\"When did the problem begin?\",\"controlId\":\"problem_start_time\",\"orderId\":1,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"2023-08-31T18:55:00.739Z\",\"value\":\"2023-08-31T18:55:00.739Z\",\"type\":\"datetime\"}},{\"question\":\"API Type of the Cosmos DB account\",\"controlId\":\"api_type\",\"orderId\":2,\"inputType\":\"static\",\"answer\":{\"displayValue\":\"Table\",\"value\":\"tables\",\"type\":\"string\"}},{\"question\":\"Table name\",\"controlId\":\"collection_name_table\",\"orderId\":11,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"Select Table Name\",\"value\":\"dont_know_answer\",\"type\":\"string\"}},{\"question\":\"Provide additional details about the issue you're facing\",\"controlId\":\"problem_description\",\"orderId\":12,\"inputType\":\"nonstatic\",\"answer\":{\"displayValue\":\"test ticket, please ignore and close\",\"value\":\"test ticket, please ignore and close\",\"type\":\"string\"}}]}") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withContactDetails(new ContactProfile().withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withFileWorkspaceName("6f16735c-1530836f-e9970f1a-2e49-47b7-96cd-9746b83aa066") + .withSecondaryConsent(Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES) + .withType("virtualmachinerunninglinuxservice"))), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionGetSamples.java index 0f07559c6ffe..2c30510167ed 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionGetSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionGetSamples.java @@ -9,8 +9,7 @@ */ public final class SupportTicketsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * GetSupportTicketDetails.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSupportTicketDetails.json */ /** * Sample code: Get details of a ticket. diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionListSamples.java index 4bbd6c75cf46..cb59895f743f 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionListSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionListSamples.java @@ -9,8 +9,7 @@ */ public final class SupportTicketsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state. @@ -19,13 +18,13 @@ public final class SupportTicketsNoSubscriptionListSamples { */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingState( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, - "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Updating'", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInOpenState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenState.json */ /** * Sample code: List support tickets in open state. @@ -37,9 +36,7 @@ public static void listSupportTicketsInOpenState(com.azure.resourcemanager.suppo } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ListSupportTickets. - * json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTickets.json */ /** * Sample code: List support tickets. @@ -51,8 +48,7 @@ public static void listSupportTickets(com.azure.resourcemanager.support.SupportM } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsInUpdatingState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInUpdatingState.json */ /** * Sample code: List support tickets in updating state. @@ -64,8 +60,7 @@ public static void listSupportTicketsInUpdatingState(com.azure.resourcemanager.s } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenState.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json */ /** * Sample code: List support tickets created on or after a certain date and in open state. @@ -74,13 +69,12 @@ public static void listSupportTicketsInUpdatingState(com.azure.resourcemanager.s */ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsServiceIdEquals.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsServiceIdEquals.json */ /** * Sample code: List support tickets with a certain service id. @@ -89,13 +83,12 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState( */ public static void listSupportTicketsWithACertainServiceId(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, "ServiceId eq 'vm_windows_service_guid'", - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "ServiceId eq 'vm_windows_service_guid'", com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * ListSupportTicketsProblemClassificationIdEquals.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsProblemClassificationIdEquals.json */ /** * Sample code: List support tickets with a certain problem classification id. @@ -104,7 +97,8 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState( */ public static void listSupportTicketsWithACertainProblemClassificationId( com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().list(null, - "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .list(null, "ProblemClassificationId eq 'compute_vm_problemClassification_guid'", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionUpdateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionUpdateSamples.java index 50b3c7d9a6a8..3f79fd48aabd 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionUpdateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionUpdateSamples.java @@ -17,8 +17,7 @@ */ public final class SupportTicketsNoSubscriptionUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicket.json */ /** * Sample code: Update advanced diagnostic consent of a support ticket. @@ -27,13 +26,13 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { */ public static void updateAdvancedDiagnosticConsentOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withAdvancedDiagnosticConsent(Consent.YES), com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", new UpdateSupportTicket().withAdvancedDiagnosticConsent(Consent.YES), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateSeverityOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicket.json */ /** * Sample code: Update severity of a support ticket. @@ -41,13 +40,13 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { * @param manager Entry point to SupportManager. */ public static void updateSeverityOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL), com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateStatusOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicket.json */ /** * Sample code: Update status of a support ticket. @@ -55,13 +54,13 @@ public static void updateSeverityOfASupportTicket(com.azure.resourcemanager.supp * @param manager Entry point to SupportManager. */ public static void updateStatusOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withStatus(Status.CLOSED), com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", new UpdateSupportTicket().withStatus(Status.CLOSED), + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateContactDetailsOfSupportTicket.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicket.json */ /** * Sample code: Update contact details of a support ticket. @@ -69,13 +68,17 @@ public static void updateStatusOfASupportTicket(com.azure.resourcemanager.suppor * @param manager Entry point to SupportManager. */ public static void updateContactDetailsOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { - manager.supportTicketsNoSubscriptions().updateWithResponse("testticket", - new UpdateSupportTicket().withContactDetails(new UpdateContactProfile().withFirstName("first name") - .withLastName("last name").withPreferredContactMethod(PreferredContactMethod.EMAIL) - .withPrimaryEmailAddress("test.name@contoso.com") - .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) - .withPhoneNumber("123-456-7890").withPreferredTimeZone("Pacific Standard Time").withCountry("USA") - .withPreferredSupportLanguage("en-US")), - com.azure.core.util.Context.NONE); + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", + new UpdateSupportTicket().withContactDetails(new UpdateContactProfile().withFirstName("first name") + .withLastName("last name") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("test.name@contoso.com") + .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) + .withPhoneNumber("123-456-7890") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("USA") + .withPreferredSupportLanguage("en-US")), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java index ad4f47fcdd92..38954273e48b 100644 --- a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java @@ -17,73 +17,72 @@ */ public final class SupportTicketsUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json */ /** - * Sample code: Update advanced diagnostic consent of a support ticket. + * Sample code: Update advanced diagnostic consent of a subscription support ticket. * * @param manager Entry point to SupportManager. */ - public static void - updateAdvancedDiagnosticConsentOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + public static void updateAdvancedDiagnosticConsentOfASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); resource.update().withAdvancedDiagnosticConsent(Consent.YES).apply(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateContactDetailsOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json */ /** - * Sample code: Update contact details of a subscription scoped support ticket. + * Sample code: Update severity of a subscription support ticket. * * @param manager Entry point to SupportManager. */ - public static void updateContactDetailsOfASubscriptionScopedSupportTicket( - com.azure.resourcemanager.support.SupportManager manager) { + public static void + updateSeverityOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); - resource.update() - .withContactDetails(new UpdateContactProfile().withFirstName("first name").withLastName("last name") - .withPreferredContactMethod(PreferredContactMethod.EMAIL) - .withPrimaryEmailAddress("test.name@contoso.com") - .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) - .withPhoneNumber("123-456-7890").withPreferredTimeZone("Pacific Standard Time").withCountry("USA") - .withPreferredSupportLanguage("en-US")) - .apply(); + resource.update().withSeverity(SeverityLevel.CRITICAL).apply(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateStatusOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json */ /** - * Sample code: Update status of a subscription scoped support ticket. + * Sample code: Update status of a subscription support ticket. * * @param manager Entry point to SupportManager. */ public static void - updateStatusOfASubscriptionScopedSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + updateStatusOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); resource.update().withStatus(Status.CLOSED).apply(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/preview/2023-06-01-preview/examples/ - * UpdateSeverityOfSupportTicketForSubscription.json + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json */ /** - * Sample code: Update severity of a subscription scoped support ticket. + * Sample code: Update contact details of a subscription support ticket. * * @param manager Entry point to SupportManager. */ public static void - updateSeverityOfASubscriptionScopedSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + updateContactDetailsOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); - resource.update().withSeverity(SeverityLevel.CRITICAL).apply(); + resource.update() + .withContactDetails(new UpdateContactProfile().withFirstName("first name") + .withLastName("last name") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("test.name@contoso.com") + .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) + .withPhoneNumber("123-456-7890") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("USA") + .withPreferredSupportLanguage("en-US")) + .apply(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsInnerTests.java index babc794efbb0..84775c28f13f 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsInnerTests.java @@ -14,20 +14,19 @@ public final class ChatTranscriptDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChatTranscriptDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"messages\":[{\"communicationDirection\":\"outbound\",\"sender\":\"rgly\",\"body\":\"tddckcb\",\"createdDate\":\"2021-09-18T06:03:16Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"gciqibrh\",\"body\":\"sxsdqrhzoymibm\",\"createdDate\":\"2021-03-04T00:00:50Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"wfluszdt\",\"body\":\"hrkwo\",\"createdDate\":\"2021-08-13T05:08:08Z\"}],\"startTime\":\"2021-02-28T16:21:21Z\"},\"id\":\"acpie\",\"name\":\"pbtg\",\"type\":\"wbwo\"}") + "{\"properties\":{\"messages\":[{\"communicationDirection\":\"outbound\",\"sender\":\"jfdtwssotftpvj\",\"body\":\"exilzznfqqnvwpmq\",\"createdDate\":\"2021-06-07T17:58:08Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"mkcjhwqytjrybn\",\"body\":\"ewgdrjervn\",\"createdDate\":\"2021-09-08T11:50:32Z\"}],\"startTime\":\"2021-06-16T21:41:42Z\"},\"id\":\"hin\",\"name\":\"oygmift\",\"type\":\"nzdndslgna\"}") .toObject(ChatTranscriptDetailsInner.class); - Assertions.assertEquals("rgly", model.messages().get(0).sender()); - Assertions.assertEquals("tddckcb", model.messages().get(0).body()); + Assertions.assertEquals("jfdtwssotftpvj", model.messages().get(0).sender()); + Assertions.assertEquals("exilzznfqqnvwpmq", model.messages().get(0).body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ChatTranscriptDetailsInner model = new ChatTranscriptDetailsInner() - .withMessages(Arrays.asList(new MessageProperties().withSender("rgly").withBody("tddckcb"), - new MessageProperties().withSender("gciqibrh").withBody("sxsdqrhzoymibm"), - new MessageProperties().withSender("wfluszdt").withBody("hrkwo"))); + ChatTranscriptDetailsInner model = new ChatTranscriptDetailsInner().withMessages( + Arrays.asList(new MessageProperties().withSender("jfdtwssotftpvj").withBody("exilzznfqqnvwpmq"), + new MessageProperties().withSender("mkcjhwqytjrybn").withBody("ewgdrjervn"))); model = BinaryData.fromObject(model).toObject(ChatTranscriptDetailsInner.class); - Assertions.assertEquals("rgly", model.messages().get(0).sender()); - Assertions.assertEquals("tddckcb", model.messages().get(0).body()); + Assertions.assertEquals("jfdtwssotftpvj", model.messages().get(0).sender()); + Assertions.assertEquals("exilzznfqqnvwpmq", model.messages().get(0).body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsPropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsPropertiesTests.java index 463519f59975..e53688e633df 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsPropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptDetailsPropertiesTests.java @@ -14,19 +14,21 @@ public final class ChatTranscriptDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChatTranscriptDetailsProperties model = BinaryData.fromString( - "{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"tdtkcn\",\"body\":\"xwbpokulpiuj\",\"createdDate\":\"2021-01-28T10:46:40Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"i\",\"body\":\"obyu\",\"createdDate\":\"2021-11-02T07:24:48Z\"}],\"startTime\":\"2021-08-02T06:07:15Z\"}") + "{\"messages\":[{\"communicationDirection\":\"outbound\",\"sender\":\"uhavhql\",\"body\":\"humaqolbgyc\",\"createdDate\":\"2021-09-15T15:38:14Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"ccymvaolpsslql\",\"body\":\"mdnbbglzpswiy\",\"createdDate\":\"2021-07-14T12:06:58Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"dxssadbzm\",\"body\":\"dfznudaodv\",\"createdDate\":\"2021-05-29T13:49:41Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"ylpstdbhhxsrzdz\",\"body\":\"erscdntne\",\"createdDate\":\"2021-04-19T04:18:41Z\"}],\"startTime\":\"2021-05-10T05:26:40Z\"}") .toObject(ChatTranscriptDetailsProperties.class); - Assertions.assertEquals("tdtkcn", model.messages().get(0).sender()); - Assertions.assertEquals("xwbpokulpiuj", model.messages().get(0).body()); + Assertions.assertEquals("uhavhql", model.messages().get(0).sender()); + Assertions.assertEquals("humaqolbgyc", model.messages().get(0).body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ChatTranscriptDetailsProperties model = new ChatTranscriptDetailsProperties() - .withMessages(Arrays.asList(new MessageProperties().withSender("tdtkcn").withBody("xwbpokulpiuj"), - new MessageProperties().withSender("i").withBody("obyu"))); + .withMessages(Arrays.asList(new MessageProperties().withSender("uhavhql").withBody("humaqolbgyc"), + new MessageProperties().withSender("ccymvaolpsslql").withBody("mdnbbglzpswiy"), + new MessageProperties().withSender("dxssadbzm").withBody("dfznudaodv"), + new MessageProperties().withSender("ylpstdbhhxsrzdz").withBody("erscdntne"))); model = BinaryData.fromObject(model).toObject(ChatTranscriptDetailsProperties.class); - Assertions.assertEquals("tdtkcn", model.messages().get(0).sender()); - Assertions.assertEquals("xwbpokulpiuj", model.messages().get(0).body()); + Assertions.assertEquals("uhavhql", model.messages().get(0).sender()); + Assertions.assertEquals("humaqolbgyc", model.messages().get(0).body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetWithResponseMockTests.java index a280f24f581d..8aec9fe326f8 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsGetWithResponseMockTests.java @@ -6,52 +6,34 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ChatTranscriptsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"evy\",\"body\":\"yhsgz\",\"createdDate\":\"2021-09-04T20:31:38Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"fgbegl\",\"body\":\"gleohi\",\"createdDate\":\"2021-01-07T16:18:42Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"nkrrf\",\"body\":\"eeebtijvacv\",\"createdDate\":\"2021-01-25T13:21:34Z\"}],\"startTime\":\"2021-03-26T14:58:49Z\"},\"id\":\"q\",\"name\":\"lajrnwxacevehj\",\"type\":\"uyxoaf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"yuvvfonkp\",\"body\":\"qyikvy\",\"createdDate\":\"2021-02-02T17:56:52Z\"}],\"startTime\":\"2021-10-02T06:20:36Z\"},\"id\":\"luwmncst\",\"name\":\"ijf\",\"type\":\"bvpoekrsgsgbdhu\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - ChatTranscriptDetails response = manager.chatTranscripts() - .getWithResponse("dgug", "yzihgrkyuizabsn", com.azure.core.util.Context.NONE).getValue(); + ChatTranscriptDetails response + = manager.chatTranscripts().getWithResponse("tj", "zysdzh", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("evy", response.messages().get(0).sender()); - Assertions.assertEquals("yhsgz", response.messages().get(0).body()); + Assertions.assertEquals("yuvvfonkp", response.messages().get(0).sender()); + Assertions.assertEquals("qyikvy", response.messages().get(0).body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListMockTests.java index 3cdb30f4330a..ed2da72dc8f8 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListMockTests.java @@ -6,53 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ChatTranscriptsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"qqoli\",\"body\":\"r\",\"createdDate\":\"2021-05-10T13:24:14Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"brjtloqxfuoj\",\"body\":\"ngiflrzpasccbi\",\"createdDate\":\"2021-02-19T12:22:52Z\"}],\"startTime\":\"2021-07-29T06:48:21Z\"},\"id\":\"yjdfqwmky\",\"name\":\"qufdvruzslzojh\",\"type\":\"ctfnmdxotng\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"messages\":[{\"communicationDirection\":\"outbound\",\"sender\":\"ecxn\",\"body\":\"icokpv\",\"createdDate\":\"2021-07-01T18:07:42Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"dgxobfircl\",\"body\":\"kciayzri\",\"createdDate\":\"2021-12-06T15:32:30Z\"}],\"startTime\":\"2021-07-02T10:18:56Z\"},\"id\":\"fvjlboxqvkjlmx\",\"name\":\"omdynhdwdigum\",\"type\":\"nraauzz\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.chatTranscripts().list("jjrcgegydc", com.azure.core.util.Context.NONE); + = manager.chatTranscripts().list("aawzqadfl", com.azure.core.util.Context.NONE); - Assertions.assertEquals("qqoli", response.iterator().next().messages().get(0).sender()); - Assertions.assertEquals("r", response.iterator().next().messages().get(0).body()); + Assertions.assertEquals("ecxn", response.iterator().next().messages().get(0).sender()); + Assertions.assertEquals("icokpv", response.iterator().next().messages().get(0).body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListResultTests.java index ee05f72526f5..5acfad600553 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListResultTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsListResultTests.java @@ -15,27 +15,26 @@ public final class ChatTranscriptsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChatTranscriptsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"vnhdldwmgxcxr\",\"body\":\"lpmutwuoegrpkhj\",\"createdDate\":\"2021-10-06T05:56:37Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"uicpd\",\"body\":\"gk\",\"createdDate\":\"2021-04-02T01:13:45Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"axmodfvuef\",\"body\":\"wsbpfvm\",\"createdDate\":\"2021-02-05T02:38:16Z\"}],\"startTime\":\"2021-09-11T11:11:45Z\"},\"id\":\"uyfta\",\"name\":\"kcpwiy\",\"type\":\"vqtmnub\"},{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"ondjmq\",\"body\":\"xvy\",\"createdDate\":\"2021-04-11T05:06:48Z\"}],\"startTime\":\"2021-10-01T02:55:48Z\"},\"id\":\"pkwhojvpa\",\"name\":\"qgxy\",\"type\":\"mocmbqfqvmk\"}],\"nextLink\":\"oz\"}") + "{\"value\":[{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"ppcqeqxolz\",\"body\":\"hzxct\",\"createdDate\":\"2021-10-01T04:47:29Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"oizpostmgrcfbun\",\"body\":\"fqjhhkxbpvjymj\",\"createdDate\":\"2021-07-29T03:03:57Z\"}],\"startTime\":\"2021-12-01T23:11:57Z\"},\"id\":\"gudivkrtswbxqz\",\"name\":\"szjfauvjfdxxivet\",\"type\":\"t\"},{\"properties\":{\"messages\":[{\"communicationDirection\":\"outbound\",\"sender\":\"mcbxvwvxysl\",\"body\":\"hsfxoblytkb\",\"createdDate\":\"2021-09-21T19:24:42Z\"}],\"startTime\":\"2021-02-10T08:31:36Z\"},\"id\":\"wfbkrvrns\",\"name\":\"shqjohxcrsbf\",\"type\":\"vasrruvwb\"}],\"nextLink\":\"qfsubcgjbirx\"}") .toObject(ChatTranscriptsListResult.class); - Assertions.assertEquals("vnhdldwmgxcxr", model.value().get(0).messages().get(0).sender()); - Assertions.assertEquals("lpmutwuoegrpkhj", model.value().get(0).messages().get(0).body()); - Assertions.assertEquals("oz", model.nextLink()); + Assertions.assertEquals("ppcqeqxolz", model.value().get(0).messages().get(0).sender()); + Assertions.assertEquals("hzxct", model.value().get(0).messages().get(0).body()); + Assertions.assertEquals("qfsubcgjbirx", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ChatTranscriptsListResult model = new ChatTranscriptsListResult() .withValue(Arrays.asList( - new ChatTranscriptDetailsInner().withMessages( - Arrays.asList(new MessageProperties().withSender("vnhdldwmgxcxr").withBody("lpmutwuoegrpkhj"), - new MessageProperties().withSender("uicpd").withBody("gk"), - new MessageProperties().withSender("axmodfvuef").withBody("wsbpfvm"))), new ChatTranscriptDetailsInner() - .withMessages(Arrays.asList(new MessageProperties().withSender("ondjmq").withBody("xvy"))))) - .withNextLink("oz"); + .withMessages(Arrays.asList(new MessageProperties().withSender("ppcqeqxolz").withBody("hzxct"), + new MessageProperties().withSender("oizpostmgrcfbun").withBody("fqjhhkxbpvjymj"))), + new ChatTranscriptDetailsInner().withMessages( + Arrays.asList(new MessageProperties().withSender("mcbxvwvxysl").withBody("hsfxoblytkb"))))) + .withNextLink("qfsubcgjbirx"); model = BinaryData.fromObject(model).toObject(ChatTranscriptsListResult.class); - Assertions.assertEquals("vnhdldwmgxcxr", model.value().get(0).messages().get(0).sender()); - Assertions.assertEquals("lpmutwuoegrpkhj", model.value().get(0).messages().get(0).body()); - Assertions.assertEquals("oz", model.nextLink()); + Assertions.assertEquals("ppcqeqxolz", model.value().get(0).messages().get(0).sender()); + Assertions.assertEquals("hzxct", model.value().get(0).messages().get(0).body()); + Assertions.assertEquals("qfsubcgjbirx", model.nextLink()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsGetWithResponseMockTests.java index da0060761806..937f56978b09 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsGetWithResponseMockTests.java @@ -6,52 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ChatTranscriptsNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"ibcysihsgqc\",\"body\":\"dhohsdtmcdzsuf\",\"createdDate\":\"2021-11-18T17:35:34Z\"},{\"communicationDirection\":\"inbound\",\"sender\":\"lm\",\"body\":\"muapcvhdbevw\",\"createdDate\":\"2021-10-19T03:06:18Z\"}],\"startTime\":\"2021-05-23T03:56:56Z\"},\"id\":\"ko\",\"name\":\"qzinkfkbg\",\"type\":\"z\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"udaspavehh\",\"body\":\"kbunzoz\",\"createdDate\":\"2021-03-21T22:40:21Z\"}],\"startTime\":\"2021-07-25T12:58:50Z\"},\"id\":\"kmoyxcdyuibh\",\"name\":\"fdn\",\"type\":\"zydvfvf\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); ChatTranscriptDetails response = manager.chatTranscriptsNoSubscriptions() - .getWithResponse("jltfvnzcyjtotpv", "pvpbdbzqgqqiheds", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("m", "rafwgckhocxvdf", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("ibcysihsgqc", response.messages().get(0).sender()); - Assertions.assertEquals("dhohsdtmcdzsuf", response.messages().get(0).body()); + Assertions.assertEquals("udaspavehh", response.messages().get(0).sender()); + Assertions.assertEquals("kbunzoz", response.messages().get(0).body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsListMockTests.java index 57d1be9744b5..fba987651591 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ChatTranscriptsNoSubscriptionsListMockTests.java @@ -6,53 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ChatTranscriptsNoSubscriptionsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"messages\":[{\"communicationDirection\":\"outbound\",\"sender\":\"irpghriypoqeyh\",\"body\":\"qhykprlpyzn\",\"createdDate\":\"2021-04-10T23:45:20Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"ex\",\"body\":\"itdfuxtyasiib\",\"createdDate\":\"2021-11-12T00:43:32Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"stgnl\",\"body\":\"hnmgixhcm\",\"createdDate\":\"2021-04-26T15:04:11Z\"},{\"communicationDirection\":\"outbound\",\"sender\":\"dorhcgyyp\",\"body\":\"otwypundmb\",\"createdDate\":\"2021-09-26T18:20:07Z\"}],\"startTime\":\"2021-05-18T07:53:38Z\"},\"id\":\"jkavl\",\"name\":\"or\",\"type\":\"mftpmdtz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"messages\":[{\"communicationDirection\":\"inbound\",\"sender\":\"omtkub\",\"body\":\"ppnvdxz\",\"createdDate\":\"2021-01-05T01:25:57Z\"},{\"communicationDirection\":\"inbound\",\"sender\":\"b\",\"body\":\"vqagtltdhlf\",\"createdDate\":\"2021-10-11T23:31:22Z\"}],\"startTime\":\"2021-08-08T09:12:47Z\"},\"id\":\"kvgtrdcn\",\"name\":\"fmzzsdymbrny\",\"type\":\"u\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.chatTranscriptsNoSubscriptions().list("aoqltfaey", com.azure.core.util.Context.NONE); + = manager.chatTranscriptsNoSubscriptions().list("qgnjdgkynscli", com.azure.core.util.Context.NONE); - Assertions.assertEquals("irpghriypoqeyh", response.iterator().next().messages().get(0).sender()); - Assertions.assertEquals("qhykprlpyzn", response.iterator().next().messages().get(0).body()); + Assertions.assertEquals("omtkub", response.iterator().next().messages().get(0).sender()); + Assertions.assertEquals("ppnvdxz", response.iterator().next().messages().get(0).body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityInputTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityInputTests.java index adc1b6720df4..440eb5bbbfc0 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityInputTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityInputTests.java @@ -13,18 +13,18 @@ public final class CheckNameAvailabilityInputTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityInput model - = BinaryData.fromString("{\"name\":\"tvfcivfsn\",\"type\":\"Microsoft.Support/communications\"}") + = BinaryData.fromString("{\"name\":\"psalgbqux\",\"type\":\"Microsoft.Support/communications\"}") .toObject(CheckNameAvailabilityInput.class); - Assertions.assertEquals("tvfcivfsn", model.name()); + Assertions.assertEquals("psalgbqux", model.name()); Assertions.assertEquals(Type.MICROSOFT_SUPPORT_COMMUNICATIONS, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CheckNameAvailabilityInput model - = new CheckNameAvailabilityInput().withName("tvfcivfsn").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS); + = new CheckNameAvailabilityInput().withName("psalgbqux").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityInput.class); - Assertions.assertEquals("tvfcivfsn", model.name()); + Assertions.assertEquals("psalgbqux", model.name()); Assertions.assertEquals(Type.MICROSOFT_SUPPORT_COMMUNICATIONS, model.type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityOutputInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityOutputInnerTests.java index 06f8ef247063..8d525254b3f1 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityOutputInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CheckNameAvailabilityOutputInnerTests.java @@ -11,7 +11,7 @@ public final class CheckNameAvailabilityOutputInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityOutputInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"tqhjfbebrjcx\",\"message\":\"fuwutttxf\"}") + = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"gzjaoyfhrtxilne\",\"message\":\"ujysvle\"}") .toObject(CheckNameAvailabilityOutputInner.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassificationServiceTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassificationServiceTests.java deleted file mode 100644 index d7a2ee6426ff..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassificationServiceTests.java +++ /dev/null @@ -1,28 +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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ClassificationService; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ClassificationServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ClassificationService model = BinaryData - .fromString( - "{\"serviceId\":\"ouqfprwz\",\"displayName\":\"nguitnwuizgazxu\",\"resourceTypes\":[\"uckyf\",\"hr\"]}") - .toObject(ClassificationService.class); - Assertions.assertEquals("uckyf", model.resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ClassificationService model = new ClassificationService().withResourceTypes(Arrays.asList("uckyf", "hr")); - model = BinaryData.fromObject(model).toObject(ClassificationService.class); - Assertions.assertEquals("uckyf", model.resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsInnerTests.java index b152f32d2c66..950f3adfa04c 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsInnerTests.java @@ -12,20 +12,20 @@ public final class CommunicationDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommunicationDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"n\",\"subject\":\"aljutiiswac\",\"body\":\"fgdkzzew\",\"createdDate\":\"2021-09-11T04:06:27Z\"},\"id\":\"hqcrailvpnpp\",\"name\":\"uflrwd\",\"type\":\"hdlxyjrxsagafcn\"}") + "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"pnyiropuhp\",\"subject\":\"gvpgy\",\"body\":\"gqgitxmedjvcsl\",\"createdDate\":\"2021-02-07T09:50:45Z\"},\"id\":\"wwncwzzhxgk\",\"name\":\"rmgucnap\",\"type\":\"t\"}") .toObject(CommunicationDetailsInner.class); - Assertions.assertEquals("n", model.sender()); - Assertions.assertEquals("aljutiiswac", model.subject()); - Assertions.assertEquals("fgdkzzew", model.body()); + Assertions.assertEquals("pnyiropuhp", model.sender()); + Assertions.assertEquals("gvpgy", model.subject()); + Assertions.assertEquals("gqgitxmedjvcsl", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CommunicationDetailsInner model - = new CommunicationDetailsInner().withSender("n").withSubject("aljutiiswac").withBody("fgdkzzew"); + = new CommunicationDetailsInner().withSender("pnyiropuhp").withSubject("gvpgy").withBody("gqgitxmedjvcsl"); model = BinaryData.fromObject(model).toObject(CommunicationDetailsInner.class); - Assertions.assertEquals("n", model.sender()); - Assertions.assertEquals("aljutiiswac", model.subject()); - Assertions.assertEquals("fgdkzzew", model.body()); + Assertions.assertEquals("pnyiropuhp", model.sender()); + Assertions.assertEquals("gvpgy", model.subject()); + Assertions.assertEquals("gqgitxmedjvcsl", model.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsPropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsPropertiesTests.java index 72cba4795a2c..43b2dde14c7f 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsPropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationDetailsPropertiesTests.java @@ -12,20 +12,20 @@ public final class CommunicationDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommunicationDetailsProperties model = BinaryData.fromString( - "{\"communicationType\":\"web\",\"communicationDirection\":\"outbound\",\"sender\":\"pnedgf\",\"subject\":\"cvkcvqvpkeqdcv\",\"body\":\"rhvoods\",\"createdDate\":\"2021-11-02T01:53:07Z\"}") + "{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"pt\",\"subject\":\"d\",\"body\":\"gpfqbuace\",\"createdDate\":\"2021-09-04T05:04:19Z\"}") .toObject(CommunicationDetailsProperties.class); - Assertions.assertEquals("pnedgf", model.sender()); - Assertions.assertEquals("cvkcvqvpkeqdcv", model.subject()); - Assertions.assertEquals("rhvoods", model.body()); + Assertions.assertEquals("pt", model.sender()); + Assertions.assertEquals("d", model.subject()); + Assertions.assertEquals("gpfqbuace", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CommunicationDetailsProperties model = new CommunicationDetailsProperties().withSender("pnedgf") - .withSubject("cvkcvqvpkeqdcv").withBody("rhvoods"); + CommunicationDetailsProperties model + = new CommunicationDetailsProperties().withSender("pt").withSubject("d").withBody("gpfqbuace"); model = BinaryData.fromObject(model).toObject(CommunicationDetailsProperties.class); - Assertions.assertEquals("pnedgf", model.sender()); - Assertions.assertEquals("cvkcvqvpkeqdcv", model.subject()); - Assertions.assertEquals("rhvoods", model.body()); + Assertions.assertEquals("pt", model.sender()); + Assertions.assertEquals("d", model.subject()); + Assertions.assertEquals("gpfqbuace", model.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilityWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilityWithResponseMockTests.java index dd990ff04c3d..2aeba55111f2 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilityWithResponseMockTests.java @@ -6,54 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; import com.azure.resourcemanager.support.models.Type; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":true,\"reason\":\"lwxezwzhokvbwnh\",\"message\":\"qlgehg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityOutput response - = manager.communications() - .checkNameAvailabilityWithResponse("rjdqnsdfzp", new CheckNameAvailabilityInput() - .withName("gtgkylkdghr").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), - com.azure.core.util.Context.NONE) - .getValue(); + String responseStr = "{\"nameAvailable\":false,\"reason\":\"fnynszqujizdvoqy\",\"message\":\"byowbblgyavutp\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CheckNameAvailabilityOutput response = manager.communications() + .checkNameAvailabilityWithResponse("ilbywdxsm", + new CheckNameAvailabilityInput().withName("ccwr").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCreateMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCreateMockTests.java index 2f8ce0c370b6..6cd42173a2f8 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCreateMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCreateMockTests.java @@ -6,54 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsCreateMockTests { @Test public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"dqmeqwigpibudq\",\"subject\":\"yxeb\",\"body\":\"ybpmzznrtffyaq\",\"createdDate\":\"2021-11-05T02:36:27Z\"},\"id\":\"hheioqaqhvseuf\",\"name\":\"qyrxp\",\"type\":\"lcgqlsismj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommunicationDetails response - = manager.communications().define("thwtzol").withExistingSupportTicket("eoohguufuzboyj").withSender("xmeb") - .withSubject("jscjpahl").withBody("veabfqxnmwmqtib").create(); - - Assertions.assertEquals("dqmeqwigpibudq", response.sender()); - Assertions.assertEquals("yxeb", response.subject()); - Assertions.assertEquals("ybpmzznrtffyaq", response.body()); + = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"udzpxgwjplmagstc\",\"subject\":\"ohpfkyrkdbdgiog\",\"body\":\"jkmnwq\",\"createdDate\":\"2021-09-21T11:57:43Z\"},\"id\":\"baiyhddviaceg\",\"name\":\"n\",\"type\":\"ntfpmvmemfnc\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CommunicationDetails response = manager.communications() + .define("jxakv") + .withExistingSupportTicket("bteoybf") + .withSubject("il") + .withBody("yw") + .withSender("r") + .create(); + + Assertions.assertEquals("udzpxgwjplmagstc", response.sender()); + Assertions.assertEquals("ohpfkyrkdbdgiog", response.subject()); + Assertions.assertEquals("jkmnwq", response.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsGetWithResponseMockTests.java index f4cb0e087537..0fb92d8f354a 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsGetWithResponseMockTests.java @@ -6,53 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"outbound\",\"sender\":\"kakankjpdnjzhaj\",\"subject\":\"ylhjlm\",\"body\":\"oyxprimr\",\"createdDate\":\"2021-01-23T03:44:08Z\"},\"id\":\"teecjmeislst\",\"name\":\"asylwx\",\"type\":\"zaum\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"juisavokqdzf\",\"subject\":\"azivjlfrqttbajl\",\"body\":\"atnwxyiopi\",\"createdDate\":\"2021-05-28T18:08:40Z\"},\"id\":\"qfkuvscxkdmli\",\"name\":\"ovibrxkp\",\"type\":\"loazuruocbgoo\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); CommunicationDetails response = manager.communications() - .getWithResponse("wsldrizetpwbr", "lllibph", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("ctxtgzukxi", "mmqtgqqqxhr", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("kakankjpdnjzhaj", response.sender()); - Assertions.assertEquals("ylhjlm", response.subject()); - Assertions.assertEquals("oyxprimr", response.body()); + Assertions.assertEquals("juisavokqdzf", response.sender()); + Assertions.assertEquals("azivjlfrqttbajl", response.subject()); + Assertions.assertEquals("atnwxyiopi", response.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListMockTests.java index 53d128a61074..98195344e345 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListMockTests.java @@ -6,54 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"txjcsheafidlt\",\"subject\":\"gsresmkssj\",\"body\":\"oiftxfkfwegprh\",\"createdDate\":\"2021-01-06T18:32:33Z\"},\"id\":\"llu\",\"name\":\"biqtgdq\",\"type\":\"hm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"jxkcgxxlxsff\",\"subject\":\"cvizqzdwlvw\",\"body\":\"youpfgfbkj\",\"createdDate\":\"2021-08-08T19:25:39Z\"},\"id\":\"yhgk\",\"name\":\"minsgowzf\",\"type\":\"tsttktlahbq\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.communications().list("pipifh", 248464194, "e", com.azure.core.util.Context.NONE); + = manager.communications().list("hjoxo", 1315761996, "msksbp", com.azure.core.util.Context.NONE); - Assertions.assertEquals("txjcsheafidlt", response.iterator().next().sender()); - Assertions.assertEquals("gsresmkssj", response.iterator().next().subject()); - Assertions.assertEquals("oiftxfkfwegprh", response.iterator().next().body()); + Assertions.assertEquals("jxkcgxxlxsff", response.iterator().next().sender()); + Assertions.assertEquals("cvizqzdwlvw", response.iterator().next().subject()); + Assertions.assertEquals("youpfgfbkj", response.iterator().next().body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListResultTests.java index 6f7274936aaa..a7fd511bf154 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListResultTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsListResultTests.java @@ -14,26 +14,29 @@ public final class CommunicationsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommunicationsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"dagxtibqd\",\"subject\":\"bxwakbog\",\"body\":\"xndlkzgxhu\",\"createdDate\":\"2021-03-23T13:44:10Z\"},\"id\":\"lbpodxunk\",\"name\":\"ebxmubyynt\",\"type\":\"lrb\"},{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"seotgqrllt\",\"subject\":\"u\",\"body\":\"lauwzizxbmpgcjef\",\"createdDate\":\"2021-09-15T06:09:09Z\"},\"id\":\"uvpb\",\"name\":\"tdum\",\"type\":\"rp\"},{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"btbhjpglkfgohd\",\"subject\":\"euel\",\"body\":\"phsdyhto\",\"createdDate\":\"2021-12-10T07:50:41Z\"},\"id\":\"kd\",\"name\":\"wwquuvxzxclvithh\",\"type\":\"zonosgg\"}],\"nextLink\":\"c\"}") + "{\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"ro\",\"subject\":\"qbex\",\"body\":\"mcqibycnojv\",\"createdDate\":\"2021-02-06T03:19:14Z\"},\"id\":\"fqsgzvahapjy\",\"name\":\"hpvgqz\",\"type\":\"j\"},{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"lmwlxkvugfhzo\",\"subject\":\"awjvzunluthnnp\",\"body\":\"nxipeil\",\"createdDate\":\"2021-07-12T01:35:59Z\"},\"id\":\"uaejxdultsk\",\"name\":\"bbtdzumvee\",\"type\":\"gpw\"},{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"p\",\"subject\":\"sjyofdx\",\"body\":\"uusdttouwa\",\"createdDate\":\"2021-08-12T22:43:04Z\"},\"id\":\"kqvkelnsmvbxwyjs\",\"name\":\"lh\",\"type\":\"caalnjixisxyaw\"},{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"slyjpkiid\",\"subject\":\"yexz\",\"body\":\"eli\",\"createdDate\":\"2021-06-22T01:42:27Z\"},\"id\":\"rzt\",\"name\":\"o\",\"type\":\"hb\"}],\"nextLink\":\"knalaulppg\"}") .toObject(CommunicationsListResult.class); - Assertions.assertEquals("dagxtibqd", model.value().get(0).sender()); - Assertions.assertEquals("bxwakbog", model.value().get(0).subject()); - Assertions.assertEquals("xndlkzgxhu", model.value().get(0).body()); - Assertions.assertEquals("c", model.nextLink()); + Assertions.assertEquals("ro", model.value().get(0).sender()); + Assertions.assertEquals("qbex", model.value().get(0).subject()); + Assertions.assertEquals("mcqibycnojv", model.value().get(0).body()); + Assertions.assertEquals("knalaulppg", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CommunicationsListResult model = new CommunicationsListResult() .withValue(Arrays.asList( - new CommunicationDetailsInner().withSender("dagxtibqd").withSubject("bxwakbog").withBody("xndlkzgxhu"), - new CommunicationDetailsInner().withSender("seotgqrllt").withSubject("u").withBody("lauwzizxbmpgcjef"), - new CommunicationDetailsInner().withSender("btbhjpglkfgohd").withSubject("euel").withBody("phsdyhto"))) - .withNextLink("c"); + new CommunicationDetailsInner().withSender("ro").withSubject("qbex").withBody("mcqibycnojv"), + new CommunicationDetailsInner().withSender("lmwlxkvugfhzo") + .withSubject("awjvzunluthnnp") + .withBody("nxipeil"), + new CommunicationDetailsInner().withSender("p").withSubject("sjyofdx").withBody("uusdttouwa"), + new CommunicationDetailsInner().withSender("slyjpkiid").withSubject("yexz").withBody("eli"))) + .withNextLink("knalaulppg"); model = BinaryData.fromObject(model).toObject(CommunicationsListResult.class); - Assertions.assertEquals("dagxtibqd", model.value().get(0).sender()); - Assertions.assertEquals("bxwakbog", model.value().get(0).subject()); - Assertions.assertEquals("xndlkzgxhu", model.value().get(0).body()); - Assertions.assertEquals("c", model.nextLink()); + Assertions.assertEquals("ro", model.value().get(0).sender()); + Assertions.assertEquals("qbex", model.value().get(0).subject()); + Assertions.assertEquals("mcqibycnojv", model.value().get(0).body()); + Assertions.assertEquals("knalaulppg", model.nextLink()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java index 3ab90da28a6e..536dae8d4439 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java @@ -6,53 +6,37 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; import com.azure.resourcemanager.support.models.Type; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":true,\"reason\":\"xrxzbujrtr\",\"message\":\"vwrevkhgnlnzon\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityOutput response = manager.communicationsNoSubscriptions() - .checkNameAvailabilityWithResponse("frddgamquhiosrsj", new CheckNameAvailabilityInput() - .withName("ivfcdisyirnx").withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), - com.azure.core.util.Context.NONE) - .getValue(); + String responseStr = "{\"nameAvailable\":true,\"reason\":\"vwrdnhfukuvsj\",\"message\":\"wsmystuluqypf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CheckNameAvailabilityOutput response + = manager.communicationsNoSubscriptions() + .checkNameAvailabilityWithResponse("dwvvba", + new CheckNameAvailabilityInput().withName("xlllchp") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), + com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCreateMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCreateMockTests.java index ac9e915a9f38..8ee87d47fd46 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCreateMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCreateMockTests.java @@ -6,55 +6,38 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; import com.azure.resourcemanager.support.models.CommunicationDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsNoSubscriptionsCreateMockTests { @Test public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"outbound\",\"sender\":\"vl\",\"subject\":\"ijpstte\",\"body\":\"oqq\",\"createdDate\":\"2021-08-04T21:44:36Z\"},\"id\":\"yyufmhruncuw\",\"name\":\"qspkcdqzhlctd\",\"type\":\"unqndyfpchrqb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CommunicationDetails response = manager.communicationsNoSubscriptions().create("hnomdrkywuh", "svfuurutlwexxwl", - new CommunicationDetailsInner().withSender("srzpgepqtybbww").withSubject("gdakchz").withBody("vl"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vl", response.sender()); - Assertions.assertEquals("ijpstte", response.subject()); - Assertions.assertEquals("oqq", response.body()); + = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"z\",\"subject\":\"rr\",\"body\":\"vpglydz\",\"createdDate\":\"2021-02-08T17:34:52Z\"},\"id\":\"vqeevtoep\",\"name\":\"yutnwytpzdmov\",\"type\":\"vf\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CommunicationDetails response = manager.communicationsNoSubscriptions() + .create("eqvldspast", "bkkd", + new CommunicationDetailsInner().withSender("tmjlx").withSubject("ril").withBody("zapeewchpx"), + com.azure.core.util.Context.NONE); + + Assertions.assertEquals("z", response.sender()); + Assertions.assertEquals("rr", response.subject()); + Assertions.assertEquals("vpglydz", response.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsGetWithResponseMockTests.java index 1c2c18f8b67f..dd0a2f84ecd2 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsGetWithResponseMockTests.java @@ -6,53 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"boldforobwj\",\"subject\":\"vizbfhfo\",\"body\":\"vacqpbtuodxesz\",\"createdDate\":\"2021-04-19T03:22:05Z\"},\"id\":\"elawumu\",\"name\":\"slzkwrrwoycqu\",\"type\":\"wyh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"jtlvofqzhvfciby\",\"subject\":\"mowuxrk\",\"body\":\"pvdwxf\",\"createdDate\":\"2021-09-25T09:52:18Z\"},\"id\":\"vwzjbhyz\",\"name\":\"xjrk\",\"type\":\"mbtrnegvmnvu\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); CommunicationDetails response = manager.communicationsNoSubscriptions() - .getWithResponse("hmkdasvfl", "hbxcu", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("pgogtqxepny", "b", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("boldforobwj", response.sender()); - Assertions.assertEquals("vizbfhfo", response.subject()); - Assertions.assertEquals("vacqpbtuodxesz", response.body()); + Assertions.assertEquals("jtlvofqzhvfciby", response.sender()); + Assertions.assertEquals("mowuxrk", response.subject()); + Assertions.assertEquals("pvdwxf", response.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsListMockTests.java index 47d5814ac842..45b48db90fd6 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsListMockTests.java @@ -6,54 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class CommunicationsNoSubscriptionsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"eamurvzmlo\",\"subject\":\"uanashcxlp\",\"body\":\"jerbdkelvidizozs\",\"createdDate\":\"2021-03-04T13:00:01Z\"},\"id\":\"cxjmonfdgnwncyp\",\"name\":\"uwwltvuqjctz\",\"type\":\"nkeifz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"rihpfhoq\",\"subject\":\"aaewdaomdjv\",\"body\":\"pjxxkzb\",\"createdDate\":\"2021-07-29T14:30:38Z\"},\"id\":\"geivsiykzkdncj\",\"name\":\"xonbzoggculapz\",\"type\":\"y\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.communicationsNoSubscriptions().list("lrpiqywnc", - 1838313194, "tszcofizehtdhgb", com.azure.core.util.Context.NONE); + PagedIterable response = manager.communicationsNoSubscriptions() + .list("vlerchpqbmfpjba", 877892499, "idfcxsspuunnoxyh", com.azure.core.util.Context.NONE); - Assertions.assertEquals("eamurvzmlo", response.iterator().next().sender()); - Assertions.assertEquals("uanashcxlp", response.iterator().next().subject()); - Assertions.assertEquals("jerbdkelvidizozs", response.iterator().next().body()); + Assertions.assertEquals("rihpfhoq", response.iterator().next().sender()); + Assertions.assertEquals("aaewdaomdjv", response.iterator().next().subject()); + Assertions.assertEquals("pjxxkzb", response.iterator().next().body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ContactProfileTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ContactProfileTests.java index f96de0123197..abd71ad4a1e9 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ContactProfileTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ContactProfileTests.java @@ -14,34 +14,39 @@ public final class ContactProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContactProfile model = BinaryData.fromString( - "{\"firstName\":\"ymjhxxjyngudivkr\",\"lastName\":\"swbxqz\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"zjf\",\"additionalEmailAddresses\":[\"j\",\"dxxiv\"],\"phoneNumber\":\"vtcqaqtdo\",\"preferredTimeZone\":\"mcbxvwvxysl\",\"country\":\"bhsfxob\",\"preferredSupportLanguage\":\"ytkblmpew\"}") + "{\"firstName\":\"zntxhdz\",\"lastName\":\"lrqjbhckfr\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"rxsbkyvp\",\"additionalEmailAddresses\":[\"n\",\"z\",\"p\",\"kafkuwbcrnwbm\"],\"phoneNumber\":\"hseyvju\",\"preferredTimeZone\":\"rts\",\"country\":\"hspkdeemao\",\"preferredSupportLanguage\":\"mx\"}") .toObject(ContactProfile.class); - Assertions.assertEquals("ymjhxxjyngudivkr", model.firstName()); - Assertions.assertEquals("swbxqz", model.lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); - Assertions.assertEquals("zjf", model.primaryEmailAddress()); - Assertions.assertEquals("j", model.additionalEmailAddresses().get(0)); - Assertions.assertEquals("vtcqaqtdo", model.phoneNumber()); - Assertions.assertEquals("mcbxvwvxysl", model.preferredTimeZone()); - Assertions.assertEquals("bhsfxob", model.country()); - Assertions.assertEquals("ytkblmpew", model.preferredSupportLanguage()); + Assertions.assertEquals("zntxhdz", model.firstName()); + Assertions.assertEquals("lrqjbhckfr", model.lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.preferredContactMethod()); + Assertions.assertEquals("rxsbkyvp", model.primaryEmailAddress()); + Assertions.assertEquals("n", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("hseyvju", model.phoneNumber()); + Assertions.assertEquals("rts", model.preferredTimeZone()); + Assertions.assertEquals("hspkdeemao", model.country()); + Assertions.assertEquals("mx", model.preferredSupportLanguage()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ContactProfile model = new ContactProfile().withFirstName("ymjhxxjyngudivkr").withLastName("swbxqz") - .withPreferredContactMethod(PreferredContactMethod.PHONE).withPrimaryEmailAddress("zjf") - .withAdditionalEmailAddresses(Arrays.asList("j", "dxxiv")).withPhoneNumber("vtcqaqtdo") - .withPreferredTimeZone("mcbxvwvxysl").withCountry("bhsfxob").withPreferredSupportLanguage("ytkblmpew"); + ContactProfile model = new ContactProfile().withFirstName("zntxhdz") + .withLastName("lrqjbhckfr") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("rxsbkyvp") + .withAdditionalEmailAddresses(Arrays.asList("n", "z", "p", "kafkuwbcrnwbm")) + .withPhoneNumber("hseyvju") + .withPreferredTimeZone("rts") + .withCountry("hspkdeemao") + .withPreferredSupportLanguage("mx"); model = BinaryData.fromObject(model).toObject(ContactProfile.class); - Assertions.assertEquals("ymjhxxjyngudivkr", model.firstName()); - Assertions.assertEquals("swbxqz", model.lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); - Assertions.assertEquals("zjf", model.primaryEmailAddress()); - Assertions.assertEquals("j", model.additionalEmailAddresses().get(0)); - Assertions.assertEquals("vtcqaqtdo", model.phoneNumber()); - Assertions.assertEquals("mcbxvwvxysl", model.preferredTimeZone()); - Assertions.assertEquals("bhsfxob", model.country()); - Assertions.assertEquals("ytkblmpew", model.preferredSupportLanguage()); + Assertions.assertEquals("zntxhdz", model.firstName()); + Assertions.assertEquals("lrqjbhckfr", model.lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.preferredContactMethod()); + Assertions.assertEquals("rxsbkyvp", model.primaryEmailAddress()); + Assertions.assertEquals("n", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("hseyvju", model.phoneNumber()); + Assertions.assertEquals("rts", model.preferredTimeZone()); + Assertions.assertEquals("hspkdeemao", model.country()); + Assertions.assertEquals("mx", model.preferredSupportLanguage()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsInnerTests.java index ab16a4a4dedd..746612c56a41 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsInnerTests.java @@ -12,20 +12,20 @@ public final class FileDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"createdOn\":\"2021-05-14T18:56:32Z\",\"chunkSize\":596393327,\"fileSize\":546578204,\"numberOfChunks\":1587464346},\"id\":\"rz\",\"name\":\"hleosjsw\",\"type\":\"rmslyzrpzbchckqq\"}") + "{\"properties\":{\"createdOn\":\"2021-11-03T20:59:21Z\",\"chunkSize\":1250108412,\"fileSize\":239999895,\"numberOfChunks\":659977632},\"id\":\"tibqdxbxwakb\",\"name\":\"gqxndlkzgxhuripl\",\"type\":\"podxunkb\"}") .toObject(FileDetailsInner.class); - Assertions.assertEquals(596393327, model.chunkSize()); - Assertions.assertEquals(546578204, model.fileSize()); - Assertions.assertEquals(1587464346, model.numberOfChunks()); + Assertions.assertEquals(1250108412, model.chunkSize()); + Assertions.assertEquals(239999895, model.fileSize()); + Assertions.assertEquals(659977632, model.numberOfChunks()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FileDetailsInner model - = new FileDetailsInner().withChunkSize(596393327).withFileSize(546578204).withNumberOfChunks(1587464346); + = new FileDetailsInner().withChunkSize(1250108412).withFileSize(239999895).withNumberOfChunks(659977632); model = BinaryData.fromObject(model).toObject(FileDetailsInner.class); - Assertions.assertEquals(596393327, model.chunkSize()); - Assertions.assertEquals(546578204, model.fileSize()); - Assertions.assertEquals(1587464346, model.numberOfChunks()); + Assertions.assertEquals(1250108412, model.chunkSize()); + Assertions.assertEquals(239999895, model.fileSize()); + Assertions.assertEquals(659977632, model.numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsPropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsPropertiesTests.java index 878978c04631..dbb8ef5fac88 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsPropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileDetailsPropertiesTests.java @@ -12,20 +12,21 @@ public final class FileDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileDetailsProperties model = BinaryData.fromString( - "{\"createdOn\":\"2021-05-25T05:03:14Z\",\"chunkSize\":671328296,\"fileSize\":1223269261,\"numberOfChunks\":2011830272}") + "{\"createdOn\":\"2021-09-11T16:48:39Z\",\"chunkSize\":1819295736,\"fileSize\":1347899854,\"numberOfChunks\":1050448020}") .toObject(FileDetailsProperties.class); - Assertions.assertEquals(671328296, model.chunkSize()); - Assertions.assertEquals(1223269261, model.fileSize()); - Assertions.assertEquals(2011830272, model.numberOfChunks()); + Assertions.assertEquals(1819295736, model.chunkSize()); + Assertions.assertEquals(1347899854, model.fileSize()); + Assertions.assertEquals(1050448020, model.numberOfChunks()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FileDetailsProperties model = new FileDetailsProperties().withChunkSize(671328296).withFileSize(1223269261) - .withNumberOfChunks(2011830272); + FileDetailsProperties model = new FileDetailsProperties().withChunkSize(1819295736) + .withFileSize(1347899854) + .withNumberOfChunks(1050448020); model = BinaryData.fromObject(model).toObject(FileDetailsProperties.class); - Assertions.assertEquals(671328296, model.chunkSize()); - Assertions.assertEquals(1223269261, model.fileSize()); - Assertions.assertEquals(2011830272, model.numberOfChunks()); + Assertions.assertEquals(1819295736, model.chunkSize()); + Assertions.assertEquals(1347899854, model.fileSize()); + Assertions.assertEquals(1050448020, model.numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsInnerTests.java index 122e940d3bf8..4db2ffa9d7df 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsInnerTests.java @@ -11,7 +11,7 @@ public final class FileWorkspaceDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileWorkspaceDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"createdOn\":\"2021-10-11T05:43:38Z\",\"expirationTime\":\"2021-09-02T16:03:41Z\"},\"id\":\"lpichk\",\"name\":\"ymkcdyhb\",\"type\":\"kkpwdreqnovvq\"}") + "{\"properties\":{\"createdOn\":\"2021-11-23T06:55:57Z\",\"expirationTime\":\"2021-04-22T09:32:34Z\"},\"id\":\"hhszh\",\"name\":\"d\",\"type\":\"lvwiwubmwmbesl\"}") .toObject(FileWorkspaceDetailsInner.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsPropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsPropertiesTests.java index 738f6f2e26ea..b5d400abce33 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsPropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspaceDetailsPropertiesTests.java @@ -11,7 +11,7 @@ public final class FileWorkspaceDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileWorkspaceDetailsProperties model = BinaryData - .fromString("{\"createdOn\":\"2021-03-26T11:46:42Z\",\"expirationTime\":\"2021-11-12T04:23:21Z\"}") + .fromString("{\"createdOn\":\"2021-09-29T12:41:57Z\",\"expirationTime\":\"2020-12-30T08:12:48Z\"}") .toObject(FileWorkspaceDetailsProperties.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateWithResponseMockTests.java index 509762f34ed4..d01c7dd6f7b6 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesCreateWithResponseMockTests.java @@ -6,49 +6,31 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FileWorkspacesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-05-22T10:48:30Z\",\"expirationTime\":\"2021-03-19T22:04:23Z\"},\"id\":\"awopqh\",\"name\":\"wjptm\",\"type\":\"gsbos\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(201); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"createdOn\":\"2021-08-19T13:21:57Z\",\"expirationTime\":\"2021-04-19T12:51:33Z\"},\"id\":\"zqlqhyc\",\"name\":\"vodggxdbee\",\"type\":\"mieknlraria\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); FileWorkspaceDetails response - = manager.fileWorkspaces().createWithResponse("zdix", com.azure.core.util.Context.NONE).getValue(); + = manager.fileWorkspaces().createWithResponse("hnze", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetWithResponseMockTests.java index 7055e60b257a..7aba8218deca 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesGetWithResponseMockTests.java @@ -6,49 +6,31 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FileWorkspacesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-08-09T14:47:12Z\",\"expirationTime\":\"2021-11-24T12:44:14Z\"},\"id\":\"jeokbzefezrxccz\",\"name\":\"rtle\",\"type\":\"pqxbkwvzgnzvdf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"createdOn\":\"2021-07-04T04:35:49Z\",\"expirationTime\":\"2021-03-05T05:54Z\"},\"id\":\"ffukiscvw\",\"name\":\"zhwplefaxvxilc\",\"type\":\"tg\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); FileWorkspaceDetails response - = manager.fileWorkspaces().getWithResponse("owxeqocljmy", com.azure.core.util.Context.NONE).getValue(); + = manager.fileWorkspaces().getWithResponse("jnaeois", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsCreateWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsCreateWithResponseMockTests.java index 9c0c9060f5b7..65d480ba1657 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsCreateWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsCreateWithResponseMockTests.java @@ -6,49 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FileWorkspacesNoSubscriptionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-07-19T16:08:35Z\",\"expirationTime\":\"2020-12-22T06:29:43Z\"},\"id\":\"a\",\"name\":\"zv\",\"type\":\"chndbnwie\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(201); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"createdOn\":\"2021-06-16T11:37:33Z\",\"expirationTime\":\"2021-03-28T18:59:19Z\"},\"id\":\"bugrj\",\"name\":\"cto\",\"type\":\"cmisofie\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); FileWorkspaceDetails response = manager.fileWorkspacesNoSubscriptions() - .createWithResponse("ayzejnhlbkpbz", com.azure.core.util.Context.NONE).getValue(); + .createWithResponse("ozuxylfsbtkadpys", com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsGetWithResponseMockTests.java index 5c56b5dbdc6c..a705327c1e94 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FileWorkspacesNoSubscriptionsGetWithResponseMockTests.java @@ -6,49 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FileWorkspacesNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-04-17T09:09:47Z\",\"expirationTime\":\"2021-09-07T19:28:53Z\"},\"id\":\"bbpneqvcwwy\",\"name\":\"urmochpprprs\",\"type\":\"mo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"createdOn\":\"2021-09-23T05:34:47Z\",\"expirationTime\":\"2021-06-07T02:49:09Z\"},\"id\":\"iagtc\",\"name\":\"jocqwogfnzjvusf\",\"type\":\"ld\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); FileWorkspaceDetails response = manager.fileWorkspacesNoSubscriptions() - .getWithResponse("zelndlatutmzlbi", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("wiuagydwqf", com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesCreateWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesCreateWithResponseMockTests.java index 2c884b3b97e4..ee43ff38c599 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesCreateWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesCreateWithResponseMockTests.java @@ -6,53 +6,40 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-07-26T11:46:41Z\",\"chunkSize\":1687361589,\"fileSize\":1968675812,\"numberOfChunks\":1683958424},\"id\":\"bzmifrygznmmaxr\",\"name\":\"zkzobgopxlhslnel\",\"type\":\"ieixynllxe\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(201); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FileDetails response = manager.files().define("lcfhmlrqryxy").withExistingFileWorkspace("fusfzsvtuikzhajq") - .withChunkSize(1242311262).withFileSize(1655994607).withNumberOfChunks(1202112108).create(); - - Assertions.assertEquals(1687361589, response.chunkSize()); - Assertions.assertEquals(1968675812, response.fileSize()); - Assertions.assertEquals(1683958424, response.numberOfChunks()); + = "{\"properties\":{\"createdOn\":\"2021-09-06T02:43:55Z\",\"chunkSize\":1964101220,\"fileSize\":527338272,\"numberOfChunks\":1341869205},\"id\":\"hyrpetogebjoxs\",\"name\":\"hvnh\",\"type\":\"abrqnkkzj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + FileDetails response = manager.files() + .define("bgq") + .withExistingFileWorkspace("fmmfblcqcu") + .withChunkSize(1522947792) + .withFileSize(1749229509) + .withNumberOfChunks(1690066547) + .create(); + + Assertions.assertEquals(1964101220, response.chunkSize()); + Assertions.assertEquals(527338272, response.fileSize()); + Assertions.assertEquals(1341869205, response.numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesGetWithResponseMockTests.java index 7f798d29b2c1..d5bbe7e00ac1 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesGetWithResponseMockTests.java @@ -6,53 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-11-14T04:41:22Z\",\"chunkSize\":733290659,\"fileSize\":1393109773,\"numberOfChunks\":241996681},\"id\":\"i\",\"name\":\"ids\",\"type\":\"ault\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"createdOn\":\"2021-03-09T08:38:36Z\",\"chunkSize\":966273213,\"fileSize\":1305858117,\"numberOfChunks\":272678412},\"id\":\"qovekqvgqou\",\"name\":\"ifzmpjwyivqi\",\"type\":\"f\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); FileDetails response - = manager.files().getWithResponse("awbzasqb", "clj", com.azure.core.util.Context.NONE).getValue(); + = manager.files().getWithResponse("rgnowcjhfgm", "ecactx", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(733290659, response.chunkSize()); - Assertions.assertEquals(1393109773, response.fileSize()); - Assertions.assertEquals(241996681, response.numberOfChunks()); + Assertions.assertEquals(966273213, response.chunkSize()); + Assertions.assertEquals(1305858117, response.fileSize()); + Assertions.assertEquals(272678412, response.numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListMockTests.java index 02e10444a79d..cdf6d2b17ee5 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListMockTests.java @@ -6,53 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-03-06T02:52:17Z\",\"chunkSize\":1179630825,\"fileSize\":863156641,\"numberOfChunks\":512301047},\"id\":\"aqtferr\",\"name\":\"wexjkmfxapjwogq\",\"type\":\"nobpudcdabtqwpw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-02-12T18:50:03Z\",\"chunkSize\":359045420,\"fileSize\":1283952114,\"numberOfChunks\":362693256},\"id\":\"cp\",\"name\":\"cwkhihi\",\"type\":\"lhzdsqtzb\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - PagedIterable response = manager.files().list("olewjwi", com.azure.core.util.Context.NONE); + PagedIterable response = manager.files().list("pe", com.azure.core.util.Context.NONE); - Assertions.assertEquals(1179630825, response.iterator().next().chunkSize()); - Assertions.assertEquals(863156641, response.iterator().next().fileSize()); - Assertions.assertEquals(512301047, response.iterator().next().numberOfChunks()); + Assertions.assertEquals(359045420, response.iterator().next().chunkSize()); + Assertions.assertEquals(1283952114, response.iterator().next().fileSize()); + Assertions.assertEquals(362693256, response.iterator().next().numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListResultTests.java index e64219e4a84c..769806d2f3cf 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListResultTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesListResultTests.java @@ -14,24 +14,24 @@ public final class FilesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FilesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdOn\":\"2021-02-16T22:04:52Z\",\"chunkSize\":2009471016,\"fileSize\":1405607916,\"numberOfChunks\":200190444},\"id\":\"sytgadgvraea\",\"name\":\"neqn\",\"type\":\"arrwlquu\"},{\"properties\":{\"createdOn\":\"2021-07-01T04:35:37Z\",\"chunkSize\":1823399080,\"fileSize\":216133532,\"numberOfChunks\":2115532997},\"id\":\"pfpubjibww\",\"name\":\"f\",\"type\":\"ohqkvpuvksgpls\"}],\"nextLink\":\"nynfsynljphuo\"}") + "{\"value\":[{\"properties\":{\"createdOn\":\"2021-05-13T14:02:05Z\",\"chunkSize\":799059143,\"fileSize\":1248501015,\"numberOfChunks\":712173581},\"id\":\"konzmnsik\",\"name\":\"mkqzeqqkdltfzxmh\",\"type\":\"v\"}],\"nextLink\":\"ur\"}") .toObject(FilesListResult.class); - Assertions.assertEquals(2009471016, model.value().get(0).chunkSize()); - Assertions.assertEquals(1405607916, model.value().get(0).fileSize()); - Assertions.assertEquals(200190444, model.value().get(0).numberOfChunks()); - Assertions.assertEquals("nynfsynljphuo", model.nextLink()); + Assertions.assertEquals(799059143, model.value().get(0).chunkSize()); + Assertions.assertEquals(1248501015, model.value().get(0).fileSize()); + Assertions.assertEquals(712173581, model.value().get(0).numberOfChunks()); + Assertions.assertEquals("ur", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FilesListResult model = new FilesListResult().withValue(Arrays.asList( - new FileDetailsInner().withChunkSize(2009471016).withFileSize(1405607916).withNumberOfChunks(200190444), - new FileDetailsInner().withChunkSize(1823399080).withFileSize(216133532).withNumberOfChunks(2115532997))) - .withNextLink("nynfsynljphuo"); + FilesListResult model = new FilesListResult() + .withValue(Arrays.asList( + new FileDetailsInner().withChunkSize(799059143).withFileSize(1248501015).withNumberOfChunks(712173581))) + .withNextLink("ur"); model = BinaryData.fromObject(model).toObject(FilesListResult.class); - Assertions.assertEquals(2009471016, model.value().get(0).chunkSize()); - Assertions.assertEquals(1405607916, model.value().get(0).fileSize()); - Assertions.assertEquals(200190444, model.value().get(0).numberOfChunks()); - Assertions.assertEquals("nynfsynljphuo", model.nextLink()); + Assertions.assertEquals(799059143, model.value().get(0).chunkSize()); + Assertions.assertEquals(1248501015, model.value().get(0).fileSize()); + Assertions.assertEquals(712173581, model.value().get(0).numberOfChunks()); + Assertions.assertEquals("ur", model.nextLink()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsCreateWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsCreateWithResponseMockTests.java index a50924f24aeb..05d0581360aa 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsCreateWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsCreateWithResponseMockTests.java @@ -6,57 +6,39 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; import com.azure.resourcemanager.support.models.FileDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesNoSubscriptionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-07-20T17:34:14Z\",\"chunkSize\":782840551,\"fileSize\":1337241911,\"numberOfChunks\":669649169},\"id\":\"xmvwfg\",\"name\":\"ayxonsupeujl\",\"type\":\"qnhcvsqltnzoibg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(201); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - FileDetails response - = manager.filesNoSubscriptions() - .createWithResponse("uamwabzxrvxc", "s", new FileDetailsInner().withChunkSize(35510152) - .withFileSize(1111352078).withNumberOfChunks(885005234), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(782840551, response.chunkSize()); - Assertions.assertEquals(1337241911, response.fileSize()); - Assertions.assertEquals(669649169, response.numberOfChunks()); + = "{\"properties\":{\"createdOn\":\"2021-06-27T13:13:13Z\",\"chunkSize\":1740217746,\"fileSize\":1527837396,\"numberOfChunks\":1693425826},\"id\":\"h\",\"name\":\"immbcx\",\"type\":\"h\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + FileDetails response = manager.filesNoSubscriptions() + .createWithResponse("aaomylweazu", "cse", + new FileDetailsInner().withChunkSize(1128305959).withFileSize(574230298).withNumberOfChunks(307378678), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals(1740217746, response.chunkSize()); + Assertions.assertEquals(1527837396, response.fileSize()); + Assertions.assertEquals(1693425826, response.numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsGetWithResponseMockTests.java index 51e9ad3415a5..9df40e1c6400 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsGetWithResponseMockTests.java @@ -6,53 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"createdOn\":\"2021-11-06T15:55:48Z\",\"chunkSize\":1288508818,\"fileSize\":130887115,\"numberOfChunks\":470540726},\"id\":\"xm\",\"name\":\"f\",\"type\":\"kqscazuawxtzx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"createdOn\":\"2021-05-29T18:36:16Z\",\"chunkSize\":2128381794,\"fileSize\":23704541,\"numberOfChunks\":654985035},\"id\":\"ltlwtjjguktalhs\",\"name\":\"vkcdmxzr\",\"type\":\"oaimlnw\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); FileDetails response = manager.filesNoSubscriptions() - .getWithResponse("ickpz", "cpopmxel", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("pimaqxzhemjyh", "hujswtwkozzwcul", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals(1288508818, response.chunkSize()); - Assertions.assertEquals(130887115, response.fileSize()); - Assertions.assertEquals(470540726, response.numberOfChunks()); + Assertions.assertEquals(2128381794, response.chunkSize()); + Assertions.assertEquals(23704541, response.fileSize()); + Assertions.assertEquals(654985035, response.numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsListMockTests.java index 6466a09870d0..a424d83ee7e3 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsListMockTests.java @@ -6,54 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesNoSubscriptionsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-11-01T10:21:35Z\",\"chunkSize\":879044854,\"fileSize\":1565634168,\"numberOfChunks\":1988738388},\"id\":\"gorqjbttzh\",\"name\":\"aglkafhon\",\"type\":\"juj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-05-20T11:54:02Z\",\"chunkSize\":732133593,\"fileSize\":1032283606,\"numberOfChunks\":2115158777},\"id\":\"xjjs\",\"name\":\"oqbeitpkxzt\",\"type\":\"oobklftidgfcwq\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.filesNoSubscriptions().list("wcrojphslhcaw", com.azure.core.util.Context.NONE); + = manager.filesNoSubscriptions().list("jb", com.azure.core.util.Context.NONE); - Assertions.assertEquals(879044854, response.iterator().next().chunkSize()); - Assertions.assertEquals(1565634168, response.iterator().next().fileSize()); - Assertions.assertEquals(1988738388, response.iterator().next().numberOfChunks()); + Assertions.assertEquals(732133593, response.iterator().next().chunkSize()); + Assertions.assertEquals(1032283606, response.iterator().next().fileSize()); + Assertions.assertEquals(2115158777, response.iterator().next().numberOfChunks()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsUploadWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsUploadWithResponseMockTests.java index 1dc8524337d5..dfbead908ff8 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsUploadWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesNoSubscriptionsUploadWithResponseMockTests.java @@ -6,48 +6,31 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.UploadFile; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesNoSubscriptionsUploadWithResponseMockTests { @Test public void testUploadWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.filesNoSubscriptions().uploadWithResponse("xgnxfyqonmpqoxwd", "fdbxiqxeiiqbim", - new UploadFile().withContent("mwwinhehfqpofv").withChunkIndex(712044714), com.azure.core.util.Context.NONE); + manager.filesNoSubscriptions() + .uploadWithResponse("cporxvxcjz", "qizxfpxtgqscjavf", + new UploadFile().withContent("uhdqazk").withChunkIndex(308398935), com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesUploadWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesUploadWithResponseMockTests.java index 1d86e894297a..7b5594a1e244 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesUploadWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/FilesUploadWithResponseMockTests.java @@ -6,48 +6,31 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.UploadFile; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class FilesUploadWithResponseMockTests { @Test public void testUploadWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr = "{}"; - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 204, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - manager.files().uploadWithResponse("ijjumfq", "azlnqnmcjngzqdqx", - new UploadFile().withContent("jw").withChunkIndex(673657894), com.azure.core.util.Context.NONE); + manager.files() + .uploadWithResponse("cvhrfsp", "uagrttikteusqc", + new UploadFile().withContent("vyklxuby").withChunkIndex(490127820), com.azure.core.util.Context.NONE); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdRequestTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdRequestTests.java deleted file mode 100644 index 58cbbad17925..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdRequestTests.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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; -import com.azure.resourcemanager.support.models.ResourceType; -import org.junit.jupiter.api.Assertions; - -public final class LookUpResourceIdRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LookUpResourceIdRequest model = BinaryData - .fromString("{\"identifier\":\"edyatrwyhqmibzyh\",\"type\":\"Microsoft.Support/supportTickets\"}") - .toObject(LookUpResourceIdRequest.class); - Assertions.assertEquals("edyatrwyhqmibzyh", model.identifier()); - Assertions.assertEquals(ResourceType.MICROSOFT_SUPPORT_SUPPORT_TICKETS, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LookUpResourceIdRequest model = new LookUpResourceIdRequest().withIdentifier("edyatrwyhqmibzyh") - .withType(ResourceType.MICROSOFT_SUPPORT_SUPPORT_TICKETS); - model = BinaryData.fromObject(model).toObject(LookUpResourceIdRequest.class); - Assertions.assertEquals("edyatrwyhqmibzyh", model.identifier()); - Assertions.assertEquals(ResourceType.MICROSOFT_SUPPORT_SUPPORT_TICKETS, model.type()); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdResponseInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdResponseInnerTests.java deleted file mode 100644 index 8b95429c84bf..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdResponseInnerTests.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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; -import org.junit.jupiter.api.Assertions; - -public final class LookUpResourceIdResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LookUpResourceIdResponseInner model - = BinaryData.fromString("{\"resourceId\":\"mypyynpcdpu\"}").toObject(LookUpResourceIdResponseInner.class); - Assertions.assertEquals("mypyynpcdpu", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LookUpResourceIdResponseInner model = new LookUpResourceIdResponseInner().withResourceId("mypyynpcdpu"); - model = BinaryData.fromObject(model).toObject(LookUpResourceIdResponseInner.class); - Assertions.assertEquals("mypyynpcdpu", model.resourceId()); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdsPostWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdsPostWithResponseMockTests.java deleted file mode 100644 index a733a0801437..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdsPostWithResponseMockTests.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.support.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.support.SupportManager; -import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; -import com.azure.resourcemanager.support.models.LookUpResourceIdResponse; -import com.azure.resourcemanager.support.models.ResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LookUpResourceIdsPostWithResponseMockTests { - @Test - public void testPostWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"resourceId\":\"ebwtswb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - LookUpResourceIdResponse response - = manager.lookUpResourceIds() - .postWithResponse(new LookUpResourceIdRequest().withIdentifier("lembnkbwvqvxkdi") - .withType(ResourceType.MICROSOFT_SUPPORT_SUPPORT_TICKETS), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ebwtswb", response.resourceId()); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/MessagePropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/MessagePropertiesTests.java index d3db37ac8851..02a87786bd21 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/MessagePropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/MessagePropertiesTests.java @@ -12,17 +12,17 @@ public final class MessagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MessageProperties model = BinaryData.fromString( - "{\"communicationDirection\":\"inbound\",\"sender\":\"cciuqgbdbutau\",\"body\":\"fbtkuwhhmhyk\",\"createdDate\":\"2021-03-16T21:09:25Z\"}") + "{\"communicationDirection\":\"outbound\",\"sender\":\"dsslswt\",\"body\":\"eriofzpyqs\",\"createdDate\":\"2021-06-06T05:20:48Z\"}") .toObject(MessageProperties.class); - Assertions.assertEquals("cciuqgbdbutau", model.sender()); - Assertions.assertEquals("fbtkuwhhmhyk", model.body()); + Assertions.assertEquals("dsslswt", model.sender()); + Assertions.assertEquals("eriofzpyqs", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MessageProperties model = new MessageProperties().withSender("cciuqgbdbutau").withBody("fbtkuwhhmhyk"); + MessageProperties model = new MessageProperties().withSender("dsslswt").withBody("eriofzpyqs"); model = BinaryData.fromObject(model).toObject(MessageProperties.class); - Assertions.assertEquals("cciuqgbdbutau", model.sender()); - Assertions.assertEquals("fbtkuwhhmhyk", model.body()); + Assertions.assertEquals("dsslswt", model.sender()); + Assertions.assertEquals("eriofzpyqs", model.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationsListMockTests.java index 1a4c8670645b..0dce6bff6908 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationsListMockTests.java @@ -6,47 +6,29 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.Operation; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class OperationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"name\":\"zgmwznmabikns\",\"display\":{\"description\":\"jhxbld\",\"operation\":\"wwrlkdmtncv\",\"provider\":\"otllxdyhgsyo\",\"resource\":\"gjltdtbnnhado\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + = "{\"value\":[{\"name\":\"l\",\"display\":{\"description\":\"u\",\"operation\":\"auwzizxbmpgc\",\"provider\":\"fuzmuvpbtt\",\"resource\":\"morppxebmnzbtbh\"}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.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/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationInnerTests.java index 5fce787e0e9c..f28316705b7c 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationInnerTests.java @@ -14,45 +14,23 @@ public final class ProblemClassificationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProblemClassificationInner model = BinaryData.fromString( - "{\"id\":\"uesnzwdejbavo\",\"name\":\"zdmohctbqvu\",\"type\":\"xdn\",\"properties\":{\"displayName\":\"owgujjugwdkcglhs\",\"secondaryConsentEnabled\":[{\"description\":\"dyggdtjixhbku\",\"type\":\"qweykhmenev\"}],\"metadata\":{\"ybcibvyvdcsit\":\"xfw\",\"eypvhezrkg\":\"nnaamdectehfiqsc\"},\"parentProblemClassification\":{\"id\":\"jrefovgmkqsle\",\"name\":\"vxyqjpkcattpngjc\",\"type\":\"czsqpjhvm\",\"properties\":{\"displayName\":\"v\",\"secondaryConsentEnabled\":[{\"description\":\"unqecanoae\",\"type\":\"fhyhltrpmopjmcma\"},{\"description\":\"okth\",\"type\":\"iuaod\"},{\"description\":\"cpkvxodp\",\"type\":\"zmyzydagf\"},{\"description\":\"xbezyiuokktwh\",\"type\":\"xw\"}],\"metadata\":{\"mbsureximo\":\"q\",\"fksymddystki\":\"yocf\"},\"parentProblemClassification\":{\"id\":\"hqyudxorrqnbpoc\",\"name\":\"yifqrvkdvjsllrmv\",\"type\":\"f\",\"properties\":{\"displayName\":\"kpnpulexxbczwtr\",\"secondaryConsentEnabled\":[{},{}],\"metadata\":{\"vsovmyokac\":\"bq\"},\"parentProblemClassification\":{}}}}}}}") + "{\"id\":\"rokft\",\"name\":\"olniwpwcukjf\",\"type\":\"iawxklry\",\"properties\":{\"displayName\":\"ckbasyypndd\",\"secondaryConsentEnabled\":[{\"description\":\"bacphejko\",\"type\":\"nqgoulzndli\"},{\"description\":\"yqkgfg\",\"type\":\"madgakeqsrxyb\"},{\"description\":\"qedqytbciqfoufl\",\"type\":\"nkzsmodmglou\"}]}}") .toObject(ProblemClassificationInner.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.displayName()); - Assertions.assertEquals("dyggdtjixhbku", model.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("qweykhmenev", model.secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("v", model.parentProblemClassification().displayName()); - Assertions.assertEquals("unqecanoae", - model.parentProblemClassification().secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("fhyhltrpmopjmcma", - model.parentProblemClassification().secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("kpnpulexxbczwtr", - model.parentProblemClassification().parentProblemClassification().displayName()); + Assertions.assertEquals("ckbasyypndd", model.displayName()); + Assertions.assertEquals("bacphejko", model.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("nqgoulzndli", model.secondaryConsentEnabled().get(0).type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProblemClassificationInner model = new ProblemClassificationInner().withDisplayName("owgujjugwdkcglhs") + ProblemClassificationInner model = new ProblemClassificationInner().withDisplayName("ckbasyypndd") .withSecondaryConsentEnabled( - Arrays.asList(new SecondaryConsentEnabled().withDescription("dyggdtjixhbku").withType("qweykhmenev"))) - .withParentProblemClassification(new ProblemClassificationInner().withDisplayName("v") - .withSecondaryConsentEnabled(Arrays.asList( - new SecondaryConsentEnabled().withDescription("unqecanoae").withType("fhyhltrpmopjmcma"), - new SecondaryConsentEnabled().withDescription("okth").withType("iuaod"), - new SecondaryConsentEnabled().withDescription("cpkvxodp").withType("zmyzydagf"), - new SecondaryConsentEnabled().withDescription("xbezyiuokktwh").withType("xw"))) - .withParentProblemClassification(new ProblemClassificationInner().withDisplayName("kpnpulexxbczwtr") - .withSecondaryConsentEnabled( - Arrays.asList(new SecondaryConsentEnabled(), new SecondaryConsentEnabled())) - .withParentProblemClassification(new ProblemClassificationInner()))); + Arrays.asList(new SecondaryConsentEnabled().withDescription("bacphejko").withType("nqgoulzndli"), + new SecondaryConsentEnabled().withDescription("yqkgfg").withType("madgakeqsrxyb"), + new SecondaryConsentEnabled().withDescription("qedqytbciqfoufl").withType("nkzsmodmglou"))); model = BinaryData.fromObject(model).toObject(ProblemClassificationInner.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.displayName()); - Assertions.assertEquals("dyggdtjixhbku", model.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("qweykhmenev", model.secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("v", model.parentProblemClassification().displayName()); - Assertions.assertEquals("unqecanoae", - model.parentProblemClassification().secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("fhyhltrpmopjmcma", - model.parentProblemClassification().secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("kpnpulexxbczwtr", - model.parentProblemClassification().parentProblemClassification().displayName()); + Assertions.assertEquals("ckbasyypndd", model.displayName()); + Assertions.assertEquals("bacphejko", model.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("nqgoulzndli", model.secondaryConsentEnabled().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationPropertiesInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationPropertiesInnerTests.java deleted file mode 100644 index b8c88d8f4fcf..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationPropertiesInnerTests.java +++ /dev/null @@ -1,61 +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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationPropertiesInner; -import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProblemClassificationPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProblemClassificationPropertiesInner model = BinaryData.fromString( - "{\"displayName\":\"w\",\"secondaryConsentEnabled\":[{\"description\":\"obpxjmflbvvn\",\"type\":\"rkcciwwzjuqk\"},{\"description\":\"sa\",\"type\":\"wkuofoskghsauu\"},{\"description\":\"jmvxie\",\"type\":\"ugidyjrr\"},{\"description\":\"y\",\"type\":\"svexcsonpclhoco\"}],\"metadata\":{\"gz\":\"kevle\",\"lvmezyvshxmzsbbz\":\"buhfmvfaxkffeiit\"},\"parentProblemClassification\":{\"id\":\"igrxwburvjxxjn\",\"name\":\"ydptkoen\",\"type\":\"uknvudwti\",\"properties\":{\"displayName\":\"ldngkpoci\",\"secondaryConsentEnabled\":[{\"description\":\"xoegukgjnpiucgy\",\"type\":\"vqzntypmrbpizcdr\"}],\"metadata\":{\"yhxdeoejzicwi\":\"dpydn\",\"bkh\":\"sjttgzfbish\",\"alpbuxwgipwhon\":\"jdeyeamdpha\",\"kix\":\"wkgshwa\"},\"parentProblemClassification\":{\"id\":\"njeputtmrywn\",\"name\":\"oqftiyqzrnkcq\",\"type\":\"xlwhzlsicoh\",\"properties\":{\"displayName\":\"nwvlryavwhheunmm\",\"secondaryConsentEnabled\":[{},{}],\"metadata\":{\"ocukoklyax\":\"zko\"},\"parentProblemClassification\":{\"id\":\"nuqszfkbey\",\"name\":\"wrmjmwvvjektc\",\"type\":\"enhwlrs\",\"properties\":{}}}}}}}") - .toObject(ProblemClassificationPropertiesInner.class); - Assertions.assertEquals("w", model.displayName()); - Assertions.assertEquals("obpxjmflbvvn", model.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("rkcciwwzjuqk", model.secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("ldngkpoci", model.parentProblemClassification().displayName()); - Assertions.assertEquals("xoegukgjnpiucgy", - model.parentProblemClassification().secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("vqzntypmrbpizcdr", - model.parentProblemClassification().secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("nwvlryavwhheunmm", - model.parentProblemClassification().parentProblemClassification().displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProblemClassificationPropertiesInner model - = new ProblemClassificationPropertiesInner().withDisplayName("w") - .withSecondaryConsentEnabled(Arrays.asList( - new SecondaryConsentEnabled().withDescription("obpxjmflbvvn").withType("rkcciwwzjuqk"), - new SecondaryConsentEnabled().withDescription("sa").withType("wkuofoskghsauu"), - new SecondaryConsentEnabled().withDescription("jmvxie").withType("ugidyjrr"), - new SecondaryConsentEnabled().withDescription("y").withType("svexcsonpclhoco"))) - .withParentProblemClassification(new ProblemClassificationInner().withDisplayName("ldngkpoci") - .withSecondaryConsentEnabled(Arrays.asList( - new SecondaryConsentEnabled().withDescription("xoegukgjnpiucgy").withType("vqzntypmrbpizcdr"))) - .withParentProblemClassification( - new ProblemClassificationInner().withDisplayName("nwvlryavwhheunmm") - .withSecondaryConsentEnabled( - Arrays.asList(new SecondaryConsentEnabled(), new SecondaryConsentEnabled())) - .withParentProblemClassification(new ProblemClassificationInner()))); - model = BinaryData.fromObject(model).toObject(ProblemClassificationPropertiesInner.class); - Assertions.assertEquals("w", model.displayName()); - Assertions.assertEquals("obpxjmflbvvn", model.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("rkcciwwzjuqk", model.secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("ldngkpoci", model.parentProblemClassification().displayName()); - Assertions.assertEquals("xoegukgjnpiucgy", - model.parentProblemClassification().secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("vqzntypmrbpizcdr", - model.parentProblemClassification().secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("nwvlryavwhheunmm", - model.parentProblemClassification().parentProblemClassification().displayName()); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationPropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationPropertiesTests.java new file mode 100644 index 000000000000..6ada29f5493a --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationPropertiesTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.fluent.models.ProblemClassificationProperties; +import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class ProblemClassificationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProblemClassificationProperties model = BinaryData.fromString( + "{\"displayName\":\"b\",\"secondaryConsentEnabled\":[{\"description\":\"utduqktapspwgcu\",\"type\":\"tumkdosvqwhbm\"}]}") + .toObject(ProblemClassificationProperties.class); + Assertions.assertEquals("b", model.displayName()); + Assertions.assertEquals("utduqktapspwgcu", model.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("tumkdosvqwhbm", model.secondaryConsentEnabled().get(0).type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProblemClassificationProperties model = new ProblemClassificationProperties().withDisplayName("b") + .withSecondaryConsentEnabled(Arrays + .asList(new SecondaryConsentEnabled().withDescription("utduqktapspwgcu").withType("tumkdosvqwhbm"))); + model = BinaryData.fromObject(model).toObject(ProblemClassificationProperties.class); + Assertions.assertEquals("b", model.displayName()); + Assertions.assertEquals("utduqktapspwgcu", model.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("tumkdosvqwhbm", model.secondaryConsentEnabled().get(0).type()); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationInputTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationInputTests.java deleted file mode 100644 index 141dc8f08276..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationInputTests.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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; -import org.junit.jupiter.api.Assertions; - -public final class ProblemClassificationsClassificationInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProblemClassificationsClassificationInput model - = BinaryData.fromString("{\"issueSummary\":\"idf\",\"resourceId\":\"wdzuhtymwisd\"}") - .toObject(ProblemClassificationsClassificationInput.class); - Assertions.assertEquals("idf", model.issueSummary()); - Assertions.assertEquals("wdzuhtymwisd", model.resourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProblemClassificationsClassificationInput model - = new ProblemClassificationsClassificationInput().withIssueSummary("idf").withResourceId("wdzuhtymwisd"); - model = BinaryData.fromObject(model).toObject(ProblemClassificationsClassificationInput.class); - Assertions.assertEquals("idf", model.issueSummary()); - Assertions.assertEquals("wdzuhtymwisd", model.resourceId()); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationOutputInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationOutputInnerTests.java deleted file mode 100644 index d0e4db3bd5f0..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationOutputInnerTests.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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProblemClassificationsClassificationOutputInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProblemClassificationsClassificationOutputInner model = BinaryData.fromString( - "{\"problemClassificationResults\":[{\"problemId\":\"wxmnteiwao\",\"title\":\"km\",\"description\":\"c\",\"serviceId\":\"xdcu\",\"problemClassificationId\":\"fsrpymzidnse\",\"relatedService\":{\"serviceId\":\"tbzsgfyccs\",\"displayName\":\"wmdwzjeiachboo\",\"resourceTypes\":[\"nrosfqpte\",\"hzzvypyq\"]}},{\"problemId\":\"mzinpvswjdk\",\"title\":\"soodqxhcrmnoh\",\"description\":\"ckwhds\",\"serviceId\":\"fiyipjxsqwpgrj\",\"problemClassificationId\":\"norcjxvsnbyxqab\",\"relatedService\":{\"serviceId\":\"cpc\",\"displayName\":\"hurzafblj\",\"resourceTypes\":[\"btoqcjmkljavbqid\",\"qajzyulpkudjkr\",\"khbzhfepgzg\"]}},{\"problemId\":\"xzlocxscp\",\"title\":\"erhhbcsglumm\",\"description\":\"tjaodxobnb\",\"serviceId\":\"k\",\"problemClassificationId\":\"xo\",\"relatedService\":{\"serviceId\":\"ionpimexg\",\"displayName\":\"xgcp\",\"resourceTypes\":[\"maajrmvdjwzrlo\",\"mcl\"]}},{\"problemId\":\"ijcoejctb\",\"title\":\"qsqsy\",\"description\":\"kbfkg\",\"serviceId\":\"dkexxppofm\",\"problemClassificationId\":\"x\",\"relatedService\":{\"serviceId\":\"pg\",\"displayName\":\"toc\",\"resourceTypes\":[\"hvpmoue\",\"hd\"]}}]}") - .toObject(ProblemClassificationsClassificationOutputInner.class); - Assertions.assertEquals("nrosfqpte", model.problemClassificationResults().get(0).resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProblemClassificationsClassificationOutputInner model - = new ProblemClassificationsClassificationOutputInner().withProblemClassificationResults(Arrays.asList( - new ProblemClassificationsClassificationResult() - .withResourceTypes(Arrays.asList("nrosfqpte", "hzzvypyq")), - new ProblemClassificationsClassificationResult() - .withResourceTypes(Arrays.asList("btoqcjmkljavbqid", "qajzyulpkudjkr", "khbzhfepgzg")), - new ProblemClassificationsClassificationResult() - .withResourceTypes(Arrays.asList("maajrmvdjwzrlo", "mcl")), - new ProblemClassificationsClassificationResult().withResourceTypes(Arrays.asList("hvpmoue", "hd")))); - model = BinaryData.fromObject(model).toObject(ProblemClassificationsClassificationOutputInner.class); - Assertions.assertEquals("nrosfqpte", model.problemClassificationResults().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationResultTests.java deleted file mode 100644 index 8e8b1d2afbd8..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationResultTests.java +++ /dev/null @@ -1,28 +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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProblemClassificationsClassificationResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProblemClassificationsClassificationResult model = BinaryData.fromString( - "{\"problemId\":\"i\",\"title\":\"eojnxqbzvddn\",\"description\":\"ndei\",\"serviceId\":\"twnpzaoqvuhrhcf\",\"problemClassificationId\":\"yd\",\"relatedService\":{\"serviceId\":\"mjthjqkwp\",\"displayName\":\"icxm\",\"resourceTypes\":[\"wqvhkhixuigdt\",\"pbobjo\"]}}") - .toObject(ProblemClassificationsClassificationResult.class); - Assertions.assertEquals("wqvhkhixuigdt", model.resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProblemClassificationsClassificationResult model = new ProblemClassificationsClassificationResult() - .withResourceTypes(Arrays.asList("wqvhkhixuigdt", "pbobjo")); - model = BinaryData.fromObject(model).toObject(ProblemClassificationsClassificationResult.class); - Assertions.assertEquals("wqvhkhixuigdt", model.resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassifyProblemsWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassifyProblemsWithResponseMockTests.java deleted file mode 100644 index b5e9671d95b7..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassifyProblemsWithResponseMockTests.java +++ /dev/null @@ -1,59 +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.support.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.support.SupportManager; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProblemClassificationsClassifyProblemsWithResponseMockTests { - @Test - public void testClassifyProblemsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"problemClassificationResults\":[{\"problemId\":\"efajpj\",\"title\":\"wkqnyhg\",\"description\":\"j\",\"serviceId\":\"ivfxzsjabibsyst\",\"problemClassificationId\":\"fsdjpvkvp\",\"relatedService\":{\"serviceId\":\"bkzbzkd\",\"displayName\":\"cjabudurgkakmo\",\"resourceTypes\":[\"jjklff\",\"mouwqlgzrfzeey\"]}},{\"problemId\":\"izikayuhq\",\"title\":\"jbsybbqw\",\"description\":\"t\",\"serviceId\":\"gmfpgvmp\",\"problemClassificationId\":\"as\",\"relatedService\":{\"serviceId\":\"aqfxss\",\"displayName\":\"u\",\"resourceTypes\":[\"dsrezpdrhneuyow\",\"kdw\"]}},{\"problemId\":\"i\",\"title\":\"bi\",\"description\":\"gpikpzimejza\",\"serviceId\":\"fzxiavrmb\",\"problemClassificationId\":\"nokixrjqcirgz\",\"relatedService\":{\"serviceId\":\"lazszrn\",\"displayName\":\"iin\",\"resourceTypes\":[\"wp\"]}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProblemClassificationsClassificationOutput response = manager.problemClassifications() - .classifyProblemsWithResponse("j", new ProblemClassificationsClassificationInput() - .withIssueSummary("lhkrribdeibqipqk").withResourceId("vxndz"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jjklff", response.problemClassificationResults().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetWithResponseMockTests.java index 4e410260617d..22c260a63961 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetWithResponseMockTests.java @@ -6,54 +6,36 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ProblemClassification; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ProblemClassificationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"id\":\"cr\",\"name\":\"bwccsnjvcdwxlpqe\",\"type\":\"tn\",\"properties\":{\"displayName\":\"jsyingwfqatm\",\"secondaryConsentEnabled\":[{\"description\":\"mdvy\",\"type\":\"ikdgszywkbir\"},{\"description\":\"uzhlhkjoqrv\",\"type\":\"aatjinrvgoupmfi\"}],\"metadata\":{\"x\":\"ggjioolvr\",\"kkgll\":\"v\",\"uhbxvvy\":\"wjygvjayvblmhvk\"},\"parentProblemClassification\":{\"id\":\"opbyrqufegxu\",\"name\":\"zfbn\",\"type\":\"mctlpdngitv\",\"properties\":{\"displayName\":\"hrixkwmy\",\"secondaryConsentEnabled\":[{},{},{},{}],\"metadata\":{\"b\":\"egrhbpnaixexc\"},\"parentProblemClassification\":{\"id\":\"ax\",\"name\":\"exdrrvqahqkg\",\"type\":\"pwijnhy\",\"properties\":{}}}}}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"id\":\"smocmbq\",\"name\":\"vmkcx\",\"type\":\"apvhelxprgly\",\"properties\":{\"displayName\":\"dckcbc\",\"secondaryConsentEnabled\":[{\"description\":\"jxgciqibrh\",\"type\":\"xsdqrhzoymibmrqy\"},{\"description\":\"ahwfluszdtmhrk\",\"type\":\"fyyvoq\"},{\"description\":\"piexpbtgiw\",\"type\":\"oenwashr\"},{\"description\":\"tkcnqxwb\",\"type\":\"kulpiujwaasi\"}]}}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); ProblemClassification response = manager.problemClassifications() - .getWithResponse("yhko", "opgxedkowepb", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("jvp", "jqg", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("jsyingwfqatm", response.displayName()); - Assertions.assertEquals("mdvy", response.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("ikdgszywkbir", response.secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("hrixkwmy", response.parentProblemClassification().displayName()); + Assertions.assertEquals("dckcbc", response.displayName()); + Assertions.assertEquals("jxgciqibrh", response.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("xsdqrhzoymibmrqy", response.secondaryConsentEnabled().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListMockTests.java index f762c04162c1..608193966ce0 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListMockTests.java @@ -6,56 +6,37 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.ProblemClassification; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ProblemClassificationsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"id\":\"vfbgofeljagrqmqh\",\"name\":\"vriiio\",\"type\":\"al\",\"properties\":{\"displayName\":\"kvtvsexso\",\"secondaryConsentEnabled\":[{\"description\":\"uqhhahhxvrh\",\"type\":\"kwpjgwwspughftqs\"}],\"metadata\":{\"digrjguufzdmsyqt\":\"xujxuknd\",\"o\":\"ihwhbotzingamvpp\",\"amvdkfwynwcvtbv\":\"zqzudph\"},\"parentProblemClassification\":{\"id\":\"hmtnvy\",\"name\":\"atkzwpcnpw\",\"type\":\"jaesgvvsccya\",\"properties\":{\"displayName\":\"qfhwyg\",\"secondaryConsentEnabled\":[{},{},{}],\"metadata\":{\"emdwzrmuhapfc\":\"kfxu\"},\"parentProblemClassification\":{\"id\":\"sqxqvp\",\"name\":\"uoymgccelvezry\",\"type\":\"lmfeokerq\",\"properties\":{}}}}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"id\":\"gx\",\"name\":\"rslpmutwuoeg\",\"type\":\"khjwn\",\"properties\":{\"displayName\":\"sluicpdggkzz\",\"secondaryConsentEnabled\":[{\"description\":\"mpaxmodfvuefywsb\",\"type\":\"vmwy\"},{\"description\":\"fouyf\",\"type\":\"akcp\"},{\"description\":\"yzvqt\",\"type\":\"ubex\"},{\"description\":\"zksmondj\",\"type\":\"uxvypomgkopkwh\"}]}}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.problemClassifications().list("ylwbtlhflsjcdhsz", com.azure.core.util.Context.NONE); + = manager.problemClassifications().list("d", com.azure.core.util.Context.NONE); - Assertions.assertEquals("kvtvsexso", response.iterator().next().displayName()); - Assertions.assertEquals("uqhhahhxvrh", + Assertions.assertEquals("sluicpdggkzz", response.iterator().next().displayName()); + Assertions.assertEquals("mpaxmodfvuefywsb", response.iterator().next().secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("kwpjgwwspughftqs", response.iterator().next().secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("qfhwyg", response.iterator().next().parentProblemClassification().displayName()); + Assertions.assertEquals("vmwy", response.iterator().next().secondaryConsentEnabled().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListResultTests.java index b428d373003a..e39a282f36b7 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListResultTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListResultTests.java @@ -15,31 +15,35 @@ public final class ProblemClassificationsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProblemClassificationsListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"w\",\"name\":\"m\",\"type\":\"hrzayvvtpgvdf\",\"properties\":{\"displayName\":\"tkftutqxlngx\",\"secondaryConsentEnabled\":[{\"description\":\"ugnxkrxdqmi\",\"type\":\"thz\"},{\"description\":\"qdrabhjybigehoqf\",\"type\":\"wska\"},{\"description\":\"ktzlcuiywg\",\"type\":\"wgndrvynhzgpp\"},{\"description\":\"cgyncocpecf\",\"type\":\"mcoo\"}],\"metadata\":{\"y\":\"lzevgbmqjqab\",\"wnfnbacf\":\"mivkwlzuvcc\",\"bqqwxrj\":\"onlebxetqgtzxdpn\",\"mpmngnzscxaqwoo\":\"eallnwsubisnj\"},\"parentProblemClassification\":{\"id\":\"bonqvpkvlrxnjeas\",\"name\":\"pheoflokeyy\",\"type\":\"nj\",\"properties\":{\"displayName\":\"wtgrhpdjpj\",\"secondaryConsentEnabled\":[{},{},{},{}],\"metadata\":{\"jj\":\"azjpqyegualhbxxh\",\"ynpwlbj\":\"zvdudgwdslfhotwm\",\"sop\":\"pgacftadehxnlty\"},\"parentProblemClassification\":{}}}}}]}") + "{\"value\":[{\"id\":\"ypininm\",\"name\":\"huyb\",\"type\":\"podepoo\",\"properties\":{\"displayName\":\"uvamiheognarxzxt\",\"secondaryConsentEnabled\":[{\"description\":\"usivye\",\"type\":\"ciqihnhung\"}]}},{\"id\":\"jzrnf\",\"name\":\"xgispemvtzfkufu\",\"type\":\"jofxqe\",\"properties\":{\"displayName\":\"aeqjhqjbasvms\",\"secondaryConsentEnabled\":[{\"description\":\"lngsntnbybkzgcwr\",\"type\":\"lxxwrljdouskc\"},{\"description\":\"kocrcjdkwtnhx\",\"type\":\"jbiksqrglssai\"},{\"description\":\"p\",\"type\":\"nzl\"},{\"description\":\"fmppe\",\"type\":\"vmgxsab\"}]}},{\"id\":\"qduujitcjczdz\",\"name\":\"ndhkrw\",\"type\":\"appd\",\"properties\":{\"displayName\":\"kvwrwjfeu\",\"secondaryConsentEnabled\":[{\"description\":\"tjelt\",\"type\":\"ldhugjzzdatqxh\"},{\"description\":\"dgeablgphu\",\"type\":\"cndvkaozwyiftyhx\"}]}}]}") .toObject(ProblemClassificationsListResult.class); - Assertions.assertEquals("tkftutqxlngx", model.value().get(0).displayName()); - Assertions.assertEquals("ugnxkrxdqmi", model.value().get(0).secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("thz", model.value().get(0).secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("wtgrhpdjpj", model.value().get(0).parentProblemClassification().displayName()); + Assertions.assertEquals("uvamiheognarxzxt", model.value().get(0).displayName()); + Assertions.assertEquals("usivye", model.value().get(0).secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("ciqihnhung", model.value().get(0).secondaryConsentEnabled().get(0).type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ProblemClassificationsListResult model = new ProblemClassificationsListResult() - .withValue(Arrays.asList(new ProblemClassificationInner().withDisplayName("tkftutqxlngx") - .withSecondaryConsentEnabled(Arrays.asList( - new SecondaryConsentEnabled().withDescription("ugnxkrxdqmi").withType("thz"), - new SecondaryConsentEnabled().withDescription("qdrabhjybigehoqf").withType("wska"), - new SecondaryConsentEnabled().withDescription("ktzlcuiywg").withType("wgndrvynhzgpp"), - new SecondaryConsentEnabled().withDescription("cgyncocpecf").withType("mcoo"))) - .withParentProblemClassification(new ProblemClassificationInner().withDisplayName("wtgrhpdjpj") - .withSecondaryConsentEnabled(Arrays.asList(new SecondaryConsentEnabled(), - new SecondaryConsentEnabled(), new SecondaryConsentEnabled(), new SecondaryConsentEnabled())) - .withParentProblemClassification(new ProblemClassificationInner())))); + ProblemClassificationsListResult model + = new ProblemClassificationsListResult() + .withValue(Arrays.asList( + new ProblemClassificationInner().withDisplayName("uvamiheognarxzxt") + .withSecondaryConsentEnabled(Arrays + .asList(new SecondaryConsentEnabled().withDescription("usivye").withType("ciqihnhung"))), + new ProblemClassificationInner().withDisplayName("aeqjhqjbasvms") + .withSecondaryConsentEnabled(Arrays.asList( + new SecondaryConsentEnabled().withDescription("lngsntnbybkzgcwr").withType("lxxwrljdouskc"), + new SecondaryConsentEnabled().withDescription("kocrcjdkwtnhx").withType("jbiksqrglssai"), + new SecondaryConsentEnabled().withDescription("p").withType("nzl"), + new SecondaryConsentEnabled().withDescription("fmppe").withType("vmgxsab"))), + new ProblemClassificationInner().withDisplayName("kvwrwjfeu") + .withSecondaryConsentEnabled(Arrays.asList( + new SecondaryConsentEnabled().withDescription("tjelt").withType("ldhugjzzdatqxh"), + new SecondaryConsentEnabled().withDescription("dgeablgphu") + .withType("cndvkaozwyiftyhx"))))); model = BinaryData.fromObject(model).toObject(ProblemClassificationsListResult.class); - Assertions.assertEquals("tkftutqxlngx", model.value().get(0).displayName()); - Assertions.assertEquals("ugnxkrxdqmi", model.value().get(0).secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("thz", model.value().get(0).secondaryConsentEnabled().get(0).type()); - Assertions.assertEquals("wtgrhpdjpj", model.value().get(0).parentProblemClassification().displayName()); + Assertions.assertEquals("uvamiheognarxzxt", model.value().get(0).displayName()); + Assertions.assertEquals("usivye", model.value().get(0).secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("ciqihnhung", model.value().get(0).secondaryConsentEnabled().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsNoSubscriptionsClassifyProblemsWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsNoSubscriptionsClassifyProblemsWithResponseMockTests.java deleted file mode 100644 index 7abfe385881b..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsNoSubscriptionsClassifyProblemsWithResponseMockTests.java +++ /dev/null @@ -1,59 +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.support.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.support.SupportManager; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; -import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProblemClassificationsNoSubscriptionsClassifyProblemsWithResponseMockTests { - @Test - public void testClassifyProblemsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"problemClassificationResults\":[{\"problemId\":\"rwr\",\"title\":\"rtwaenuuzko\",\"description\":\"minrfdw\",\"serviceId\":\"uhhziuiefozbhdm\",\"problemClassificationId\":\"l\",\"relatedService\":{\"serviceId\":\"hoftr\",\"displayName\":\"equi\",\"resourceTypes\":[\"icslfaoq\",\"piyylhalnswhccsp\"]}},{\"problemId\":\"aivwitqscywu\",\"title\":\"woluhczbwemhair\",\"description\":\"rgzdwmsweyp\",\"serviceId\":\"dxggicccnxqhuexm\",\"problemClassificationId\":\"tlstvlzywem\",\"relatedService\":{\"serviceId\":\"ncsdtclusiyp\",\"displayName\":\"fgytguslfeadcyg\",\"resourceTypes\":[\"yhejhzisxgfp\",\"lolp\",\"vk\"]}},{\"problemId\":\"pqvujzraehtwdwrf\",\"title\":\"wib\",\"description\":\"cdl\",\"serviceId\":\"shfwpracstwity\",\"problemClassificationId\":\"evxccedcp\",\"relatedService\":{\"serviceId\":\"yodnwzxltj\",\"displayName\":\"nhltiugcxn\",\"resourceTypes\":[\"wxqibyq\",\"nyowxwlmdjrkvfg\",\"vfvpdbodaciz\"]}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ProblemClassificationsClassificationOutput response = manager.problemClassificationsNoSubscriptions() - .classifyProblemsWithResponse("akgtdlmkkzevdlh", new ProblemClassificationsClassificationInput() - .withIssueSummary("wpusdsttwvogv").withResourceId("ejdcngqqmoakuf"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("icslfaoq", response.problemClassificationResults().get(0).resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaChangeRequestTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaChangeRequestTests.java index e4ccf16a742b..8b43677ee303 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaChangeRequestTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaChangeRequestTests.java @@ -11,17 +11,17 @@ public final class QuotaChangeRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - QuotaChangeRequest model = BinaryData.fromString("{\"region\":\"nayqi\",\"payload\":\"nduhavhqlkthum\"}") + QuotaChangeRequest model = BinaryData.fromString("{\"region\":\"ldawkzbaliourqha\",\"payload\":\"uhashsfwx\"}") .toObject(QuotaChangeRequest.class); - Assertions.assertEquals("nayqi", model.region()); - Assertions.assertEquals("nduhavhqlkthum", model.payload()); + Assertions.assertEquals("ldawkzbaliourqha", model.region()); + Assertions.assertEquals("uhashsfwx", model.payload()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaChangeRequest model = new QuotaChangeRequest().withRegion("nayqi").withPayload("nduhavhqlkthum"); + QuotaChangeRequest model = new QuotaChangeRequest().withRegion("ldawkzbaliourqha").withPayload("uhashsfwx"); model = BinaryData.fromObject(model).toObject(QuotaChangeRequest.class); - Assertions.assertEquals("nayqi", model.region()); - Assertions.assertEquals("nduhavhqlkthum", model.payload()); + Assertions.assertEquals("ldawkzbaliourqha", model.region()); + Assertions.assertEquals("uhashsfwx", model.payload()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaTicketDetailsTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaTicketDetailsTests.java index f58b20999b86..3c73035ca3bf 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaTicketDetailsTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/QuotaTicketDetailsTests.java @@ -14,26 +14,24 @@ public final class QuotaTicketDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaTicketDetails model = BinaryData.fromString( - "{\"quotaChangeRequestSubType\":\"vasrruvwb\",\"quotaChangeRequestVersion\":\"qfsubcgjbirx\",\"quotaChangeRequests\":[{\"region\":\"srfbjfdtwss\",\"payload\":\"ftpvjzbexil\"},{\"region\":\"nfqqnvwp\",\"payload\":\"taruoujmkcj\"},{\"region\":\"qytjrybnwjewgd\",\"payload\":\"ervnaenqpehi\"},{\"region\":\"oygmift\",\"payload\":\"zdnds\"}]}") + "{\"quotaChangeRequestSubType\":\"exq\",\"quotaChangeRequestVersion\":\"fadmws\",\"quotaChangeRequests\":[{\"region\":\"vxpvgomz\",\"payload\":\"misgwbnb\"}]}") .toObject(QuotaTicketDetails.class); - Assertions.assertEquals("vasrruvwb", model.quotaChangeRequestSubType()); - Assertions.assertEquals("qfsubcgjbirx", model.quotaChangeRequestVersion()); - Assertions.assertEquals("srfbjfdtwss", model.quotaChangeRequests().get(0).region()); - Assertions.assertEquals("ftpvjzbexil", model.quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("exq", model.quotaChangeRequestSubType()); + Assertions.assertEquals("fadmws", model.quotaChangeRequestVersion()); + Assertions.assertEquals("vxpvgomz", model.quotaChangeRequests().get(0).region()); + Assertions.assertEquals("misgwbnb", model.quotaChangeRequests().get(0).payload()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaTicketDetails model = new QuotaTicketDetails().withQuotaChangeRequestSubType("vasrruvwb") - .withQuotaChangeRequestVersion("qfsubcgjbirx").withQuotaChangeRequests( - Arrays.asList(new QuotaChangeRequest().withRegion("srfbjfdtwss").withPayload("ftpvjzbexil"), - new QuotaChangeRequest().withRegion("nfqqnvwp").withPayload("taruoujmkcj"), - new QuotaChangeRequest().withRegion("qytjrybnwjewgd").withPayload("ervnaenqpehi"), - new QuotaChangeRequest().withRegion("oygmift").withPayload("zdnds"))); + QuotaTicketDetails model = new QuotaTicketDetails().withQuotaChangeRequestSubType("exq") + .withQuotaChangeRequestVersion("fadmws") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("vxpvgomz").withPayload("misgwbnb"))); model = BinaryData.fromObject(model).toObject(QuotaTicketDetails.class); - Assertions.assertEquals("vasrruvwb", model.quotaChangeRequestSubType()); - Assertions.assertEquals("qfsubcgjbirx", model.quotaChangeRequestVersion()); - Assertions.assertEquals("srfbjfdtwss", model.quotaChangeRequests().get(0).region()); - Assertions.assertEquals("ftpvjzbexil", model.quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("exq", model.quotaChangeRequestSubType()); + Assertions.assertEquals("fadmws", model.quotaChangeRequestVersion()); + Assertions.assertEquals("vxpvgomz", model.quotaChangeRequests().get(0).region()); + Assertions.assertEquals("misgwbnb", model.quotaChangeRequests().get(0).payload()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentEnabledTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentEnabledTests.java index 8ed6896b32aa..96ef9ad92087 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentEnabledTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentEnabledTests.java @@ -11,18 +11,19 @@ public final class SecondaryConsentEnabledTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecondaryConsentEnabled model = BinaryData.fromString("{\"description\":\"zpwv\",\"type\":\"dqgbiqylihkaetc\"}") - .toObject(SecondaryConsentEnabled.class); - Assertions.assertEquals("zpwv", model.description()); - Assertions.assertEquals("dqgbiqylihkaetc", model.type()); + SecondaryConsentEnabled model + = BinaryData.fromString("{\"description\":\"bbjfddgmbmbexp\",\"type\":\"htqqrolfp\"}") + .toObject(SecondaryConsentEnabled.class); + Assertions.assertEquals("bbjfddgmbmbexp", model.description()); + Assertions.assertEquals("htqqrolfp", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SecondaryConsentEnabled model - = new SecondaryConsentEnabled().withDescription("zpwv").withType("dqgbiqylihkaetc"); + = new SecondaryConsentEnabled().withDescription("bbjfddgmbmbexp").withType("htqqrolfp"); model = BinaryData.fromObject(model).toObject(SecondaryConsentEnabled.class); - Assertions.assertEquals("zpwv", model.description()); - Assertions.assertEquals("dqgbiqylihkaetc", model.type()); + Assertions.assertEquals("bbjfddgmbmbexp", model.description()); + Assertions.assertEquals("htqqrolfp", model.type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentTests.java index a70bb918c7e0..1df2d23da65b 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SecondaryConsentTests.java @@ -12,17 +12,17 @@ public final class SecondaryConsentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SecondaryConsent model = BinaryData.fromString("{\"userConsent\":\"No\",\"type\":\"bgycduiertgccym\"}") - .toObject(SecondaryConsent.class); - Assertions.assertEquals(UserConsent.NO, model.userConsent()); - Assertions.assertEquals("bgycduiertgccym", model.type()); + SecondaryConsent model + = BinaryData.fromString("{\"userConsent\":\"Yes\",\"type\":\"z\"}").toObject(SecondaryConsent.class); + Assertions.assertEquals(UserConsent.YES, model.userConsent()); + Assertions.assertEquals("z", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecondaryConsent model = new SecondaryConsent().withUserConsent(UserConsent.NO).withType("bgycduiertgccym"); + SecondaryConsent model = new SecondaryConsent().withUserConsent(UserConsent.YES).withType("z"); model = BinaryData.fromObject(model).toObject(SecondaryConsent.class); - Assertions.assertEquals(UserConsent.NO, model.userConsent()); - Assertions.assertEquals("bgycduiertgccym", model.type()); + Assertions.assertEquals(UserConsent.YES, model.userConsent()); + Assertions.assertEquals("z", model.type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationAnswerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationAnswerTests.java deleted file mode 100644 index 35ee438983b2..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationAnswerTests.java +++ /dev/null @@ -1,32 +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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ClassificationService; -import com.azure.resourcemanager.support.models.ServiceClassificationAnswer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceClassificationAnswerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceClassificationAnswer model = BinaryData.fromString( - "{\"childService\":{\"serviceId\":\"bhtqqrolfpfpsa\",\"displayName\":\"bquxigjy\",\"resourceTypes\":[\"jaoyfhrtx\",\"lnerkujysvleju\",\"fqawrlyxw\"]},\"serviceId\":\"cpr\",\"displayName\":\"wbxgjvt\",\"resourceTypes\":[\"ysszdnrujqguh\"]}") - .toObject(ServiceClassificationAnswer.class); - Assertions.assertEquals("ysszdnrujqguh", model.resourceTypes().get(0)); - Assertions.assertEquals("jaoyfhrtx", model.childService().resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceClassificationAnswer model = new ServiceClassificationAnswer() - .withResourceTypes(Arrays.asList("ysszdnrujqguh")).withChildService(new ClassificationService() - .withResourceTypes(Arrays.asList("jaoyfhrtx", "lnerkujysvleju", "fqawrlyxw"))); - model = BinaryData.fromObject(model).toObject(ServiceClassificationAnswer.class); - Assertions.assertEquals("ysszdnrujqguh", model.resourceTypes().get(0)); - Assertions.assertEquals("jaoyfhrtx", model.childService().resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationOutputInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationOutputInnerTests.java deleted file mode 100644 index 92d11fbdc70c..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationOutputInnerTests.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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ClassificationService; -import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; -import com.azure.resourcemanager.support.models.ServiceClassificationAnswer; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ServiceClassificationOutputInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceClassificationOutputInner model = BinaryData.fromString( - "{\"serviceClassificationResults\":[{\"childService\":{\"serviceId\":\"syyp\",\"displayName\":\"dhsgcba\",\"resourceTypes\":[\"ejk\",\"tynqgoul\",\"ndlik\"]},\"serviceId\":\"qkgfgibma\",\"displayName\":\"akeqs\",\"resourceTypes\":[\"bzqqedqytbciq\"]},{\"childService\":{\"serviceId\":\"flmmnk\",\"displayName\":\"modmglougpb\",\"resourceTypes\":[\"mutduqktaps\"]},\"serviceId\":\"gcue\",\"displayName\":\"umkdosvqwhbmd\",\"resourceTypes\":[\"jfddgmbmbe\"]}]}") - .toObject(ServiceClassificationOutputInner.class); - Assertions.assertEquals("bzqqedqytbciq", model.serviceClassificationResults().get(0).resourceTypes().get(0)); - Assertions.assertEquals("ejk", - model.serviceClassificationResults().get(0).childService().resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceClassificationOutputInner model - = new ServiceClassificationOutputInner().withServiceClassificationResults(Arrays.asList( - new ServiceClassificationAnswer().withResourceTypes(Arrays.asList("bzqqedqytbciq")).withChildService( - new ClassificationService().withResourceTypes(Arrays.asList("ejk", "tynqgoul", "ndlik"))), - new ServiceClassificationAnswer().withResourceTypes(Arrays.asList("jfddgmbmbe")) - .withChildService(new ClassificationService().withResourceTypes(Arrays.asList("mutduqktaps"))))); - model = BinaryData.fromObject(model).toObject(ServiceClassificationOutputInner.class); - Assertions.assertEquals("bzqqedqytbciq", model.serviceClassificationResults().get(0).resourceTypes().get(0)); - Assertions.assertEquals("ejk", - model.serviceClassificationResults().get(0).childService().resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationRequestTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationRequestTests.java deleted file mode 100644 index a7e9a6c1fea7..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationRequestTests.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.support.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import org.junit.jupiter.api.Assertions; - -public final class ServiceClassificationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServiceClassificationRequest model = BinaryData - .fromString("{\"issueSummary\":\"tyxolniwpwc\",\"resourceId\":\"jfkgiawxk\",\"additionalContext\":\"ypl\"}") - .toObject(ServiceClassificationRequest.class); - Assertions.assertEquals("tyxolniwpwc", model.issueSummary()); - Assertions.assertEquals("jfkgiawxk", model.resourceId()); - Assertions.assertEquals("ypl", model.additionalContext()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServiceClassificationRequest model = new ServiceClassificationRequest().withIssueSummary("tyxolniwpwc") - .withResourceId("jfkgiawxk").withAdditionalContext("ypl"); - model = BinaryData.fromObject(model).toObject(ServiceClassificationRequest.class); - Assertions.assertEquals("tyxolniwpwc", model.issueSummary()); - Assertions.assertEquals("jfkgiawxk", model.resourceId()); - Assertions.assertEquals("ypl", model.additionalContext()); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationsClassifyServicesWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationsClassifyServicesWithResponseMockTests.java deleted file mode 100644 index 7e1256fafcc6..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationsClassifyServicesWithResponseMockTests.java +++ /dev/null @@ -1,61 +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.support.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.support.SupportManager; -import com.azure.resourcemanager.support.models.ServiceClassificationOutput; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServiceClassificationsClassifyServicesWithResponseMockTests { - @Test - public void testClassifyServicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"serviceClassificationResults\":[{\"childService\":{\"serviceId\":\"cckwyfzqwhxxbu\",\"displayName\":\"a\",\"resourceTypes\":[\"eqz\",\"ppriol\",\"or\"]},\"serviceId\":\"lt\",\"displayName\":\"mncwsobqwcsdb\",\"resourceTypes\":[\"cf\",\"ucqdpfuvglsb\",\"jcanvxbvtvudut\"]},{\"childService\":{\"serviceId\":\"rmrlxqtvcof\",\"displayName\":\"f\",\"resourceTypes\":[\"gj\",\"bgdknnqv\",\"aznqntoru\",\"sgsahmkycgr\"]},\"serviceId\":\"wjue\",\"displayName\":\"eburu\",\"resourceTypes\":[\"ovsm\",\"l\",\"wabm\",\"oefki\"]},{\"childService\":{\"serviceId\":\"tpuqujmq\",\"displayName\":\"kfbtndoaongbjc\",\"resourceTypes\":[\"jitcjedftwwaez\",\"ojvdcpzfoqo\",\"i\"]},\"serviceId\":\"bxarzgszufoxci\",\"displayName\":\"p\",\"resourceTypes\":[\"amcio\",\"hkh\"]},{\"childService\":{\"serviceId\":\"khnzbonlw\",\"displayName\":\"oegokdwbwh\",\"resourceTypes\":[\"zcmrvexztvb\"]},\"serviceId\":\"gsfraoyzkoow\",\"displayName\":\"mnguxawqaldsyu\",\"resourceTypes\":[\"merqfobwyznkb\",\"kutwpf\",\"pagmhrskdsnf\",\"sd\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServiceClassificationOutput response = manager.serviceClassifications() - .classifyServicesWithResponse(new ServiceClassificationRequest().withIssueSummary("kjj") - .withResourceId("xrbuukzclew").withAdditionalContext("mlwpazt"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("cf", response.serviceClassificationResults().get(0).resourceTypes().get(0)); - Assertions.assertEquals("eqz", - response.serviceClassificationResults().get(0).childService().resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationsNoSubscriptionsClassifyServicesWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationsNoSubscriptionsClassifyServicesWithResponseMockTests.java deleted file mode 100644 index dbf3010797fc..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationsNoSubscriptionsClassifyServicesWithResponseMockTests.java +++ /dev/null @@ -1,61 +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.support.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.support.SupportManager; -import com.azure.resourcemanager.support.models.ServiceClassificationOutput; -import com.azure.resourcemanager.support.models.ServiceClassificationRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServiceClassificationsNoSubscriptionsClassifyServicesWithResponseMockTests { - @Test - public void testClassifyServicesWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"serviceClassificationResults\":[{\"childService\":{\"serviceId\":\"co\",\"displayName\":\"hp\",\"resourceTypes\":[\"gymare\",\"n\",\"jxqugjhky\",\"ubeddg\"]},\"serviceId\":\"ofwq\",\"displayName\":\"qal\",\"resourceTypes\":[\"njijpxacqqudf\",\"byxbaaabjy\",\"ayffim\",\"zrtuzq\"]},{\"childService\":{\"serviceId\":\"exn\",\"displayName\":\"fdnw\",\"resourceTypes\":[\"ewzsyyceuzsoib\",\"ud\"]},\"serviceId\":\"rx\",\"displayName\":\"thzvaytdwkqbrqu\",\"resourceTypes\":[\"xhexiilivpdti\",\"r\",\"tdqoaxoruzfgsq\"]},{\"childService\":{\"serviceId\":\"xrxxlep\",\"displayName\":\"amxjezwlw\",\"resourceTypes\":[\"uqlcvydy\",\"atdooaojkniod\",\"oo\"]},\"serviceId\":\"wnujhemmsbvdk\",\"displayName\":\"odtji\",\"resourceTypes\":[\"jlfltkacjvefkdlf\"]},{\"childService\":{\"serviceId\":\"ggkfpagaowpul\",\"displayName\":\"blylsyxkqjnsj\",\"resourceTypes\":[\"tiagx\"]},\"serviceId\":\"sz\",\"displayName\":\"mpsbzkfzbeyv\",\"resourceTypes\":[\"icvi\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServiceClassificationOutput response = manager.serviceClassificationsNoSubscriptions() - .classifyServicesWithResponse(new ServiceClassificationRequest().withIssueSummary("qidbqfatpxllrxcy") - .withResourceId("oadsuvar").withAdditionalContext("wdmjsjqbjhhyx"), com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("njijpxacqqudf", response.serviceClassificationResults().get(0).resourceTypes().get(0)); - Assertions.assertEquals("gymare", - response.serviceClassificationResults().get(0).childService().resourceTypes().get(0)); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceInnerTests.java index c4be77dcf310..af10e6b7d4d2 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceInnerTests.java @@ -13,18 +13,18 @@ public final class ServiceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceInner model = BinaryData.fromString( - "{\"id\":\"xqeofjaeqjhqjba\",\"name\":\"msmjqulngsntn\",\"type\":\"bkzgcwrwclx\",\"properties\":{\"displayName\":\"ljdousk\",\"resourceTypes\":[\"kocrcjdkwtnhx\",\"njbiksqrglssain\",\"p\"],\"metadata\":{\"xsabkyqdu\":\"zlljfmppeebvm\"}}}") + "{\"id\":\"ctazakljlahbcryf\",\"name\":\"fdosyg\",\"type\":\"paojakhmsbzjh\",\"properties\":{\"displayName\":\"evdphlxaol\",\"resourceTypes\":[\"trg\",\"jbp\",\"zfsinzgvf\",\"jrwzox\"]}}") .toObject(ServiceInner.class); - Assertions.assertEquals("ljdousk", model.displayName()); - Assertions.assertEquals("kocrcjdkwtnhx", model.resourceTypes().get(0)); + Assertions.assertEquals("evdphlxaol", model.displayName()); + Assertions.assertEquals("trg", model.resourceTypes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceInner model = new ServiceInner().withDisplayName("ljdousk") - .withResourceTypes(Arrays.asList("kocrcjdkwtnhx", "njbiksqrglssain", "p")); + ServiceInner model = new ServiceInner().withDisplayName("evdphlxaol") + .withResourceTypes(Arrays.asList("trg", "jbp", "zfsinzgvf", "jrwzox")); model = BinaryData.fromObject(model).toObject(ServiceInner.class); - Assertions.assertEquals("ljdousk", model.displayName()); - Assertions.assertEquals("kocrcjdkwtnhx", model.resourceTypes().get(0)); + Assertions.assertEquals("evdphlxaol", model.displayName()); + Assertions.assertEquals("trg", model.resourceTypes().get(0)); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceLevelAgreementTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceLevelAgreementTests.java index c90e528b3b1b..cc0cbf764991 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceLevelAgreementTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceLevelAgreementTests.java @@ -11,7 +11,7 @@ public final class ServiceLevelAgreementTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceLevelAgreement model = BinaryData.fromString( - "{\"startTime\":\"2021-04-28T11:36:58Z\",\"expirationTime\":\"2021-08-04T10:31:47Z\",\"slaMinutes\":1139203375}") + "{\"startTime\":\"2021-03-01T08:49:54Z\",\"expirationTime\":\"2020-12-25T09:40:11Z\",\"slaMinutes\":1243858380}") .toObject(ServiceLevelAgreement.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicePropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicePropertiesTests.java index 78afdeadb243..917ed9211faf 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicePropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicePropertiesTests.java @@ -12,19 +12,19 @@ public final class ServicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ServiceProperties model = BinaryData.fromString( - "{\"displayName\":\"itcjczdz\",\"resourceTypes\":[\"dhkrwpdappdsbdk\",\"wrwjfeu\"],\"metadata\":{\"zdatqxhocdg\":\"utjeltmrldhugj\",\"ozwyiftyhxhuro\":\"ablgphuticndvk\"}}") - .toObject(ServiceProperties.class); - Assertions.assertEquals("itcjczdz", model.displayName()); - Assertions.assertEquals("dhkrwpdappdsbdk", model.resourceTypes().get(0)); + ServiceProperties model + = BinaryData.fromString("{\"displayName\":\"tfell\",\"resourceTypes\":[\"zitonpeqfpjkjl\",\"ofpdvh\"]}") + .toObject(ServiceProperties.class); + Assertions.assertEquals("tfell", model.displayName()); + Assertions.assertEquals("zitonpeqfpjkjl", model.resourceTypes().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ServiceProperties model = new ServiceProperties().withDisplayName("itcjczdz") - .withResourceTypes(Arrays.asList("dhkrwpdappdsbdk", "wrwjfeu")); + ServiceProperties model = new ServiceProperties().withDisplayName("tfell") + .withResourceTypes(Arrays.asList("zitonpeqfpjkjl", "ofpdvh")); model = BinaryData.fromObject(model).toObject(ServiceProperties.class); - Assertions.assertEquals("itcjczdz", model.displayName()); - Assertions.assertEquals("dhkrwpdappdsbdk", model.resourceTypes().get(0)); + Assertions.assertEquals("tfell", model.displayName()); + Assertions.assertEquals("zitonpeqfpjkjl", model.resourceTypes().get(0)); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesGetWithResponseMockTests.java index edc26640f3ad..1fcac5942b5d 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesGetWithResponseMockTests.java @@ -6,51 +6,33 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Service; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ServicesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"id\":\"foqreyfkzik\",\"name\":\"aw\",\"type\":\"a\",\"properties\":{\"displayName\":\"wczelpci\",\"resourceTypes\":[\"sfeaenwabfat\",\"lddxbjhwua\",\"nozj\",\"sphyoulpjrvxa\"],\"metadata\":{\"tx\":\"vimjwos\",\"fcktqumiekke\":\"tcs\",\"fjhdg\":\"zikhl\",\"dunyg\":\"gge\"}}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"id\":\"wdmhdlxyjrxs\",\"name\":\"afcnih\",\"type\":\"qapnedgfbcv\",\"properties\":{\"displayName\":\"q\",\"resourceTypes\":[\"eqdcv\",\"rhvoods\",\"tbobz\",\"opcjwvnhd\"]}}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - Service response = manager.services().getWithResponse("fjxwmsz", com.azure.core.util.Context.NONE).getValue(); + Service response = manager.services().getWithResponse("pnppfuf", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("wczelpci", response.displayName()); - Assertions.assertEquals("sfeaenwabfat", response.resourceTypes().get(0)); + Assertions.assertEquals("q", response.displayName()); + Assertions.assertEquals("eqdcv", response.resourceTypes().get(0)); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListMockTests.java index b0999dba0c50..e145749ec341 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListMockTests.java @@ -6,52 +6,34 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.Service; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class ServicesListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"id\":\"rkvcikhnvpa\",\"name\":\"gxqquezik\",\"type\":\"ggxkallatmelwuip\",\"properties\":{\"displayName\":\"jzkzi\",\"resourceTypes\":[\"vc\",\"ayrhyrnx\"],\"metadata\":{\"ealmfmtdaaygdvwv\":\"eedndrdvstkwqqtc\",\"xepxgyqagvrvmn\":\"piohgwxrtfu\",\"kghimdblxgwimfnj\":\"k\"}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"id\":\"glkfg\",\"name\":\"dneu\",\"type\":\"fphsdyhtozfikdow\",\"properties\":{\"displayName\":\"uvxzxclvi\",\"resourceTypes\":[\"qzonosggbhcohf\",\"dsjnka\",\"jutiiswacff\",\"dkzzewkfvhqcrail\"]}}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.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("jzkzi", response.iterator().next().displayName()); - Assertions.assertEquals("vc", response.iterator().next().resourceTypes().get(0)); + Assertions.assertEquals("uvxzxclvi", response.iterator().next().displayName()); + Assertions.assertEquals("qzonosggbhcohf", response.iterator().next().resourceTypes().get(0)); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListResultTests.java index fe2b69475460..9bc84f26e8b3 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListResultTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServicesListResultTests.java @@ -14,7 +14,7 @@ public final class ServicesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServicesListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"m\",\"name\":\"fp\",\"type\":\"qobmtukk\",\"properties\":{\"displayName\":\"rtihfxtijbpz\",\"resourceTypes\":[\"wzsymglzufcy\",\"kohdbiha\"],\"metadata\":{\"ithxqhabifpi\":\"hfcbjysa\",\"x\":\"xwczbyscnp\"}}},{\"id\":\"ivyqniwbybrkxvd\",\"name\":\"jgrtfwvukxga\",\"type\":\"ccsnhsjc\",\"properties\":{\"displayName\":\"j\",\"resourceTypes\":[\"yhtnapczwlokjye\",\"kkvnipjox\",\"jnchgej\",\"podmailzydehojwy\"],\"metadata\":{\"ixjsprozvcputeg\":\"xinpmqnjaq\",\"atscmd\":\"vwmf\",\"zkrwfn\":\"pjhulsuuvmkj\"}}},{\"id\":\"odjpslwejd\",\"name\":\"wryoqpsoacc\",\"type\":\"zakljlahbc\",\"properties\":{\"displayName\":\"fdfdosygexpa\",\"resourceTypes\":[\"khmsbz\",\"hcrzevd\",\"hlxaolthqtr\"],\"metadata\":{\"fsinzgvfcjrwzoxx\":\"bpf\"}}},{\"id\":\"felluwfzitonpe\",\"name\":\"pjkjlxofpdv\",\"type\":\"fxxypininmayhuy\",\"properties\":{\"displayName\":\"podepoo\",\"resourceTypes\":[\"uvamiheognarxzxt\",\"eotusivyevc\",\"iqihn\"],\"metadata\":{\"gxg\":\"gbwjzrnf\",\"fublj\":\"spemvtzfk\"}}}]}") + "{\"value\":[{\"id\":\"m\",\"name\":\"fp\",\"type\":\"qobmtukk\",\"properties\":{\"displayName\":\"rtihfxtijbpz\",\"resourceTypes\":[\"wzsymglzufcy\",\"kohdbiha\"]}},{\"id\":\"fhfcb\",\"name\":\"s\",\"type\":\"ithxqhabifpi\",\"properties\":{\"displayName\":\"czbysc\",\"resourceTypes\":[\"x\"]}},{\"id\":\"ivyqniwbybrkxvd\",\"name\":\"jgrtfwvukxga\",\"type\":\"ccsnhsjc\",\"properties\":{\"displayName\":\"j\",\"resourceTypes\":[\"yhtnapczwlokjye\",\"kkvnipjox\",\"jnchgej\",\"podmailzydehojwy\"]}},{\"id\":\"uxinpmqnjaq\",\"name\":\"xj\",\"type\":\"r\",\"properties\":{\"displayName\":\"cputegjvwmfdats\",\"resourceTypes\":[\"vpjhulsuuv\",\"kjozkrwfnd\",\"odjpslwejd\",\"vwryoqpso\"]}}]}") .toObject(ServicesListResult.class); Assertions.assertEquals("rtihfxtijbpz", model.value().get(0).displayName()); Assertions.assertEquals("wzsymglzufcy", model.value().get(0).resourceTypes().get(0)); @@ -25,12 +25,11 @@ public void testSerialize() throws Exception { ServicesListResult model = new ServicesListResult().withValue(Arrays.asList( new ServiceInner().withDisplayName("rtihfxtijbpz") .withResourceTypes(Arrays.asList("wzsymglzufcy", "kohdbiha")), + new ServiceInner().withDisplayName("czbysc").withResourceTypes(Arrays.asList("x")), new ServiceInner().withDisplayName("j") .withResourceTypes(Arrays.asList("yhtnapczwlokjye", "kkvnipjox", "jnchgej", "podmailzydehojwy")), - new ServiceInner().withDisplayName("fdfdosygexpa") - .withResourceTypes(Arrays.asList("khmsbz", "hcrzevd", "hlxaolthqtr")), - new ServiceInner().withDisplayName("podepoo") - .withResourceTypes(Arrays.asList("uvamiheognarxzxt", "eotusivyevc", "iqihn")))); + new ServiceInner().withDisplayName("cputegjvwmfdats") + .withResourceTypes(Arrays.asList("vpjhulsuuv", "kjozkrwfnd", "odjpslwejd", "vwryoqpso")))); model = BinaryData.fromObject(model).toObject(ServicesListResult.class); Assertions.assertEquals("rtihfxtijbpz", model.value().get(0).displayName()); Assertions.assertEquals("wzsymglzufcy", model.value().get(0).resourceTypes().get(0)); diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportEngineerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportEngineerTests.java index 34d82e2131c5..a536b256569d 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportEngineerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportEngineerTests.java @@ -10,7 +10,8 @@ public final class SupportEngineerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SupportEngineer model = BinaryData.fromString("{\"emailAddress\":\"nsvs\"}").toObject(SupportEngineer.class); + SupportEngineer model + = BinaryData.fromString("{\"emailAddress\":\"mqkrhahvljuahaqu\"}").toObject(SupportEngineer.class); } @org.junit.jupiter.api.Test diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsInnerTests.java index 337e6fc28bda..bb7e1e6ec921 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsInnerTests.java @@ -25,91 +25,102 @@ public final class SupportTicketDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportTicketDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"supportTicketId\":\"zhlrqjb\",\"description\":\"ck\",\"problemClassificationId\":\"rlhrxs\",\"problemClassificationDisplayName\":\"yvpycanuzbpzk\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"uwbc\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"hhseyv\",\"supportPlanId\":\"srtslhspkdeem\",\"contactDetails\":{\"firstName\":\"ofmxagkvtmelmqkr\",\"lastName\":\"ahvljuaha\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"hcdhmdual\",\"additionalEmailAddresses\":[\"qpv\",\"adm\",\"sr\"],\"phoneNumber\":\"gvxp\",\"preferredTimeZone\":\"gomz\",\"country\":\"fmisg\",\"preferredSupportLanguage\":\"bnbbeldawkz\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-02-02T16:45:23Z\",\"expirationTime\":\"2021-10-15T08:45:58Z\",\"slaMinutes\":952194839},\"supportEngineer\":{\"emailAddress\":\"kauhashsfwxo\"},\"supportPlanType\":\"w\",\"supportPlanDisplayName\":\"cugicjoox\",\"title\":\"j\",\"problemStartTime\":\"2021-05-23T22:50:57Z\",\"serviceId\":\"pucwwfvovbvme\",\"serviceDisplayName\":\"civyhzceuo\",\"status\":\"jrwjueiotwm\",\"createdDate\":\"2021-01-06T11:18:17Z\",\"modifiedDate\":\"2021-05-06T08:04:17Z\",\"fileWorkspaceName\":\"wit\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"wgqwgxhn\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"x\",\"quotaChangeRequestVersion\":\"kpycgklwndnhjd\",\"quotaChangeRequests\":[{\"region\":\"vylwzbtdhxuj\",\"payload\":\"bm\"},{\"region\":\"wuwprzqlv\",\"payload\":\"alupjm\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"bcswsrt\"},{\"userConsent\":\"No\",\"type\":\"lrbpbewtghfgbl\"},{\"userConsent\":\"No\",\"type\":\"zvlvqhjkbegib\"}]},\"id\":\"nmxiebwwaloayqc\",\"name\":\"wrtz\",\"type\":\"uzgwyzmhtx\"}") + "{\"properties\":{\"supportTicketId\":\"hwankixzbinjepu\",\"description\":\"tmryw\",\"problemClassificationId\":\"uzoqft\",\"problemClassificationDisplayName\":\"qzrnkcqvyxlwhz\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"cohoq\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"ryavwhheunmmqh\",\"supportPlanId\":\"xzko\",\"contactDetails\":{\"firstName\":\"ocukoklyax\",\"lastName\":\"conuqszfkbeype\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"mjmwvvjektcx\",\"additionalEmailAddresses\":[\"hwlrsf\",\"rzpwvlqdqgbiq\",\"lihkaetcktvfc\",\"vf\"],\"phoneNumber\":\"kymuctqhjfbebr\",\"preferredTimeZone\":\"cxerf\",\"country\":\"wutttxfvjrbi\",\"preferredSupportLanguage\":\"phxepcyvahf\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-05-16T05:23:49Z\",\"expirationTime\":\"2021-01-31T22:23:26Z\",\"slaMinutes\":197436298},\"supportEngineer\":{\"emailAddress\":\"ujqgidok\"},\"supportPlanType\":\"ljyoxgvcltb\",\"supportPlanDisplayName\":\"ncghkje\",\"title\":\"zz\",\"problemStartTime\":\"2021-12-06T11:52:19Z\",\"serviceId\":\"jhtxfvgxbfsmxne\",\"serviceDisplayName\":\"pvecxgodeb\",\"status\":\"kk\",\"createdDate\":\"2021-10-28T16:20:15Z\",\"modifiedDate\":\"2021-01-02T22:48:09Z\",\"fileWorkspaceName\":\"gr\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"lfbxzpuzycisp\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"ahmgkbrp\",\"quotaChangeRequestVersion\":\"dhibnuq\",\"quotaChangeRequests\":[{\"region\":\"kadrgvt\",\"payload\":\"gnbuy\"},{\"region\":\"ijggmebfsiar\",\"payload\":\"trcvpnazzmh\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"xttd\"},{\"userConsent\":\"No\",\"type\":\"nlankxmyskpb\"}]},\"id\":\"enbtkcxywny\",\"name\":\"nrs\",\"type\":\"nlqidybyxczf\"}") .toObject(SupportTicketDetailsInner.class); - Assertions.assertEquals("zhlrqjb", model.supportTicketId()); - Assertions.assertEquals("ck", model.description()); - Assertions.assertEquals("rlhrxs", model.problemClassificationId()); + Assertions.assertEquals("hwankixzbinjepu", model.supportTicketId()); + Assertions.assertEquals("tmryw", model.description()); + Assertions.assertEquals("uzoqft", model.problemClassificationId()); Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); - Assertions.assertEquals("uwbc", model.enrollmentId()); + Assertions.assertEquals("cohoq", model.enrollmentId()); Assertions.assertEquals(false, model.require24X7Response()); Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); - Assertions.assertEquals("hhseyv", model.problemScopingQuestions()); - Assertions.assertEquals("srtslhspkdeem", model.supportPlanId()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.contactDetails().firstName()); - Assertions.assertEquals("ahvljuaha", model.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); - Assertions.assertEquals("hcdhmdual", model.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("qpv", model.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("gvxp", model.contactDetails().phoneNumber()); - Assertions.assertEquals("gomz", model.contactDetails().preferredTimeZone()); - Assertions.assertEquals("fmisg", model.contactDetails().country()); - Assertions.assertEquals("bnbbeldawkz", model.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("j", model.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T22:50:57Z"), model.problemStartTime()); - Assertions.assertEquals("pucwwfvovbvme", model.serviceId()); - Assertions.assertEquals("wit", model.fileWorkspaceName()); - Assertions.assertEquals("wgqwgxhn", model.technicalTicketDetails().resourceId()); - Assertions.assertEquals("x", model.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("kpycgklwndnhjd", model.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("vylwzbtdhxuj", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("bm", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); - Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("bcswsrt", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("ryavwhheunmmqh", model.problemScopingQuestions()); + Assertions.assertEquals("xzko", model.supportPlanId()); + Assertions.assertEquals("ocukoklyax", model.contactDetails().firstName()); + Assertions.assertEquals("conuqszfkbeype", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("mjmwvvjektcx", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("hwlrsf", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("kymuctqhjfbebr", model.contactDetails().phoneNumber()); + Assertions.assertEquals("cxerf", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("wutttxfvjrbi", model.contactDetails().country()); + Assertions.assertEquals("phxepcyvahf", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("zz", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-06T11:52:19Z"), model.problemStartTime()); + Assertions.assertEquals("jhtxfvgxbfsmxne", model.serviceId()); + Assertions.assertEquals("gr", model.fileWorkspaceName()); + Assertions.assertEquals("lfbxzpuzycisp", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("ahmgkbrp", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("dhibnuq", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("kadrgvt", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("gnbuy", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("xttd", model.secondaryConsent().get(0).type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SupportTicketDetailsInner model = new SupportTicketDetailsInner().withSupportTicketId("zhlrqjb") - .withDescription("ck").withProblemClassificationId("rlhrxs") - .withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT).withEnrollmentId("uwbc").withRequire24X7Response(false) - .withAdvancedDiagnosticConsent(Consent.NO).withProblemScopingQuestions("hhseyv") - .withSupportPlanId("srtslhspkdeem") - .withContactDetails(new ContactProfile().withFirstName("ofmxagkvtmelmqkr").withLastName("ahvljuaha") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("hcdhmdual") - .withAdditionalEmailAddresses(Arrays.asList("qpv", "adm", "sr")).withPhoneNumber("gvxp") - .withPreferredTimeZone("gomz").withCountry("fmisg").withPreferredSupportLanguage("bnbbeldawkz")) - .withServiceLevelAgreement(new ServiceLevelAgreement()).withSupportEngineer(new SupportEngineer()) - .withTitle("j").withProblemStartTime(OffsetDateTime.parse("2021-05-23T22:50:57Z")) - .withServiceId("pucwwfvovbvme").withFileWorkspaceName("wit") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("wgqwgxhn")) - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("x") - .withQuotaChangeRequestVersion("kpycgklwndnhjd").withQuotaChangeRequests( - Arrays.asList(new QuotaChangeRequest().withRegion("vylwzbtdhxuj").withPayload("bm"), - new QuotaChangeRequest().withRegion("wuwprzqlv").withPayload("alupjm")))) - .withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("bcswsrt"), - new SecondaryConsent().withUserConsent(UserConsent.NO).withType("lrbpbewtghfgbl"), - new SecondaryConsent().withUserConsent(UserConsent.NO).withType("zvlvqhjkbegib"))); + SupportTicketDetailsInner model = new SupportTicketDetailsInner().withSupportTicketId("hwankixzbinjepu") + .withDescription("tmryw") + .withProblemClassificationId("uzoqft") + .withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withEnrollmentId("cohoq") + .withRequire24X7Response(false) + .withAdvancedDiagnosticConsent(Consent.NO) + .withProblemScopingQuestions("ryavwhheunmmqh") + .withSupportPlanId("xzko") + .withContactDetails(new ContactProfile().withFirstName("ocukoklyax") + .withLastName("conuqszfkbeype") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("mjmwvvjektcx") + .withAdditionalEmailAddresses(Arrays.asList("hwlrsf", "rzpwvlqdqgbiq", "lihkaetcktvfc", "vf")) + .withPhoneNumber("kymuctqhjfbebr") + .withPreferredTimeZone("cxerf") + .withCountry("wutttxfvjrbi") + .withPreferredSupportLanguage("phxepcyvahf")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("zz") + .withProblemStartTime(OffsetDateTime.parse("2021-12-06T11:52:19Z")) + .withServiceId("jhtxfvgxbfsmxne") + .withFileWorkspaceName("gr") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("lfbxzpuzycisp")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("ahmgkbrp") + .withQuotaChangeRequestVersion("dhibnuq") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("kadrgvt").withPayload("gnbuy"), + new QuotaChangeRequest().withRegion("ijggmebfsiar").withPayload("trcvpnazzmh")))) + .withSecondaryConsent(Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("xttd"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("nlankxmyskpb"))); model = BinaryData.fromObject(model).toObject(SupportTicketDetailsInner.class); - Assertions.assertEquals("zhlrqjb", model.supportTicketId()); - Assertions.assertEquals("ck", model.description()); - Assertions.assertEquals("rlhrxs", model.problemClassificationId()); + Assertions.assertEquals("hwankixzbinjepu", model.supportTicketId()); + Assertions.assertEquals("tmryw", model.description()); + Assertions.assertEquals("uzoqft", model.problemClassificationId()); Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); - Assertions.assertEquals("uwbc", model.enrollmentId()); + Assertions.assertEquals("cohoq", model.enrollmentId()); Assertions.assertEquals(false, model.require24X7Response()); Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); - Assertions.assertEquals("hhseyv", model.problemScopingQuestions()); - Assertions.assertEquals("srtslhspkdeem", model.supportPlanId()); - Assertions.assertEquals("ofmxagkvtmelmqkr", model.contactDetails().firstName()); - Assertions.assertEquals("ahvljuaha", model.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); - Assertions.assertEquals("hcdhmdual", model.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("qpv", model.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("gvxp", model.contactDetails().phoneNumber()); - Assertions.assertEquals("gomz", model.contactDetails().preferredTimeZone()); - Assertions.assertEquals("fmisg", model.contactDetails().country()); - Assertions.assertEquals("bnbbeldawkz", model.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("j", model.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-23T22:50:57Z"), model.problemStartTime()); - Assertions.assertEquals("pucwwfvovbvme", model.serviceId()); - Assertions.assertEquals("wit", model.fileWorkspaceName()); - Assertions.assertEquals("wgqwgxhn", model.technicalTicketDetails().resourceId()); - Assertions.assertEquals("x", model.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("kpycgklwndnhjd", model.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("vylwzbtdhxuj", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("bm", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); - Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("bcswsrt", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("ryavwhheunmmqh", model.problemScopingQuestions()); + Assertions.assertEquals("xzko", model.supportPlanId()); + Assertions.assertEquals("ocukoklyax", model.contactDetails().firstName()); + Assertions.assertEquals("conuqszfkbeype", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("mjmwvvjektcx", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("hwlrsf", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("kymuctqhjfbebr", model.contactDetails().phoneNumber()); + Assertions.assertEquals("cxerf", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("wutttxfvjrbi", model.contactDetails().country()); + Assertions.assertEquals("phxepcyvahf", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("zz", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-06T11:52:19Z"), model.problemStartTime()); + Assertions.assertEquals("jhtxfvgxbfsmxne", model.serviceId()); + Assertions.assertEquals("gr", model.fileWorkspaceName()); + Assertions.assertEquals("lfbxzpuzycisp", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("ahmgkbrp", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("dhibnuq", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("kadrgvt", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("gnbuy", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("xttd", model.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsPropertiesTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsPropertiesTests.java index 1cb9e3211271..f4f578ea6685 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsPropertiesTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketDetailsPropertiesTests.java @@ -25,93 +25,106 @@ public final class SupportTicketDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportTicketDetailsProperties model = BinaryData.fromString( - "{\"supportTicketId\":\"gmtsavjcbpwxqpsr\",\"description\":\"nftguvriuhpr\",\"problemClassificationId\":\"mdyvxqtayriw\",\"problemClassificationDisplayName\":\"oyq\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"rmcqiby\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"nmefqsgzvahapj\",\"supportPlanId\":\"hpvgqz\",\"contactDetails\":{\"firstName\":\"j\",\"lastName\":\"vxdjzlmwlxkvugf\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"ovawjvzunlu\",\"additionalEmailAddresses\":[\"n\",\"rnxipei\"],\"phoneNumber\":\"jzuaejxdultskzbb\",\"preferredTimeZone\":\"dzumveekg\",\"country\":\"wozuhkf\",\"preferredSupportLanguage\":\"bsjyofdx\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-06-15T07:35:54Z\",\"expirationTime\":\"2021-01-22T23:23:23Z\",\"slaMinutes\":1422945070},\"supportEngineer\":{\"emailAddress\":\"aboekqv\"},\"supportPlanType\":\"lns\",\"supportPlanDisplayName\":\"bxwyjsflhhcaa\",\"title\":\"n\",\"problemStartTime\":\"2021-03-25T19:19:56Z\",\"serviceId\":\"isxyawjoyaqcslyj\",\"serviceDisplayName\":\"iidzyexzne\",\"status\":\"xhnrztfolhb\",\"createdDate\":\"2021-09-08T07:53:31Z\",\"modifiedDate\":\"2021-06-25T15:29:39Z\",\"fileWorkspaceName\":\"aulppggd\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"nyiropuhpi\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"gylgqgitxmedjvcs\",\"quotaChangeRequestVersion\":\"n\",\"quotaChangeRequests\":[{\"region\":\"cwzzhxgktr\",\"payload\":\"ucnapkteoellwp\"},{\"region\":\"d\",\"payload\":\"pfqbuaceopzf\"},{\"region\":\"hhuao\",\"payload\":\"pcqeqx\"},{\"region\":\"z\",\"payload\":\"hzxct\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"moizpos\"},{\"userConsent\":\"Yes\",\"type\":\"cfbu\"},{\"userConsent\":\"No\",\"type\":\"qjhhkxbpv\"}]}") + "{\"supportTicketId\":\"haaxdbabphl\",\"description\":\"rqlfktsthsucocmn\",\"problemClassificationId\":\"yazttbtwwrqpue\",\"problemClassificationDisplayName\":\"kzywbiex\",\"severity\":\"minimal\",\"enrollmentId\":\"yueaxibxujwb\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"muzyoxaepdk\",\"supportPlanId\":\"ancuxrhd\",\"contactDetails\":{\"firstName\":\"bavxbniwdjswzt\",\"lastName\":\"dbpgnxytxhp\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"bzpfzab\",\"additionalEmailAddresses\":[\"uhxwtctyqiklbbov\"],\"phoneNumber\":\"wzbhvgyugu\",\"preferredTimeZone\":\"svmkfssxquk\",\"country\":\"fpl\",\"preferredSupportLanguage\":\"mg\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-09-17T03:45:09Z\",\"expirationTime\":\"2021-10-15T20:07:23Z\",\"slaMinutes\":1195842617},\"supportEngineer\":{\"emailAddress\":\"lpvlopw\"},\"supportPlanType\":\"ighxpk\",\"supportPlanDisplayName\":\"zb\",\"title\":\"iuebbaumny\",\"problemStartTime\":\"2021-02-11T09:41:28Z\",\"serviceId\":\"edeojnabc\",\"serviceDisplayName\":\"smtxpsieb\",\"status\":\"hvpesapskrdqm\",\"createdDate\":\"2021-01-31T10:46:35Z\",\"modifiedDate\":\"2021-06-12T00:35:29Z\",\"fileWorkspaceName\":\"ldwkyzxuutkn\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"svlxotogtwrup\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"vnm\",\"quotaChangeRequestVersion\":\"ykvceoveil\",\"quotaChangeRequests\":[{\"region\":\"tyfjfcnjbkcnxdhb\",\"payload\":\"kphywpnvjto\"},{\"region\":\"ermclfplphoxuscr\",\"payload\":\"bgyepsbj\"},{\"region\":\"zq\",\"payload\":\"xywpmueefjzwfqkq\"},{\"region\":\"ids\",\"payload\":\"onobglaocqx\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"udxytlmoyrx\"},{\"userConsent\":\"Yes\",\"type\":\"dw\"}]}") .toObject(SupportTicketDetailsProperties.class); - Assertions.assertEquals("gmtsavjcbpwxqpsr", model.supportTicketId()); - Assertions.assertEquals("nftguvriuhpr", model.description()); - Assertions.assertEquals("mdyvxqtayriw", model.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); - Assertions.assertEquals("rmcqiby", model.enrollmentId()); - Assertions.assertEquals(true, model.require24X7Response()); - Assertions.assertEquals(Consent.YES, model.advancedDiagnosticConsent()); - Assertions.assertEquals("nmefqsgzvahapj", model.problemScopingQuestions()); - Assertions.assertEquals("hpvgqz", model.supportPlanId()); - Assertions.assertEquals("j", model.contactDetails().firstName()); - Assertions.assertEquals("vxdjzlmwlxkvugf", model.contactDetails().lastName()); + Assertions.assertEquals("haaxdbabphl", model.supportTicketId()); + Assertions.assertEquals("rqlfktsthsucocmn", model.description()); + Assertions.assertEquals("yazttbtwwrqpue", model.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MINIMAL, model.severity()); + Assertions.assertEquals("yueaxibxujwb", model.enrollmentId()); + Assertions.assertEquals(false, model.require24X7Response()); + Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); + Assertions.assertEquals("muzyoxaepdk", model.problemScopingQuestions()); + Assertions.assertEquals("ancuxrhd", model.supportPlanId()); + Assertions.assertEquals("bavxbniwdjswzt", model.contactDetails().firstName()); + Assertions.assertEquals("dbpgnxytxhp", model.contactDetails().lastName()); Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); - Assertions.assertEquals("ovawjvzunlu", model.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("n", model.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("jzuaejxdultskzbb", model.contactDetails().phoneNumber()); - Assertions.assertEquals("dzumveekg", model.contactDetails().preferredTimeZone()); - Assertions.assertEquals("wozuhkf", model.contactDetails().country()); - Assertions.assertEquals("bsjyofdx", model.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("n", model.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T19:19:56Z"), model.problemStartTime()); - Assertions.assertEquals("isxyawjoyaqcslyj", model.serviceId()); - Assertions.assertEquals("aulppggd", model.fileWorkspaceName()); - Assertions.assertEquals("nyiropuhpi", model.technicalTicketDetails().resourceId()); - Assertions.assertEquals("gylgqgitxmedjvcs", model.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("n", model.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("cwzzhxgktr", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("ucnapkteoellwp", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("bzpfzab", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("uhxwtctyqiklbbov", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("wzbhvgyugu", model.contactDetails().phoneNumber()); + Assertions.assertEquals("svmkfssxquk", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("fpl", model.contactDetails().country()); + Assertions.assertEquals("mg", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("iuebbaumny", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T09:41:28Z"), model.problemStartTime()); + Assertions.assertEquals("edeojnabc", model.serviceId()); + Assertions.assertEquals("ldwkyzxuutkn", model.fileWorkspaceName()); + Assertions.assertEquals("svlxotogtwrup", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("vnm", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("ykvceoveil", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("tyfjfcnjbkcnxdhb", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("kphywpnvjto", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("moizpos", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("udxytlmoyrx", model.secondaryConsent().get(0).type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SupportTicketDetailsProperties model = new SupportTicketDetailsProperties() - .withSupportTicketId("gmtsavjcbpwxqpsr").withDescription("nftguvriuhpr") - .withProblemClassificationId("mdyvxqtayriw").withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) - .withEnrollmentId("rmcqiby").withRequire24X7Response(true).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions("nmefqsgzvahapj").withSupportPlanId("hpvgqz") - .withContactDetails(new ContactProfile().withFirstName("j").withLastName("vxdjzlmwlxkvugf") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("ovawjvzunlu") - .withAdditionalEmailAddresses(Arrays.asList("n", "rnxipei")).withPhoneNumber("jzuaejxdultskzbb") - .withPreferredTimeZone("dzumveekg").withCountry("wozuhkf").withPreferredSupportLanguage("bsjyofdx")) - .withServiceLevelAgreement(new ServiceLevelAgreement()).withSupportEngineer(new SupportEngineer()) - .withTitle("n").withProblemStartTime(OffsetDateTime.parse("2021-03-25T19:19:56Z")) - .withServiceId("isxyawjoyaqcslyj").withFileWorkspaceName("aulppggd") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("nyiropuhpi")) - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("gylgqgitxmedjvcs") - .withQuotaChangeRequestVersion("n").withQuotaChangeRequests( - Arrays.asList(new QuotaChangeRequest().withRegion("cwzzhxgktr").withPayload("ucnapkteoellwp"), - new QuotaChangeRequest().withRegion("d").withPayload("pfqbuaceopzf"), - new QuotaChangeRequest().withRegion("hhuao").withPayload("pcqeqx"), - new QuotaChangeRequest().withRegion("z").withPayload("hzxct")))) - .withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("moizpos"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("cfbu"), - new SecondaryConsent().withUserConsent(UserConsent.NO).withType("qjhhkxbpv"))); + SupportTicketDetailsProperties model + = new SupportTicketDetailsProperties().withSupportTicketId("haaxdbabphl") + .withDescription("rqlfktsthsucocmn") + .withProblemClassificationId("yazttbtwwrqpue") + .withSeverity(SeverityLevel.MINIMAL) + .withEnrollmentId("yueaxibxujwb") + .withRequire24X7Response(false) + .withAdvancedDiagnosticConsent(Consent.NO) + .withProblemScopingQuestions("muzyoxaepdk") + .withSupportPlanId("ancuxrhd") + .withContactDetails(new ContactProfile().withFirstName("bavxbniwdjswzt") + .withLastName("dbpgnxytxhp") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("bzpfzab") + .withAdditionalEmailAddresses(Arrays.asList("uhxwtctyqiklbbov")) + .withPhoneNumber("wzbhvgyugu") + .withPreferredTimeZone("svmkfssxquk") + .withCountry("fpl") + .withPreferredSupportLanguage("mg")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("iuebbaumny") + .withProblemStartTime(OffsetDateTime.parse("2021-02-11T09:41:28Z")) + .withServiceId("edeojnabc") + .withFileWorkspaceName("ldwkyzxuutkn") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("svlxotogtwrup")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("vnm") + .withQuotaChangeRequestVersion("ykvceoveil") + .withQuotaChangeRequests(Arrays.asList( + new QuotaChangeRequest().withRegion("tyfjfcnjbkcnxdhb").withPayload("kphywpnvjto"), + new QuotaChangeRequest().withRegion("ermclfplphoxuscr").withPayload("bgyepsbj"), + new QuotaChangeRequest().withRegion("zq").withPayload("xywpmueefjzwfqkq"), + new QuotaChangeRequest().withRegion("ids").withPayload("onobglaocqx")))) + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("udxytlmoyrx"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("dw"))); model = BinaryData.fromObject(model).toObject(SupportTicketDetailsProperties.class); - Assertions.assertEquals("gmtsavjcbpwxqpsr", model.supportTicketId()); - Assertions.assertEquals("nftguvriuhpr", model.description()); - Assertions.assertEquals("mdyvxqtayriw", model.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); - Assertions.assertEquals("rmcqiby", model.enrollmentId()); - Assertions.assertEquals(true, model.require24X7Response()); - Assertions.assertEquals(Consent.YES, model.advancedDiagnosticConsent()); - Assertions.assertEquals("nmefqsgzvahapj", model.problemScopingQuestions()); - Assertions.assertEquals("hpvgqz", model.supportPlanId()); - Assertions.assertEquals("j", model.contactDetails().firstName()); - Assertions.assertEquals("vxdjzlmwlxkvugf", model.contactDetails().lastName()); + Assertions.assertEquals("haaxdbabphl", model.supportTicketId()); + Assertions.assertEquals("rqlfktsthsucocmn", model.description()); + Assertions.assertEquals("yazttbtwwrqpue", model.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MINIMAL, model.severity()); + Assertions.assertEquals("yueaxibxujwb", model.enrollmentId()); + Assertions.assertEquals(false, model.require24X7Response()); + Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); + Assertions.assertEquals("muzyoxaepdk", model.problemScopingQuestions()); + Assertions.assertEquals("ancuxrhd", model.supportPlanId()); + Assertions.assertEquals("bavxbniwdjswzt", model.contactDetails().firstName()); + Assertions.assertEquals("dbpgnxytxhp", model.contactDetails().lastName()); Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); - Assertions.assertEquals("ovawjvzunlu", model.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("n", model.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("jzuaejxdultskzbb", model.contactDetails().phoneNumber()); - Assertions.assertEquals("dzumveekg", model.contactDetails().preferredTimeZone()); - Assertions.assertEquals("wozuhkf", model.contactDetails().country()); - Assertions.assertEquals("bsjyofdx", model.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("n", model.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-25T19:19:56Z"), model.problemStartTime()); - Assertions.assertEquals("isxyawjoyaqcslyj", model.serviceId()); - Assertions.assertEquals("aulppggd", model.fileWorkspaceName()); - Assertions.assertEquals("nyiropuhpi", model.technicalTicketDetails().resourceId()); - Assertions.assertEquals("gylgqgitxmedjvcs", model.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("n", model.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("cwzzhxgktr", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("ucnapkteoellwp", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("bzpfzab", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("uhxwtctyqiklbbov", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("wzbhvgyugu", model.contactDetails().phoneNumber()); + Assertions.assertEquals("svmkfssxquk", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("fpl", model.contactDetails().country()); + Assertions.assertEquals("mg", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("iuebbaumny", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T09:41:28Z"), model.problemStartTime()); + Assertions.assertEquals("edeojnabc", model.serviceId()); + Assertions.assertEquals("ldwkyzxuutkn", model.fileWorkspaceName()); + Assertions.assertEquals("svlxotogtwrup", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("vnm", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("ykvceoveil", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("tyfjfcnjbkcnxdhb", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("kphywpnvjto", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("moizpos", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("udxytlmoyrx", model.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilityWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilityWithResponseMockTests.java index c895ca6059e5..8f65d71e1df1 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilityWithResponseMockTests.java @@ -6,53 +6,35 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; import com.azure.resourcemanager.support.models.Type; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"nameAvailable\":true,\"reason\":\"vrvmtgjqppyost\",\"message\":\"nzm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CheckNameAvailabilityOutput response = manager.supportTickets() - .checkNameAvailabilityWithResponse( - new CheckNameAvailabilityInput().withName("vfycxzb").withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), - com.azure.core.util.Context.NONE) - .getValue(); + String responseStr = "{\"nameAvailable\":true,\"reason\":\"wcciuqgbdbu\",\"message\":\"uvfbtkuwh\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); + + CheckNameAvailabilityOutput response + = manager.supportTickets() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("qiiobyuqer") + .withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), com.azure.core.util.Context.NONE) + .getValue(); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateMockTests.java index df18e2bfa343..274a54544f09 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateMockTests.java @@ -6,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; @@ -24,93 +22,95 @@ import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.TechnicalTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; 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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsCreateMockTests { @Test public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"supportTicketId\":\"jjziuxxpsh\",\"description\":\"eekulfgslqubkwd\",\"problemClassificationId\":\"enr\",\"problemClassificationDisplayName\":\"utujba\",\"severity\":\"critical\",\"enrollmentId\":\"uo\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"lnorwmdu\",\"supportPlanId\":\"pklvxw\",\"contactDetails\":{\"firstName\":\"ygdxpgpqchis\",\"lastName\":\"epn\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"jcrxgibbdaxcon\",\"additionalEmailAddresses\":[\"auorsukokw\",\"qplhlvnu\"],\"phoneNumber\":\"pzlrphw\",\"preferredTimeZone\":\"soldweyuqdunv\",\"country\":\"nnrwrbiork\",\"preferredSupportLanguage\":\"alywjhhgdn\"},\"serviceLevelAgreement\":{\"startTime\":\"2020-12-26T18:57:18Z\",\"expirationTime\":\"2021-07-25T18:06:34Z\",\"slaMinutes\":759547890},\"supportEngineer\":{\"emailAddress\":\"loxggdufiqn\"},\"supportPlanType\":\"euzaof\",\"supportPlanDisplayName\":\"hvcyyysfg\",\"title\":\"otcubi\",\"problemStartTime\":\"2021-09-22T20:49:43Z\",\"serviceId\":\"ipwoqonmacjek\",\"serviceDisplayName\":\"zshq\",\"status\":\"impevf\",\"createdDate\":\"2021-01-08T13:16:44Z\",\"modifiedDate\":\"2021-10-07T22:04:33Z\",\"fileWorkspaceName\":\"ilbywdxsm\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"wfscjfn\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"zqujizdvoqytiby\",\"quotaChangeRequestVersion\":\"bblgyavut\",\"quotaChangeRequests\":[{\"region\":\"oxoismsksbpim\",\"payload\":\"oljxkcgx\"},{\"region\":\"xsffgcviz\",\"payload\":\"dwl\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"pfgfbkjub\"},{\"userConsent\":\"Yes\",\"type\":\"kfm\"},{\"userConsent\":\"Yes\",\"type\":\"owzfttsttkt\"}]},\"id\":\"ahbqactxtgzuk\",\"name\":\"itmmqtgqqqxh\",\"type\":\"n\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"supportTicketId\":\"bejdcn\",\"description\":\"qqmoaku\",\"problemClassificationId\":\"gm\",\"problemClassificationDisplayName\":\"rwr\",\"severity\":\"moderate\",\"enrollmentId\":\"twaenuuzko\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"rfdwoyu\",\"supportPlanId\":\"ziuiefozbhdm\",\"contactDetails\":{\"firstName\":\"mlmz\",\"lastName\":\"hoftr\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"equi\",\"additionalEmailAddresses\":[\"icslfaoq\",\"piyylhalnswhccsp\"],\"phoneNumber\":\"aivwitqscywu\",\"preferredTimeZone\":\"gwol\",\"country\":\"h\",\"preferredSupportLanguage\":\"zbwemh\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-04-14T21:32:09Z\",\"expirationTime\":\"2021-08-12T10:49:45Z\",\"slaMinutes\":73661757},\"supportEngineer\":{\"emailAddress\":\"msweypqwdxggicc\"},\"supportPlanType\":\"xqhuexm\",\"supportPlanDisplayName\":\"tlstvlzywem\",\"title\":\"zrncsdt\",\"problemStartTime\":\"2021-07-01T02:09:13Z\",\"serviceId\":\"siypbs\",\"serviceDisplayName\":\"ytguslf\",\"status\":\"dcygqukyhejhz\",\"createdDate\":\"2021-04-26T05:02:54Z\",\"modifiedDate\":\"2021-04-29T01:54:20Z\",\"fileWorkspaceName\":\"elolppvksrpqvuj\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"twdw\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"swibyr\",\"quotaChangeRequestVersion\":\"l\",\"quotaChangeRequests\":[{\"region\":\"fwpracstwi\",\"payload\":\"khevxccedc\"},{\"region\":\"md\",\"payload\":\"dnwzxltjcvnhltiu\"},{\"region\":\"xnavvwxq\",\"payload\":\"y\"},{\"region\":\"nyowxwlmdjrkvfg\",\"payload\":\"fvpdbo\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"j\"},{\"userConsent\":\"Yes\",\"type\":\"rribd\"},{\"userConsent\":\"Yes\",\"type\":\"ipqkghvxndzwm\"},{\"userConsent\":\"Yes\",\"type\":\"ajpjo\"}]},\"id\":\"wkqnyhg\",\"name\":\"ij\",\"type\":\"jivfxzsjabib\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - SupportTicketDetails response = manager.supportTickets().define("rpxeh").withSupportTicketId("ykqgaifmvik") - .withDescription("bydvkhbejdz").withProblemClassificationId("xcv").withSeverity(SeverityLevel.MODERATE) - .withEnrollmentId("lvtno").withRequire24X7Response(false).withAdvancedDiagnosticConsent(Consent.NO) - .withProblemScopingQuestions("mjdftu").withSupportPlanId("ltducea") - .withContactDetails(new ContactProfile().withFirstName("tmczuomejwcwwqi").withLastName("knssxmojm") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("p") - .withAdditionalEmailAddresses(Arrays.asList("rvkwc", "zqljyxgtczh", "ydbsd", "hmkxmaehvbb")) - .withPhoneNumber("ripltf").withPreferredTimeZone("htba").withCountry("kgxywr") - .withPreferredSupportLanguage("kpyklyhp")) - .withServiceLevelAgreement(new ServiceLevelAgreement()).withSupportEngineer(new SupportEngineer()) - .withTitle("kdl").withProblemStartTime(OffsetDateTime.parse("2021-11-20T02:35:42Z")) - .withServiceId("fbumlkx").withFileWorkspaceName("brhu") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("dyg")) - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("kkqfqjbvle") - .withQuotaChangeRequestVersion("fmluiqtqzfavyvn").withQuotaChangeRequests( - Arrays.asList(new QuotaChangeRequest().withRegion("aryeu").withPayload("jkqa")))) + SupportTicketDetails response = manager.supportTickets() + .define("ao") + .withDescription("jervtia") + .withProblemClassificationId("xsdszuempsb") + .withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withAdvancedDiagnosticConsent(Consent.NO) + .withContactDetails(new ContactProfile().withFirstName("fn") + .withLastName("ckw") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("zqwhxxbuyqaxzfeq") + .withAdditionalEmailAddresses(Arrays.asList("priolx", "rjaltolmncw")) + .withPhoneNumber("bqwcsdbnwdcf") + .withPreferredTimeZone("ucqdpfuvglsb") + .withCountry("jcanvxbvtvudut") + .withPreferredSupportLanguage("cormr")) + .withTitle("dsg") + .withServiceId("mkycgra") + .withSupportTicketId("ulpqblylsyxkqjn") + .withEnrollmentId("yvpnqicvinvkjj") + .withRequire24X7Response(true) + .withProblemScopingQuestions("uukzclewyhmlw") + .withSupportPlanId("ztzp") + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withProblemStartTime(OffsetDateTime.parse("2021-04-29T00:37:52Z")) + .withFileWorkspaceName("mqoefkifrvtpuqu") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("kfbtndoaongbjc")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("jitcjedftwwaez") + .withQuotaChangeRequestVersion("jvdcpzfoqouic") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("rzgszufoxci").withPayload("p"), + new QuotaChangeRequest().withRegion("oamciodh").withPayload("azxkhnzbonlwnto"), + new QuotaChangeRequest().withRegion("okdwb").withPayload("kszzcmrvexztv"), + new QuotaChangeRequest().withRegion("qgsfraoyzkoow").withPayload("mnguxawqaldsyu")))) .withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("esjcbhern"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("w"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("bquwrbehw"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("buffkmrqemvvhm"))) + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("qfobwyz"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("kutwpf"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("m"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("dsnfdsdoakgtdl"))) .create(); - Assertions.assertEquals("jjziuxxpsh", response.supportTicketId()); - Assertions.assertEquals("eekulfgslqubkwd", response.description()); - Assertions.assertEquals("enr", response.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.CRITICAL, response.severity()); - Assertions.assertEquals("uo", response.enrollmentId()); - Assertions.assertEquals(true, response.require24X7Response()); - Assertions.assertEquals(Consent.YES, response.advancedDiagnosticConsent()); - Assertions.assertEquals("lnorwmdu", response.problemScopingQuestions()); - Assertions.assertEquals("pklvxw", response.supportPlanId()); - Assertions.assertEquals("ygdxpgpqchis", response.contactDetails().firstName()); - Assertions.assertEquals("epn", response.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, response.contactDetails().preferredContactMethod()); - Assertions.assertEquals("jcrxgibbdaxcon", response.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("auorsukokw", response.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("pzlrphw", response.contactDetails().phoneNumber()); - Assertions.assertEquals("soldweyuqdunv", response.contactDetails().preferredTimeZone()); - Assertions.assertEquals("nnrwrbiork", response.contactDetails().country()); - Assertions.assertEquals("alywjhhgdn", response.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("otcubi", response.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-22T20:49:43Z"), response.problemStartTime()); - Assertions.assertEquals("ipwoqonmacjek", response.serviceId()); - Assertions.assertEquals("ilbywdxsm", response.fileWorkspaceName()); - Assertions.assertEquals("wfscjfn", response.technicalTicketDetails().resourceId()); - Assertions.assertEquals("zqujizdvoqytiby", response.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("bblgyavut", response.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("oxoismsksbpim", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("oljxkcgx", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("bejdcn", response.supportTicketId()); + Assertions.assertEquals("qqmoaku", response.description()); + Assertions.assertEquals("gm", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MODERATE, response.severity()); + Assertions.assertEquals("twaenuuzko", response.enrollmentId()); + Assertions.assertEquals(false, response.require24X7Response()); + Assertions.assertEquals(Consent.NO, response.advancedDiagnosticConsent()); + Assertions.assertEquals("rfdwoyu", response.problemScopingQuestions()); + Assertions.assertEquals("ziuiefozbhdm", response.supportPlanId()); + Assertions.assertEquals("mlmz", response.contactDetails().firstName()); + Assertions.assertEquals("hoftr", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("equi", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("icslfaoq", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("aivwitqscywu", response.contactDetails().phoneNumber()); + Assertions.assertEquals("gwol", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("h", response.contactDetails().country()); + Assertions.assertEquals("zbwemh", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("zrncsdt", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T02:09:13Z"), response.problemStartTime()); + Assertions.assertEquals("siypbs", response.serviceId()); + Assertions.assertEquals("elolppvksrpqvuj", response.fileWorkspaceName()); + Assertions.assertEquals("twdw", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("swibyr", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("l", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("fwpracstwi", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("khevxccedc", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.YES, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("pfgfbkjub", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("j", response.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsGetWithResponseMockTests.java index 7210e8df41c3..9efbaa789035 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsGetWithResponseMockTests.java @@ -6,83 +6,65 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"supportTicketId\":\"yzhftwesgogczh\",\"description\":\"nnxk\",\"problemClassificationId\":\"lgnyhmo\",\"problemClassificationDisplayName\":\"xkk\",\"severity\":\"moderate\",\"enrollmentId\":\"rrghxjbdhqxvcxgf\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"bshrnsvbuswd\",\"supportPlanId\":\"yybyc\",\"contactDetails\":{\"firstName\":\"unvjsrtkfawnopq\",\"lastName\":\"ikyzirtxdy\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"zejntps\",\"additionalEmailAddresses\":[\"ioilqukrydxtq\",\"ieoxorggufhyaomt\"],\"phoneNumber\":\"hhavgrvkffovjz\",\"preferredTimeZone\":\"pjbi\",\"country\":\"gjmfxumvfcl\",\"preferredSupportLanguage\":\"yo\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-06-29T21:37:31Z\",\"expirationTime\":\"2021-07-15T13:35:55Z\",\"slaMinutes\":2057489706},\"supportEngineer\":{\"emailAddress\":\"xscyhwzdgirujbz\"},\"supportPlanType\":\"mvzzbtdcqvp\",\"supportPlanDisplayName\":\"yujviylwdshfssn\",\"title\":\"bgye\",\"problemStartTime\":\"2021-01-22T05:40:33Z\",\"serviceId\":\"msgaoj\",\"serviceDisplayName\":\"wncot\",\"status\":\"fhir\",\"createdDate\":\"2021-08-14T22:10:23Z\",\"modifiedDate\":\"2021-04-25T01:25:48Z\",\"fileWorkspaceName\":\"oftpipiwycz\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"pqjlihhyusps\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"dvlmfwdgzxul\",\"quotaChangeRequestVersion\":\"vpa\",\"quotaChangeRequests\":[{\"region\":\"euzvx\",\"payload\":\"i\"},{\"region\":\"nhn\",\"payload\":\"xifqjzgxm\"},{\"region\":\"ublwpcesutrg\",\"payload\":\"pauutpw\"},{\"region\":\"hihejqgwzpnfqn\",\"payload\":\"ypsxjvfoim\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"cizjxvydfceacvl\"},{\"userConsent\":\"No\",\"type\":\"dyftumrtwna\"}]},\"id\":\"jslb\",\"name\":\"wkojgcyztsfmzn\",\"type\":\"aeqphchqnr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"supportTicketId\":\"atklddxbjhwuaa\",\"description\":\"oz\",\"problemClassificationId\":\"osphyoul\",\"problemClassificationDisplayName\":\"rvxaglrvimjwosy\",\"severity\":\"minimal\",\"enrollmentId\":\"tcs\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"qumiek\",\"supportPlanId\":\"zzikhlyfjhdg\",\"contactDetails\":{\"firstName\":\"gge\",\"lastName\":\"dunyg\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"qidbqfatpxllrxcy\",\"additionalEmailAddresses\":[\"a\",\"su\"],\"phoneNumber\":\"r\",\"preferredTimeZone\":\"ywdmjsjqbjh\",\"country\":\"yxxrwlycoduh\",\"preferredSupportLanguage\":\"kxkgymareqna\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-06-15T09:27:50Z\",\"expirationTime\":\"2021-06-13T08:03:20Z\",\"slaMinutes\":432489630},\"supportEngineer\":{\"emailAddress\":\"ubeddg\"},\"supportPlanType\":\"ofwq\",\"supportPlanDisplayName\":\"qal\",\"title\":\"rmnjijpx\",\"problemStartTime\":\"2021-07-27T17:13:58Z\",\"serviceId\":\"qudf\",\"serviceDisplayName\":\"yxbaaabjyvayf\",\"status\":\"m\",\"createdDate\":\"2021-07-11T14:35:31Z\",\"modifiedDate\":\"2021-04-01T17:38:45Z\",\"fileWorkspaceName\":\"qogsexnevfd\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"ewzsyyceuzsoib\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"pfrxtrthzvay\",\"quotaChangeRequestVersion\":\"wkqbrqu\",\"quotaChangeRequests\":[{\"region\":\"h\",\"payload\":\"iilivpdtiirqtd\"},{\"region\":\"axoruzfgsquy\",\"payload\":\"rxxle\"},{\"region\":\"ramxjezwlwnw\",\"payload\":\"qlcvydy\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"aojkniodk\"},{\"userConsent\":\"Yes\",\"type\":\"wnujhemmsbvdk\"}]},\"id\":\"rodtjinfwjlfl\",\"name\":\"kacjvefkdlfo\",\"type\":\"kggkfpa\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); SupportTicketDetails response - = manager.supportTickets().getWithResponse("ft", com.azure.core.util.Context.NONE).getValue(); + = manager.supportTickets().getWithResponse("elpcirelsfeaenwa", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("yzhftwesgogczh", response.supportTicketId()); - Assertions.assertEquals("nnxk", response.description()); - Assertions.assertEquals("lgnyhmo", response.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.MODERATE, response.severity()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", response.enrollmentId()); + Assertions.assertEquals("atklddxbjhwuaa", response.supportTicketId()); + Assertions.assertEquals("oz", response.description()); + Assertions.assertEquals("osphyoul", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MINIMAL, response.severity()); + Assertions.assertEquals("tcs", response.enrollmentId()); Assertions.assertEquals(true, response.require24X7Response()); Assertions.assertEquals(Consent.YES, response.advancedDiagnosticConsent()); - Assertions.assertEquals("bshrnsvbuswd", response.problemScopingQuestions()); - Assertions.assertEquals("yybyc", response.supportPlanId()); - Assertions.assertEquals("unvjsrtkfawnopq", response.contactDetails().firstName()); - Assertions.assertEquals("ikyzirtxdy", response.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.EMAIL, response.contactDetails().preferredContactMethod()); - Assertions.assertEquals("zejntps", response.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("ioilqukrydxtq", response.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("hhavgrvkffovjz", response.contactDetails().phoneNumber()); - Assertions.assertEquals("pjbi", response.contactDetails().preferredTimeZone()); - Assertions.assertEquals("gjmfxumvfcl", response.contactDetails().country()); - Assertions.assertEquals("yo", response.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("bgye", response.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T05:40:33Z"), response.problemStartTime()); - Assertions.assertEquals("msgaoj", response.serviceId()); - Assertions.assertEquals("oftpipiwycz", response.fileWorkspaceName()); - Assertions.assertEquals("pqjlihhyusps", response.technicalTicketDetails().resourceId()); - Assertions.assertEquals("dvlmfwdgzxul", response.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("vpa", response.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("euzvx", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("i", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("qumiek", response.problemScopingQuestions()); + Assertions.assertEquals("zzikhlyfjhdg", response.supportPlanId()); + Assertions.assertEquals("gge", response.contactDetails().firstName()); + Assertions.assertEquals("dunyg", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("qidbqfatpxllrxcy", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("a", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("r", response.contactDetails().phoneNumber()); + Assertions.assertEquals("ywdmjsjqbjh", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("yxxrwlycoduh", response.contactDetails().country()); + Assertions.assertEquals("kxkgymareqna", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("rmnjijpx", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T17:13:58Z"), response.problemStartTime()); + Assertions.assertEquals("qudf", response.serviceId()); + Assertions.assertEquals("qogsexnevfd", response.fileWorkspaceName()); + Assertions.assertEquals("ewzsyyceuzsoib", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("pfrxtrthzvay", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("wkqbrqu", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("h", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("iilivpdtiirqtd", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("cizjxvydfceacvl", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("aojkniodk", response.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListMockTests.java index 3f0a75f79220..51750adb04fe 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListMockTests.java @@ -6,90 +6,73 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"supportTicketId\":\"a\",\"description\":\"krrjrea\",\"problemClassificationId\":\"xt\",\"problemClassificationDisplayName\":\"umh\",\"severity\":\"critical\",\"enrollmentId\":\"ikkx\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"qpvuzlmvfelf\",\"supportPlanId\":\"gplcrpwjxeznoigb\",\"contactDetails\":{\"firstName\":\"njwmwkpnbsazejj\",\"lastName\":\"qkagfhsxt\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"ugzxnf\",\"additionalEmailAddresses\":[\"pxdtnkdmkq\",\"jlwuenvrkp\"],\"phoneNumber\":\"uaibrebqaaysj\",\"preferredTimeZone\":\"ixqtn\",\"country\":\"ttezlw\",\"preferredSupportLanguage\":\"ffiakp\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-08-27T06:54:30Z\",\"expirationTime\":\"2021-10-12T22:21:14Z\",\"slaMinutes\":147103484},\"supportEngineer\":{\"emailAddress\":\"mmji\"},\"supportPlanType\":\"eozphv\",\"supportPlanDisplayName\":\"uyqncygupkvipmd\",\"title\":\"cwxqu\",\"problemStartTime\":\"2021-09-16T20:46:40Z\",\"serviceId\":\"zhfstot\",\"serviceDisplayName\":\"ojujbyp\",\"status\":\"mc\",\"createdDate\":\"2021-10-20T01:33:25Z\",\"modifiedDate\":\"2020-12-21T07:28:26Z\",\"fileWorkspaceName\":\"jxyfwnylrcoolstt\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"kbnujr\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"tylbfpncurdoiw\",\"quotaChangeRequestVersion\":\"thtywub\",\"quotaChangeRequests\":[{\"region\":\"h\",\"payload\":\"knfd\"},{\"region\":\"wjchrdg\",\"payload\":\"hxumwctondzj\"},{\"region\":\"udfdlwgg\",\"payload\":\"sb\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"gseinq\"},{\"userConsent\":\"No\",\"type\":\"x\"},{\"userConsent\":\"No\",\"type\":\"irgne\"},{\"userConsent\":\"No\",\"type\":\"qmsniffcdmqnro\"}]},\"id\":\"lpijnkrxfrd\",\"name\":\"hcrat\",\"type\":\"zzronasx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"supportTicketId\":\"o\",\"description\":\"mkcdyhbpkkpwdre\",\"problemClassificationId\":\"novvqfovljxy\",\"problemClassificationDisplayName\":\"uwsyrsndsytgadg\",\"severity\":\"minimal\",\"enrollmentId\":\"ea\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"zar\",\"supportPlanId\":\"lquuijfqkacewii\",\"contactDetails\":{\"firstName\":\"fpubjibwwi\",\"lastName\":\"tohqkvpuvksgp\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"aknynfsynljphuop\",\"additionalEmailAddresses\":[\"lqiyntorzihl\",\"osjswsr\",\"slyzrpzbchckqq\"],\"phoneNumber\":\"ioxiysuiizyn\",\"preferredTimeZone\":\"edyatrwyhqmibzyh\",\"country\":\"itsmypyyn\",\"preferredSupportLanguage\":\"cdpu\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-01-20T04:27:27Z\",\"expirationTime\":\"2021-04-24T15:22:10Z\",\"slaMinutes\":1547081847},\"supportEngineer\":{\"emailAddress\":\"biknsorgjhxbld\"},\"supportPlanType\":\"wwrlkdmtncv\",\"supportPlanDisplayName\":\"otllxdyhgsyo\",\"title\":\"ogjltdtbnnhad\",\"problemStartTime\":\"2021-04-24T13:40:54Z\",\"serviceId\":\"rkvcikhnvpa\",\"serviceDisplayName\":\"gxqquezik\",\"status\":\"ggxkallatmelwuip\",\"createdDate\":\"2021-10-19T09:34:04Z\",\"modifiedDate\":\"2021-06-05T01:20:37Z\",\"fileWorkspaceName\":\"z\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"c\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"rhyrnxxmueed\",\"quotaChangeRequestVersion\":\"rdvstkwqqtch\",\"quotaChangeRequests\":[{\"region\":\"fmtdaaygdvwvgp\",\"payload\":\"hgwxrtfudx\"},{\"region\":\"xg\",\"payload\":\"agvrvmnpkuk\"},{\"region\":\"i\",\"payload\":\"blxgwimf\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"wmszkk\"}]},\"id\":\"oqreyfkzikfjawn\",\"name\":\"a\",\"type\":\"vxwc\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.supportTickets().list(856785773, "gfipnsxk", com.azure.core.util.Context.NONE); + = manager.supportTickets().list(1424566562, "hykojoxafnndlpic", com.azure.core.util.Context.NONE); - Assertions.assertEquals("a", response.iterator().next().supportTicketId()); - Assertions.assertEquals("krrjrea", response.iterator().next().description()); - Assertions.assertEquals("xt", response.iterator().next().problemClassificationId()); - Assertions.assertEquals(SeverityLevel.CRITICAL, response.iterator().next().severity()); - Assertions.assertEquals("ikkx", response.iterator().next().enrollmentId()); + Assertions.assertEquals("o", response.iterator().next().supportTicketId()); + Assertions.assertEquals("mkcdyhbpkkpwdre", response.iterator().next().description()); + Assertions.assertEquals("novvqfovljxy", response.iterator().next().problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MINIMAL, response.iterator().next().severity()); + Assertions.assertEquals("ea", response.iterator().next().enrollmentId()); Assertions.assertEquals(false, response.iterator().next().require24X7Response()); - Assertions.assertEquals(Consent.NO, response.iterator().next().advancedDiagnosticConsent()); - Assertions.assertEquals("qpvuzlmvfelf", response.iterator().next().problemScopingQuestions()); - Assertions.assertEquals("gplcrpwjxeznoigb", response.iterator().next().supportPlanId()); - Assertions.assertEquals("njwmwkpnbsazejj", response.iterator().next().contactDetails().firstName()); - Assertions.assertEquals("qkagfhsxt", response.iterator().next().contactDetails().lastName()); + Assertions.assertEquals(Consent.YES, response.iterator().next().advancedDiagnosticConsent()); + Assertions.assertEquals("zar", response.iterator().next().problemScopingQuestions()); + Assertions.assertEquals("lquuijfqkacewii", response.iterator().next().supportPlanId()); + Assertions.assertEquals("fpubjibwwi", response.iterator().next().contactDetails().firstName()); + Assertions.assertEquals("tohqkvpuvksgp", response.iterator().next().contactDetails().lastName()); Assertions.assertEquals(PreferredContactMethod.PHONE, response.iterator().next().contactDetails().preferredContactMethod()); - Assertions.assertEquals("ugzxnf", response.iterator().next().contactDetails().primaryEmailAddress()); - Assertions.assertEquals("pxdtnkdmkq", + Assertions.assertEquals("aknynfsynljphuop", response.iterator().next().contactDetails().primaryEmailAddress()); + Assertions.assertEquals("lqiyntorzihl", response.iterator().next().contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("uaibrebqaaysj", response.iterator().next().contactDetails().phoneNumber()); - Assertions.assertEquals("ixqtn", response.iterator().next().contactDetails().preferredTimeZone()); - Assertions.assertEquals("ttezlw", response.iterator().next().contactDetails().country()); - Assertions.assertEquals("ffiakp", response.iterator().next().contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("cwxqu", response.iterator().next().title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-16T20:46:40Z"), + Assertions.assertEquals("ioxiysuiizyn", response.iterator().next().contactDetails().phoneNumber()); + Assertions.assertEquals("edyatrwyhqmibzyh", response.iterator().next().contactDetails().preferredTimeZone()); + Assertions.assertEquals("itsmypyyn", response.iterator().next().contactDetails().country()); + Assertions.assertEquals("cdpu", response.iterator().next().contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("ogjltdtbnnhad", response.iterator().next().title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T13:40:54Z"), response.iterator().next().problemStartTime()); - Assertions.assertEquals("zhfstot", response.iterator().next().serviceId()); - Assertions.assertEquals("jxyfwnylrcoolstt", response.iterator().next().fileWorkspaceName()); - Assertions.assertEquals("kbnujr", response.iterator().next().technicalTicketDetails().resourceId()); - Assertions.assertEquals("tylbfpncurdoiw", + Assertions.assertEquals("rkvcikhnvpa", response.iterator().next().serviceId()); + Assertions.assertEquals("z", response.iterator().next().fileWorkspaceName()); + Assertions.assertEquals("c", response.iterator().next().technicalTicketDetails().resourceId()); + Assertions.assertEquals("rhyrnxxmueed", response.iterator().next().quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("thtywub", response.iterator().next().quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("h", + Assertions.assertEquals("rdvstkwqqtch", + response.iterator().next().quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("fmtdaaygdvwvgp", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("knfd", + Assertions.assertEquals("hgwxrtfudx", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.YES, response.iterator().next().secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("gseinq", response.iterator().next().secondaryConsent().get(0).type()); + Assertions.assertEquals("wmszkk", response.iterator().next().secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListResultTests.java index f77888678670..6dea880f9753 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListResultTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsListResultTests.java @@ -26,116 +26,203 @@ public final class SupportTicketsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportTicketsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"supportTicketId\":\"rp\",\"description\":\"xepcyvahfn\",\"problemClassificationId\":\"jky\",\"problemClassificationDisplayName\":\"j\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"j\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"gjljyoxgvc\",\"supportPlanId\":\"bgsncghkjeszzhb\",\"contactDetails\":{\"firstName\":\"jhtxfvgxbfsmxne\",\"lastName\":\"mpvecxgodebfqk\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"bmpukgriwflz\",\"additionalEmailAddresses\":[\"xzpuzycisp\",\"qzahmgkbrp\",\"y\"],\"phoneNumber\":\"ibnuqqkpik\",\"preferredTimeZone\":\"drgvtqagn\",\"country\":\"uynhijg\",\"preferredSupportLanguage\":\"mebf\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-09-16T13:37:10Z\",\"expirationTime\":\"2021-05-02T05:08:07Z\",\"slaMinutes\":2032893006},\"supportEngineer\":{\"emailAddress\":\"pnazzm\"},\"supportPlanType\":\"runmp\",\"supportPlanDisplayName\":\"tdbhrbnla\",\"title\":\"kx\",\"problemStartTime\":\"2021-01-20T20:18:56Z\",\"serviceId\":\"k\",\"serviceDisplayName\":\"henbtkcxywnytn\",\"status\":\"yn\",\"createdDate\":\"2021-11-13T00:34:54Z\",\"modifiedDate\":\"2021-03-29T15:40:05Z\",\"fileWorkspaceName\":\"yxczfclh\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"abphlw\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"fkts\",\"quotaChangeRequestVersion\":\"sucocmnyyazttbtw\",\"quotaChangeRequests\":[{},{},{},{}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"kzywbiex\"},{\"userConsent\":\"No\",\"type\":\"ue\"}]},\"id\":\"xibxujwbhqwalm\",\"name\":\"zyoxaepdkzjan\",\"type\":\"ux\"},{\"properties\":{\"supportTicketId\":\"wbavxbniwdj\",\"description\":\"wz\",\"problemClassificationId\":\"s\",\"problemClassificationDisplayName\":\"pgn\",\"severity\":\"moderate\",\"enrollmentId\":\"x\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"pfza\",\"supportPlanId\":\"lcuhxwtctyqiklb\",\"contactDetails\":{\"firstName\":\"ovplw\",\"lastName\":\"bhvgy\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"uosvmkfssxqukk\",\"additionalEmailAddresses\":[\"gmgsxnkjzkde\"],\"phoneNumber\":\"pvlopwiyighxpkd\",\"preferredTimeZone\":\"zb\",\"country\":\"iuebbaumny\",\"preferredSupportLanguage\":\"upedeojnabckhs\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-11-09T03:48:05Z\",\"expirationTime\":\"2021-05-06T08:00:56Z\",\"slaMinutes\":578889985},\"supportEngineer\":{\"emailAddress\":\"hvpesapskrdqm\"},\"supportPlanType\":\"jdhtldwkyzxu\",\"supportPlanDisplayName\":\"kn\",\"title\":\"ws\",\"problemStartTime\":\"2021-08-07T22:24:06Z\",\"serviceId\":\"vlxotogtwrupqsx\",\"serviceDisplayName\":\"micykvceoveilo\",\"status\":\"oty\",\"createdDate\":\"2021-10-24T21:54:25Z\",\"modifiedDate\":\"2021-03-28T13:11:50Z\",\"fileWorkspaceName\":\"bkc\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"ttkphywpnvjtoqne\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"lfplp\",\"quotaChangeRequestVersion\":\"xus\",\"quotaChangeRequests\":[{},{}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"psbjta\"},{\"userConsent\":\"No\",\"type\":\"xywpmueefjzwfqkq\"}]},\"id\":\"jidsuyonobglaoc\",\"name\":\"xtccmg\",\"type\":\"udxytlmoyrx\"}],\"nextLink\":\"fudwpznt\"}") + "{\"value\":[{\"properties\":{\"supportTicketId\":\"qawrlyxwj\",\"description\":\"cpr\",\"problemClassificationId\":\"nwbxgjvtbvpyssz\",\"problemClassificationDisplayName\":\"rujqg\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"uouq\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"wbnguitnwui\",\"supportPlanId\":\"a\",\"contactDetails\":{\"firstName\":\"x\",\"lastName\":\"fizuckyf\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"rfidfvzwdz\",\"additionalEmailAddresses\":[\"ymwisdkft\"],\"phoneNumber\":\"xmnteiwaop\",\"preferredTimeZone\":\"km\",\"country\":\"jcmmxdcufufsrp\",\"preferredSupportLanguage\":\"mzidnsezcxtb\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-04-17T07:41:34Z\",\"expirationTime\":\"2021-11-30T22:43:16Z\",\"slaMinutes\":669773317},\"supportEngineer\":{\"emailAddress\":\"wmdwzjeiachboo\"},\"supportPlanType\":\"lnrosfqp\",\"supportPlanDisplayName\":\"ehzzvypyqrim\",\"title\":\"inpvswjdkirsoodq\",\"problemStartTime\":\"2021-07-12T18:06:29Z\",\"serviceId\":\"rmnohj\",\"serviceDisplayName\":\"kwh\",\"status\":\"oifiyipjxsqwpgr\",\"createdDate\":\"2021-03-31T15:02:13Z\",\"modifiedDate\":\"2021-06-14T22:17:31Z\",\"fileWorkspaceName\":\"cjxvsnbyxqab\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"cyshurzafbljjgp\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"qcjm\",\"quotaChangeRequestVersion\":\"javbqidtqajz\",\"quotaChangeRequests\":[{}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"krlkhbzhfepg\"},{\"userConsent\":\"Yes\",\"type\":\"xzlocxscp\"},{\"userConsent\":\"No\",\"type\":\"hhbcsglummajtjao\"}]},\"id\":\"xobnbdxkqpxok\",\"name\":\"jionpimexgstxgc\",\"type\":\"odgmaajrmvdjwz\"},{\"properties\":{\"supportTicketId\":\"ovmclwhijcoejct\",\"description\":\"zaqsqsycbkbfk\",\"problemClassificationId\":\"ukdkexxppofmxa\",\"problemClassificationDisplayName\":\"fjpgddtocjjxhvp\",\"severity\":\"minimal\",\"enrollmentId\":\"exhd\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"eojnxqbzvddn\",\"supportPlanId\":\"ndei\",\"contactDetails\":{\"firstName\":\"btwnpzaoqvuhrhcf\",\"lastName\":\"cyddglmjthjqk\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"yeicxmqciwqvhk\",\"additionalEmailAddresses\":[\"uigdtopbobjog\",\"m\",\"w\"],\"phoneNumber\":\"m\",\"preferredTimeZone\":\"uhrzayvvt\",\"country\":\"gvdfgiotkftutq\",\"preferredSupportLanguage\":\"ln\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-02-04T14:07:35Z\",\"expirationTime\":\"2021-03-05T03:19:35Z\",\"slaMinutes\":1408526617},\"supportEngineer\":{\"emailAddress\":\"krxd\"},\"supportPlanType\":\"i\",\"supportPlanDisplayName\":\"thz\",\"title\":\"vqdra\",\"problemStartTime\":\"2021-02-10T08:49:49Z\",\"serviceId\":\"yb\",\"serviceDisplayName\":\"ehoqfbowskan\",\"status\":\"tzlcuiywgqywgn\",\"createdDate\":\"2021-09-15T21:07:23Z\",\"modifiedDate\":\"2021-04-01T08:37:52Z\",\"fileWorkspaceName\":\"zgpphrcgyncocpe\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"coofsxlzev\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"qjqabcypmivkwl\",\"quotaChangeRequestVersion\":\"vccfw\",\"quotaChangeRequests\":[{},{}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"onlebxetqgtzxdpn\"}]},\"id\":\"bqqwxrj\",\"name\":\"eallnwsubisnj\",\"type\":\"mpmngnzscxaqwoo\"},{\"properties\":{\"supportTicketId\":\"cbonqvpk\",\"description\":\"lrxnjeaseiphe\",\"problemClassificationId\":\"f\",\"problemClassificationDisplayName\":\"keyyi\",\"severity\":\"minimal\",\"enrollmentId\":\"bdlwtgrhpdjpj\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"azjpqyegualhbxxh\",\"supportPlanId\":\"jzzvdud\",\"contactDetails\":{\"firstName\":\"wdslfhotwmcy\",\"lastName\":\"pwlbjnpg\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"ftadehxnltyfs\",\"additionalEmailAddresses\":[\"usue\",\"nzwdejba\"],\"phoneNumber\":\"rxzdmohctbqvudwx\",\"preferredTimeZone\":\"ndnvo\",\"country\":\"gujjugwdkcglh\",\"preferredSupportLanguage\":\"lazjdyggdtjixhbk\"},\"serviceLevelAgreement\":{\"startTime\":\"2020-12-23T07:48:17Z\",\"expirationTime\":\"2021-02-13T10:06:52Z\",\"slaMinutes\":363488888},\"supportEngineer\":{\"emailAddress\":\"enevfyexfwhybci\"},\"supportPlanType\":\"yvdcsitynnaa\",\"supportPlanDisplayName\":\"ectehf\",\"title\":\"qsc\",\"problemStartTime\":\"2021-08-12T09:29:36Z\",\"serviceId\":\"pvhez\",\"serviceDisplayName\":\"gqhcjrefovg\",\"status\":\"qsl\",\"createdDate\":\"2021-08-20T18:32:02Z\",\"modifiedDate\":\"2021-05-05T15:09:29Z\",\"fileWorkspaceName\":\"qjpkcattpngjcrc\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"jh\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"ajvnysounqe\",\"quotaChangeRequestVersion\":\"noae\",\"quotaChangeRequests\":[{},{},{},{}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"rpmopjmc\"},{\"userConsent\":\"Yes\",\"type\":\"okth\"},{\"userConsent\":\"Yes\",\"type\":\"aodsfcpkv\"},{\"userConsent\":\"Yes\",\"type\":\"uozmyzydagfua\"}]},\"id\":\"bezy\",\"name\":\"uokktwhrdxwz\",\"type\":\"wqsmbsur\"},{\"properties\":{\"supportTicketId\":\"imoryocfsfksym\",\"description\":\"dystkiiuxhqyud\",\"problemClassificationId\":\"o\",\"problemClassificationDisplayName\":\"qn\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"czvyifq\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"jsllrmv\",\"supportPlanId\":\"f\",\"contactDetails\":{\"firstName\":\"atkpnp\",\"lastName\":\"lexxbczwtru\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"qzbqjvsov\",\"additionalEmailAddresses\":[\"kacspkw\",\"hzdobpxjmflbvvnc\"],\"phoneNumber\":\"kcciwwzjuqkhr\",\"preferredTimeZone\":\"ajiwkuo\",\"country\":\"oskg\",\"preferredSupportLanguage\":\"sauuimj\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-06-29T03:13:35Z\",\"expirationTime\":\"2021-01-02T07:29:36Z\",\"slaMinutes\":1910171732},\"supportEngineer\":{\"emailAddress\":\"dyjrrfbyaosv\"},\"supportPlanType\":\"csonpclhoco\",\"supportPlanDisplayName\":\"lkevle\",\"title\":\"gz\",\"problemStartTime\":\"2021-09-05T06:09:57Z\",\"serviceId\":\"hfmvfaxkffe\",\"serviceDisplayName\":\"th\",\"status\":\"m\",\"createdDate\":\"2021-02-27T12:32:19Z\",\"modifiedDate\":\"2021-08-05T17:04:54Z\",\"fileWorkspaceName\":\"mzsb\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"igrxwburvjxxjn\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"dptkoenkouk\",\"quotaChangeRequestVersion\":\"udwtiukbl\",\"quotaChangeRequests\":[{},{},{},{}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"pazyxoegukg\"},{\"userConsent\":\"Yes\",\"type\":\"ucgygevqz\"},{\"userConsent\":\"Yes\",\"type\":\"mrbpizcdrqj\"},{\"userConsent\":\"Yes\",\"type\":\"dnfyhxdeoejzicwi\"}]},\"id\":\"sjttgzfbish\",\"name\":\"bkh\",\"type\":\"jdeyeamdpha\"}],\"nextLink\":\"lpbuxwgipwhonowk\"}") .toObject(SupportTicketsListResult.class); - Assertions.assertEquals("rp", model.value().get(0).supportTicketId()); - Assertions.assertEquals("xepcyvahfn", model.value().get(0).description()); - Assertions.assertEquals("jky", model.value().get(0).problemClassificationId()); + Assertions.assertEquals("qawrlyxwj", model.value().get(0).supportTicketId()); + Assertions.assertEquals("cpr", model.value().get(0).description()); + Assertions.assertEquals("nwbxgjvtbvpyssz", model.value().get(0).problemClassificationId()); Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.value().get(0).severity()); - Assertions.assertEquals("j", model.value().get(0).enrollmentId()); + Assertions.assertEquals("uouq", model.value().get(0).enrollmentId()); Assertions.assertEquals(false, model.value().get(0).require24X7Response()); - Assertions.assertEquals(Consent.YES, model.value().get(0).advancedDiagnosticConsent()); - Assertions.assertEquals("gjljyoxgvc", model.value().get(0).problemScopingQuestions()); - Assertions.assertEquals("bgsncghkjeszzhb", model.value().get(0).supportPlanId()); - Assertions.assertEquals("jhtxfvgxbfsmxne", model.value().get(0).contactDetails().firstName()); - Assertions.assertEquals("mpvecxgodebfqk", model.value().get(0).contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, + Assertions.assertEquals(Consent.NO, model.value().get(0).advancedDiagnosticConsent()); + Assertions.assertEquals("wbnguitnwui", model.value().get(0).problemScopingQuestions()); + Assertions.assertEquals("a", model.value().get(0).supportPlanId()); + Assertions.assertEquals("x", model.value().get(0).contactDetails().firstName()); + Assertions.assertEquals("fizuckyf", model.value().get(0).contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.value().get(0).contactDetails().preferredContactMethod()); - Assertions.assertEquals("bmpukgriwflz", model.value().get(0).contactDetails().primaryEmailAddress()); - Assertions.assertEquals("xzpuzycisp", model.value().get(0).contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("ibnuqqkpik", model.value().get(0).contactDetails().phoneNumber()); - Assertions.assertEquals("drgvtqagn", model.value().get(0).contactDetails().preferredTimeZone()); - Assertions.assertEquals("uynhijg", model.value().get(0).contactDetails().country()); - Assertions.assertEquals("mebf", model.value().get(0).contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("kx", model.value().get(0).title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T20:18:56Z"), model.value().get(0).problemStartTime()); - Assertions.assertEquals("k", model.value().get(0).serviceId()); - Assertions.assertEquals("yxczfclh", model.value().get(0).fileWorkspaceName()); - Assertions.assertEquals("abphlw", model.value().get(0).technicalTicketDetails().resourceId()); - Assertions.assertEquals("fkts", model.value().get(0).quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("sucocmnyyazttbtw", - model.value().get(0).quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals(UserConsent.NO, model.value().get(0).secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("kzywbiex", model.value().get(0).secondaryConsent().get(0).type()); - Assertions.assertEquals("fudwpznt", model.nextLink()); + Assertions.assertEquals("rfidfvzwdz", model.value().get(0).contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ymwisdkft", model.value().get(0).contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("xmnteiwaop", model.value().get(0).contactDetails().phoneNumber()); + Assertions.assertEquals("km", model.value().get(0).contactDetails().preferredTimeZone()); + Assertions.assertEquals("jcmmxdcufufsrp", model.value().get(0).contactDetails().country()); + Assertions.assertEquals("mzidnsezcxtb", model.value().get(0).contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("inpvswjdkirsoodq", model.value().get(0).title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T18:06:29Z"), model.value().get(0).problemStartTime()); + Assertions.assertEquals("rmnohj", model.value().get(0).serviceId()); + Assertions.assertEquals("cjxvsnbyxqab", model.value().get(0).fileWorkspaceName()); + Assertions.assertEquals("cyshurzafbljjgp", model.value().get(0).technicalTicketDetails().resourceId()); + Assertions.assertEquals("qcjm", model.value().get(0).quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("javbqidtqajz", model.value().get(0).quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals(UserConsent.YES, model.value().get(0).secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("krlkhbzhfepg", model.value().get(0).secondaryConsent().get(0).type()); + Assertions.assertEquals("lpbuxwgipwhonowk", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SupportTicketsListResult model = new SupportTicketsListResult() .withValue(Arrays.asList( - new SupportTicketDetailsInner().withSupportTicketId("rp").withDescription("xepcyvahfn") - .withProblemClassificationId("jky").withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) - .withEnrollmentId("j").withRequire24X7Response(false).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions("gjljyoxgvc").withSupportPlanId("bgsncghkjeszzhb") - .withContactDetails(new ContactProfile().withFirstName("jhtxfvgxbfsmxne") - .withLastName("mpvecxgodebfqk").withPreferredContactMethod(PreferredContactMethod.PHONE) - .withPrimaryEmailAddress("bmpukgriwflz") - .withAdditionalEmailAddresses(Arrays.asList("xzpuzycisp", "qzahmgkbrp", "y")) - .withPhoneNumber("ibnuqqkpik").withPreferredTimeZone("drgvtqagn").withCountry("uynhijg") - .withPreferredSupportLanguage("mebf")) - .withServiceLevelAgreement(new ServiceLevelAgreement()).withSupportEngineer(new SupportEngineer()) - .withTitle("kx").withProblemStartTime(OffsetDateTime.parse("2021-01-20T20:18:56Z")) - .withServiceId("k").withFileWorkspaceName("yxczfclh") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("abphlw")) - .withQuotaTicketDetails(new QuotaTicketDetails() - .withQuotaChangeRequestSubType("fkts").withQuotaChangeRequestVersion("sucocmnyyazttbtw") + new SupportTicketDetailsInner().withSupportTicketId("qawrlyxwj") + .withDescription("cpr") + .withProblemClassificationId("nwbxgjvtbvpyssz") + .withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withEnrollmentId("uouq") + .withRequire24X7Response(false) + .withAdvancedDiagnosticConsent(Consent.NO) + .withProblemScopingQuestions("wbnguitnwui") + .withSupportPlanId("a") + .withContactDetails(new ContactProfile().withFirstName("x") + .withLastName("fizuckyf") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("rfidfvzwdz") + .withAdditionalEmailAddresses(Arrays.asList("ymwisdkft")) + .withPhoneNumber("xmnteiwaop") + .withPreferredTimeZone("km") + .withCountry("jcmmxdcufufsrp") + .withPreferredSupportLanguage("mzidnsezcxtb")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("inpvswjdkirsoodq") + .withProblemStartTime(OffsetDateTime.parse("2021-07-12T18:06:29Z")) + .withServiceId("rmnohj") + .withFileWorkspaceName("cjxvsnbyxqab") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("cyshurzafbljjgp")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("qcjm") + .withQuotaChangeRequestVersion("javbqidtqajz") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest()))) + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("krlkhbzhfepg"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("xzlocxscp"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("hhbcsglummajtjao"))), + new SupportTicketDetailsInner().withSupportTicketId("ovmclwhijcoejct") + .withDescription("zaqsqsycbkbfk") + .withProblemClassificationId("ukdkexxppofmxa") + .withSeverity(SeverityLevel.MINIMAL) + .withEnrollmentId("exhd") + .withRequire24X7Response(false) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions("eojnxqbzvddn") + .withSupportPlanId("ndei") + .withContactDetails(new ContactProfile().withFirstName("btwnpzaoqvuhrhcf") + .withLastName("cyddglmjthjqk") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("yeicxmqciwqvhk") + .withAdditionalEmailAddresses(Arrays.asList("uigdtopbobjog", "m", "w")) + .withPhoneNumber("m") + .withPreferredTimeZone("uhrzayvvt") + .withCountry("gvdfgiotkftutq") + .withPreferredSupportLanguage("ln")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("vqdra") + .withProblemStartTime(OffsetDateTime.parse("2021-02-10T08:49:49Z")) + .withServiceId("yb") + .withFileWorkspaceName("zgpphrcgyncocpe") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("coofsxlzev")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("qjqabcypmivkwl") + .withQuotaChangeRequestVersion("vccfw") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest(), new QuotaChangeRequest()))) + .withSecondaryConsent(Arrays + .asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("onlebxetqgtzxdpn"))), + new SupportTicketDetailsInner().withSupportTicketId("cbonqvpk") + .withDescription("lrxnjeaseiphe") + .withProblemClassificationId("f") + .withSeverity(SeverityLevel.MINIMAL) + .withEnrollmentId("bdlwtgrhpdjpj") + .withRequire24X7Response(true) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions("azjpqyegualhbxxh") + .withSupportPlanId("jzzvdud") + .withContactDetails(new ContactProfile().withFirstName("wdslfhotwmcy") + .withLastName("pwlbjnpg") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("ftadehxnltyfs") + .withAdditionalEmailAddresses(Arrays.asList("usue", "nzwdejba")) + .withPhoneNumber("rxzdmohctbqvudwx") + .withPreferredTimeZone("ndnvo") + .withCountry("gujjugwdkcglh") + .withPreferredSupportLanguage("lazjdyggdtjixhbk")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("qsc") + .withProblemStartTime(OffsetDateTime.parse("2021-08-12T09:29:36Z")) + .withServiceId("pvhez") + .withFileWorkspaceName("qjpkcattpngjcrc") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("jh")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("ajvnysounqe") + .withQuotaChangeRequestVersion("noae") .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest(), new QuotaChangeRequest(), new QuotaChangeRequest(), new QuotaChangeRequest()))) - .withSecondaryConsent(Arrays.asList( - new SecondaryConsent().withUserConsent(UserConsent.NO).withType("kzywbiex"), - new SecondaryConsent().withUserConsent(UserConsent.NO).withType("ue"))), - new SupportTicketDetailsInner().withSupportTicketId("wbavxbniwdj").withDescription("wz") - .withProblemClassificationId("s").withSeverity(SeverityLevel.MODERATE).withEnrollmentId("x") - .withRequire24X7Response(true).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions("pfza").withSupportPlanId("lcuhxwtctyqiklb") - .withContactDetails(new ContactProfile().withFirstName("ovplw").withLastName("bhvgy") + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("rpmopjmc"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("okth"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("aodsfcpkv"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("uozmyzydagfua"))), + new SupportTicketDetailsInner().withSupportTicketId("imoryocfsfksym") + .withDescription("dystkiiuxhqyud") + .withProblemClassificationId("o") + .withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withEnrollmentId("czvyifq") + .withRequire24X7Response(false) + .withAdvancedDiagnosticConsent(Consent.NO) + .withProblemScopingQuestions("jsllrmv") + .withSupportPlanId("f") + .withContactDetails(new ContactProfile().withFirstName("atkpnp") + .withLastName("lexxbczwtru") .withPreferredContactMethod(PreferredContactMethod.EMAIL) - .withPrimaryEmailAddress("uosvmkfssxqukk") - .withAdditionalEmailAddresses(Arrays.asList("gmgsxnkjzkde")).withPhoneNumber("pvlopwiyighxpkd") - .withPreferredTimeZone("zb").withCountry("iuebbaumny") - .withPreferredSupportLanguage("upedeojnabckhs")) - .withServiceLevelAgreement(new ServiceLevelAgreement()).withSupportEngineer(new SupportEngineer()) - .withTitle("ws").withProblemStartTime(OffsetDateTime.parse("2021-08-07T22:24:06Z")) - .withServiceId("vlxotogtwrupqsx").withFileWorkspaceName("bkc") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("ttkphywpnvjtoqne")) - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("lfplp") - .withQuotaChangeRequestVersion("xus") - .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest(), new QuotaChangeRequest()))) + .withPrimaryEmailAddress("qzbqjvsov") + .withAdditionalEmailAddresses(Arrays.asList("kacspkw", "hzdobpxjmflbvvnc")) + .withPhoneNumber("kcciwwzjuqkhr") + .withPreferredTimeZone("ajiwkuo") + .withCountry("oskg") + .withPreferredSupportLanguage("sauuimj")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("gz") + .withProblemStartTime(OffsetDateTime.parse("2021-09-05T06:09:57Z")) + .withServiceId("hfmvfaxkffe") + .withFileWorkspaceName("mzsb") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("igrxwburvjxxjn")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("dptkoenkouk") + .withQuotaChangeRequestVersion("udwtiukbl") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest(), new QuotaChangeRequest(), + new QuotaChangeRequest(), new QuotaChangeRequest()))) .withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("psbjta"), - new SecondaryConsent().withUserConsent(UserConsent.NO).withType("xywpmueefjzwfqkq"))))) - .withNextLink("fudwpznt"); + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("pazyxoegukg"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("ucgygevqz"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("mrbpizcdrqj"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("dnfyhxdeoejzicwi"))))) + .withNextLink("lpbuxwgipwhonowk"); model = BinaryData.fromObject(model).toObject(SupportTicketsListResult.class); - Assertions.assertEquals("rp", model.value().get(0).supportTicketId()); - Assertions.assertEquals("xepcyvahfn", model.value().get(0).description()); - Assertions.assertEquals("jky", model.value().get(0).problemClassificationId()); + Assertions.assertEquals("qawrlyxwj", model.value().get(0).supportTicketId()); + Assertions.assertEquals("cpr", model.value().get(0).description()); + Assertions.assertEquals("nwbxgjvtbvpyssz", model.value().get(0).problemClassificationId()); Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.value().get(0).severity()); - Assertions.assertEquals("j", model.value().get(0).enrollmentId()); + Assertions.assertEquals("uouq", model.value().get(0).enrollmentId()); Assertions.assertEquals(false, model.value().get(0).require24X7Response()); - Assertions.assertEquals(Consent.YES, model.value().get(0).advancedDiagnosticConsent()); - Assertions.assertEquals("gjljyoxgvc", model.value().get(0).problemScopingQuestions()); - Assertions.assertEquals("bgsncghkjeszzhb", model.value().get(0).supportPlanId()); - Assertions.assertEquals("jhtxfvgxbfsmxne", model.value().get(0).contactDetails().firstName()); - Assertions.assertEquals("mpvecxgodebfqk", model.value().get(0).contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, + Assertions.assertEquals(Consent.NO, model.value().get(0).advancedDiagnosticConsent()); + Assertions.assertEquals("wbnguitnwui", model.value().get(0).problemScopingQuestions()); + Assertions.assertEquals("a", model.value().get(0).supportPlanId()); + Assertions.assertEquals("x", model.value().get(0).contactDetails().firstName()); + Assertions.assertEquals("fizuckyf", model.value().get(0).contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.value().get(0).contactDetails().preferredContactMethod()); - Assertions.assertEquals("bmpukgriwflz", model.value().get(0).contactDetails().primaryEmailAddress()); - Assertions.assertEquals("xzpuzycisp", model.value().get(0).contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("ibnuqqkpik", model.value().get(0).contactDetails().phoneNumber()); - Assertions.assertEquals("drgvtqagn", model.value().get(0).contactDetails().preferredTimeZone()); - Assertions.assertEquals("uynhijg", model.value().get(0).contactDetails().country()); - Assertions.assertEquals("mebf", model.value().get(0).contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("kx", model.value().get(0).title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T20:18:56Z"), model.value().get(0).problemStartTime()); - Assertions.assertEquals("k", model.value().get(0).serviceId()); - Assertions.assertEquals("yxczfclh", model.value().get(0).fileWorkspaceName()); - Assertions.assertEquals("abphlw", model.value().get(0).technicalTicketDetails().resourceId()); - Assertions.assertEquals("fkts", model.value().get(0).quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("sucocmnyyazttbtw", - model.value().get(0).quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals(UserConsent.NO, model.value().get(0).secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("kzywbiex", model.value().get(0).secondaryConsent().get(0).type()); - Assertions.assertEquals("fudwpznt", model.nextLink()); + Assertions.assertEquals("rfidfvzwdz", model.value().get(0).contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ymwisdkft", model.value().get(0).contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("xmnteiwaop", model.value().get(0).contactDetails().phoneNumber()); + Assertions.assertEquals("km", model.value().get(0).contactDetails().preferredTimeZone()); + Assertions.assertEquals("jcmmxdcufufsrp", model.value().get(0).contactDetails().country()); + Assertions.assertEquals("mzidnsezcxtb", model.value().get(0).contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("inpvswjdkirsoodq", model.value().get(0).title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-12T18:06:29Z"), model.value().get(0).problemStartTime()); + Assertions.assertEquals("rmnohj", model.value().get(0).serviceId()); + Assertions.assertEquals("cjxvsnbyxqab", model.value().get(0).fileWorkspaceName()); + Assertions.assertEquals("cyshurzafbljjgp", model.value().get(0).technicalTicketDetails().resourceId()); + Assertions.assertEquals("qcjm", model.value().get(0).quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("javbqidtqajz", model.value().get(0).quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals(UserConsent.YES, model.value().get(0).secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("krlkhbzhfepg", model.value().get(0).secondaryConsent().get(0).type()); + Assertions.assertEquals("lpbuxwgipwhonowk", model.nextLink()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java index a7f821846b18..00ae701aee83 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests.java @@ -6,50 +6,32 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; import com.azure.resourcemanager.support.models.Type; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); + String responseStr = "{\"nameAvailable\":false,\"reason\":\"zbzkdvncjabudurg\",\"message\":\"kmokz\"}"; - String responseStr = "{\"nameAvailable\":false,\"reason\":\"vazivjlfr\",\"message\":\"tbajlkatn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); CheckNameAvailabilityOutput response = manager.supportTicketsNoSubscriptions() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("rxcpjuisavo") + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("ystawfsdjpvkvp") .withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCreateMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCreateMockTests.java index 1a67a4813b20..6cfecae02c8e 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCreateMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsCreateMockTests.java @@ -6,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; import com.azure.resourcemanager.support.models.Consent; @@ -25,94 +23,91 @@ import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.TechnicalTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; 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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsNoSubscriptionsCreateMockTests { @Test public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"supportTicketId\":\"whcans\",\"description\":\"moy\",\"problemClassificationId\":\"hlwigdivbkbxg\",\"problemClassificationDisplayName\":\"fajuwas\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"aeyyg\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"qzhzbezkgimsi\",\"supportPlanId\":\"asi\",\"contactDetails\":{\"firstName\":\"ddyvvjskgfmo\",\"lastName\":\"wa\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"qgatjeaahhvjhhn\",\"additionalEmailAddresses\":[\"ybbjjidjksyx\",\"yxvxevblbjed\"],\"phoneNumber\":\"jlageu\",\"preferredTimeZone\":\"ulxunsmjbnkpp\",\"country\":\"ynenlsvxeizz\",\"preferredSupportLanguage\":\"wklnsrmffeyc\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-01-27T19:40:34Z\",\"expirationTime\":\"2021-04-28T21:28:59Z\",\"slaMinutes\":1424863309},\"supportEngineer\":{\"emailAddress\":\"teeammxqiekkkzd\"},\"supportPlanType\":\"tkgdojbmxva\",\"supportPlanDisplayName\":\"efdeesve\",\"title\":\"uij\",\"problemStartTime\":\"2021-07-17T21:24:41Z\",\"serviceId\":\"xs\",\"serviceDisplayName\":\"prtujwsawdd\",\"status\":\"babxvitit\",\"createdDate\":\"2020-12-21T14:24:59Z\",\"modifiedDate\":\"2021-02-16T14:52:22Z\",\"fileWorkspaceName\":\"avoxtfg\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"dqbwpypqtgsfja\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"lhhxudbxvodhtnsi\",\"quotaChangeRequestVersion\":\"dhzmmesckdlp\",\"quotaChangeRequests\":[{\"region\":\"cxfailcfxwmdboxd\",\"payload\":\"sftufqobrjlna\"},{\"region\":\"cc\",\"payload\":\"nhxk\"},{\"region\":\"v\",\"payload\":\"nrzvuljraaer\"},{\"region\":\"okqgukkjq\",\"payload\":\"broyla\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"isdos\"},{\"userConsent\":\"Yes\",\"type\":\"svgjrwhryvy\"},{\"userConsent\":\"Yes\",\"type\":\"c\"}]},\"id\":\"xgccknfnw\",\"name\":\"btmvpdvjdhttza\",\"type\":\"fedxihchrphkm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"supportTicketId\":\"hzlhplodqkdlww\",\"description\":\"fbumlkx\",\"problemClassificationId\":\"rqjfsmlm\",\"problemClassificationDisplayName\":\"xhwgfwsrtaw\",\"severity\":\"critical\",\"enrollmentId\":\"zbrhubskhudyg\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"qfqjbvleorfm\",\"supportPlanId\":\"iqtqzfavyvnq\",\"contactDetails\":{\"firstName\":\"ybar\",\"lastName\":\"euayjkqabqgzsles\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"bhernntiew\",\"additionalEmailAddresses\":[\"vbquwr\"],\"phoneNumber\":\"hwagohbuffkmrqe\",\"preferredTimeZone\":\"vvhmxtdrj\",\"country\":\"utacoe\",\"preferredSupportLanguage\":\"jvewzcjznmwcp\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-11-24T12:45:46Z\",\"expirationTime\":\"2021-09-25T00:56:36Z\",\"slaMinutes\":1984994243},\"supportEngineer\":{\"emailAddress\":\"actkahzovajj\"},\"supportPlanType\":\"uxxpshne\",\"supportPlanDisplayName\":\"ulfgslqu\",\"title\":\"kwdlenrdsutujba\",\"problemStartTime\":\"2021-06-27T02:39:57Z\",\"serviceId\":\"uo\",\"serviceDisplayName\":\"inyflnorwmduvwp\",\"status\":\"vxwmygd\",\"createdDate\":\"2021-04-18T03:22:57Z\",\"modifiedDate\":\"2021-01-04T00:18:57Z\",\"fileWorkspaceName\":\"hiszepnnbjcrxgib\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"onfo\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"orsukokwbqp\",\"quotaChangeRequestVersion\":\"lvnuuepzlrph\",\"quotaChangeRequests\":[{\"region\":\"l\",\"payload\":\"eyuqdunvmnnrwr\"},{\"region\":\"ork\",\"payload\":\"lywjhh\"},{\"region\":\"nhxmsi\",\"payload\":\"omi\"},{\"region\":\"xggdufi\",\"payload\":\"dieuzaofj\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"ys\"}]},\"id\":\"gdotcubiipuipwo\",\"name\":\"onmacjekniz\",\"type\":\"hqvcimpevfgmblr\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); - SupportTicketDetails response = manager.supportTicketsNoSubscriptions().create("limmbcxf", - new SupportTicketDetailsInner().withSupportTicketId("po").withDescription("xvxcjzhq") - .withProblemClassificationId("zxfpxtgqsc").withSeverity(SeverityLevel.CRITICAL).withEnrollmentId("k") - .withRequire24X7Response(false).withAdvancedDiagnosticConsent(Consent.YES) - .withProblemScopingQuestions("pijrajcivmmghf").withSupportPlanId("iwrxgkn") - .withContactDetails(new ContactProfile().withFirstName("uvyinzqodfvpgs").withLastName("oxgsgbpfgzdjtx") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("flbqvgaq") - .withAdditionalEmailAddresses(Arrays.asList("a", "cqusr")).withPhoneNumber("etnwsdtutnw") - .withPreferredTimeZone("duy").withCountry("vuzhyr").withPreferredSupportLanguage("ewipm")) - .withServiceLevelAgreement(new ServiceLevelAgreement()).withSupportEngineer(new SupportEngineer()) - .withTitle("qsxvmhf").withProblemStartTime(OffsetDateTime.parse("2021-07-26T18:31:56Z")) - .withServiceId("jyihsasbhudypo").withFileWorkspaceName("tyms") - .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("dnfwqzdzg")) - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("axhnfh") - .withQuotaChangeRequestVersion("yvi").withQuotaChangeRequests( - Arrays.asList(new QuotaChangeRequest().withRegion("iv").withPayload("oyzunbixxr"), - new QuotaChangeRequest().withRegion("kvcpwpgclr").withPayload("vtsoxf")))) + SupportTicketDetails response = manager.supportTicketsNoSubscriptions() + .create("cotmr", new SupportTicketDetailsInner().withSupportTicketId("irctymoxoftpipiw") + .withDescription("czuhxacpqjlihh") + .withProblemClassificationId("usps") + .withSeverity(SeverityLevel.CRITICAL) + .withEnrollmentId("rsre") + .withRequire24X7Response(true) + .withAdvancedDiagnosticConsent(Consent.NO) + .withProblemScopingQuestions("risjnhnytxifqjz") + .withSupportPlanId("mrhublwpc") + .withContactDetails(new ContactProfile().withFirstName("sutrgjup") + .withLastName("uutpwoqhih") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("qg") + .withAdditionalEmailAddresses(Arrays.asList("nfqn", "cypsxjv", "oimwkslirc")) + .withPhoneNumber("jxv") + .withPreferredTimeZone("dfcea") + .withCountry("vlhv") + .withPreferredSupportLanguage("gdyftumrtwna")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("ydv") + .withProblemStartTime(OffsetDateTime.parse("2021-08-31T10:25:05Z")) + .withServiceId("ejd") + .withFileWorkspaceName("novqfzge") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("uljltduceamtmcz")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("ejwcwwqiok") + .withQuotaChangeRequestVersion("sx") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("sv").withPayload("jpr"), + new QuotaChangeRequest().withRegion("wcfzqljyxgt").withPayload("heyd")))) .withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("m"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("rpmpdnqqskaw"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("mmbnpqfrtql"))), - com.azure.core.util.Context.NONE); + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("kx"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("vbbxuripl"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("tbaxk"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("rc"))), + com.azure.core.util.Context.NONE); - Assertions.assertEquals("whcans", response.supportTicketId()); - Assertions.assertEquals("moy", response.description()); - Assertions.assertEquals("hlwigdivbkbxg", response.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, response.severity()); - Assertions.assertEquals("aeyyg", response.enrollmentId()); - Assertions.assertEquals(false, response.require24X7Response()); + Assertions.assertEquals("hzlhplodqkdlww", response.supportTicketId()); + Assertions.assertEquals("fbumlkx", response.description()); + Assertions.assertEquals("rqjfsmlm", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.CRITICAL, response.severity()); + Assertions.assertEquals("zbrhubskhudyg", response.enrollmentId()); + Assertions.assertEquals(true, response.require24X7Response()); Assertions.assertEquals(Consent.NO, response.advancedDiagnosticConsent()); - Assertions.assertEquals("qzhzbezkgimsi", response.problemScopingQuestions()); - Assertions.assertEquals("asi", response.supportPlanId()); - Assertions.assertEquals("ddyvvjskgfmo", response.contactDetails().firstName()); - Assertions.assertEquals("wa", response.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.EMAIL, response.contactDetails().preferredContactMethod()); - Assertions.assertEquals("qgatjeaahhvjhhn", response.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("ybbjjidjksyx", response.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("jlageu", response.contactDetails().phoneNumber()); - Assertions.assertEquals("ulxunsmjbnkpp", response.contactDetails().preferredTimeZone()); - Assertions.assertEquals("ynenlsvxeizz", response.contactDetails().country()); - Assertions.assertEquals("wklnsrmffeyc", response.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("uij", response.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T21:24:41Z"), response.problemStartTime()); - Assertions.assertEquals("xs", response.serviceId()); - Assertions.assertEquals("avoxtfg", response.fileWorkspaceName()); - Assertions.assertEquals("dqbwpypqtgsfja", response.technicalTicketDetails().resourceId()); - Assertions.assertEquals("lhhxudbxvodhtnsi", response.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("dhzmmesckdlp", response.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("cxfailcfxwmdboxd", - response.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("sftufqobrjlna", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); - Assertions.assertEquals(UserConsent.YES, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("isdos", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("qfqjbvleorfm", response.problemScopingQuestions()); + Assertions.assertEquals("iqtqzfavyvnq", response.supportPlanId()); + Assertions.assertEquals("ybar", response.contactDetails().firstName()); + Assertions.assertEquals("euayjkqabqgzsles", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("bhernntiew", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("vbquwr", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("hwagohbuffkmrqe", response.contactDetails().phoneNumber()); + Assertions.assertEquals("vvhmxtdrj", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("utacoe", response.contactDetails().country()); + Assertions.assertEquals("jvewzcjznmwcp", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("kwdlenrdsutujba", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T02:39:57Z"), response.problemStartTime()); + Assertions.assertEquals("uo", response.serviceId()); + Assertions.assertEquals("hiszepnnbjcrxgib", response.fileWorkspaceName()); + Assertions.assertEquals("onfo", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("orsukokwbqp", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("lvnuuepzlrph", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("l", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("eyuqdunvmnnrwr", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("ys", response.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsGetWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsGetWithResponseMockTests.java index 9c6d5ea601e4..bb6be7bfd60f 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsGetWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsGetWithResponseMockTests.java @@ -6,83 +6,66 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"supportTicketId\":\"wk\",\"description\":\"ziycslevufuztck\",\"problemClassificationId\":\"yhjtqedcgzu\",\"problemClassificationDisplayName\":\"mmrqz\",\"severity\":\"minimal\",\"enrollmentId\":\"jvpglydzgk\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"toepryu\",\"supportPlanId\":\"wytpzdmovz\",\"contactDetails\":{\"firstName\":\"fvaawzqa\",\"lastName\":\"f\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"z\",\"additionalEmailAddresses\":[\"glae\",\"xndticokpvzmlqtm\"],\"phoneNumber\":\"gxobfirclnp\",\"preferredTimeZone\":\"ciayzriykhya\",\"country\":\"fvjlboxqvkjlmx\",\"preferredSupportLanguage\":\"omdynhdwdigum\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-04-19T06:10:37Z\",\"expirationTime\":\"2021-03-17T09:36:38Z\",\"slaMinutes\":171373878},\"supportEngineer\":{\"emailAddress\":\"jazysdzhezwwvaiq\"},\"supportPlanType\":\"vv\",\"supportPlanDisplayName\":\"nk\",\"title\":\"hhqyi\",\"problemStartTime\":\"2021-06-02T22:13:33Z\",\"serviceId\":\"lauyav\",\"serviceDisplayName\":\"wmn\",\"status\":\"ttijfybvpoekrs\",\"createdDate\":\"2021-08-10T11:56:32Z\",\"modifiedDate\":\"2021-03-10T00:22:05Z\",\"fileWorkspaceName\":\"uzqgnjdgkynsc\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"vhxnk\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"kubotppnvdxz\",\"quotaChangeRequestVersion\":\"ihfrbbcevqa\",\"quotaChangeRequests\":[{\"region\":\"dhlfkqojpykvgt\",\"payload\":\"cnifm\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"brn\"},{\"userConsent\":\"Yes\",\"type\":\"m\"}]},\"id\":\"rafwgckhocxvdf\",\"name\":\"fwafqrouda\",\"type\":\"pavehhr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"supportTicketId\":\"pfcqdp\",\"description\":\"qxqvpsvuoymgc\",\"problemClassificationId\":\"elvezrypq\",\"problemClassificationDisplayName\":\"feo\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"qwkyhkobop\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"owepbqpcrfkb\",\"supportPlanId\":\"csnjvcdwxlpqekft\",\"contactDetails\":{\"firstName\":\"khtj\",\"lastName\":\"y\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"gwfqatmt\",\"additionalEmailAddresses\":[\"mdvy\",\"gikdgsz\",\"w\"],\"phoneNumber\":\"irryuzhlh\",\"preferredTimeZone\":\"joqrvqqaatj\",\"country\":\"nrvgoupmfiibfgg\",\"preferredSupportLanguage\":\"ioolvrwxkvtkkgll\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-01-21T12:15:37Z\",\"expirationTime\":\"2021-08-08T04:13:54Z\",\"slaMinutes\":1394665734},\"supportEngineer\":{\"emailAddress\":\"blmhvkzuhb\"},\"supportPlanType\":\"vyhgs\",\"supportPlanDisplayName\":\"byrqufeg\",\"title\":\"uvwzfbnh\",\"problemStartTime\":\"2021-03-19T20:32:18Z\",\"serviceId\":\"tlpdn\",\"serviceDisplayName\":\"tvgbmhrixkwmy\",\"status\":\"ejvegrhbpnaixex\",\"createdDate\":\"2021-02-01T22:21:46Z\",\"modifiedDate\":\"2020-12-28T17:34:21Z\",\"fileWorkspaceName\":\"ax\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"rrvqa\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"ghtpw\",\"quotaChangeRequestVersion\":\"nhyjsv\",\"quotaChangeRequests\":[{\"region\":\"z\",\"payload\":\"voowvr\"},{\"region\":\"t\",\"payload\":\"qp\"},{\"region\":\"ostronz\",\"payload\":\"hgfipnsxkmcw\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"reafxtsgumhjg\"},{\"userConsent\":\"Yes\",\"type\":\"xwslolbqpv\"}]},\"id\":\"zlmvfelfktgp\",\"name\":\"crpw\",\"type\":\"xeznoi\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); SupportTicketDetails response = manager.supportTicketsNoSubscriptions() - .getWithResponse("zapeewchpx", com.azure.core.util.Context.NONE).getValue(); + .getWithResponse("semdwzrmu", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("wk", response.supportTicketId()); - Assertions.assertEquals("ziycslevufuztck", response.description()); - Assertions.assertEquals("yhjtqedcgzu", response.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.MINIMAL, response.severity()); - Assertions.assertEquals("jvpglydzgk", response.enrollmentId()); - Assertions.assertEquals(false, response.require24X7Response()); + Assertions.assertEquals("pfcqdp", response.supportTicketId()); + Assertions.assertEquals("qxqvpsvuoymgc", response.description()); + Assertions.assertEquals("elvezrypq", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, response.severity()); + Assertions.assertEquals("qwkyhkobop", response.enrollmentId()); + Assertions.assertEquals(true, response.require24X7Response()); Assertions.assertEquals(Consent.YES, response.advancedDiagnosticConsent()); - Assertions.assertEquals("toepryu", response.problemScopingQuestions()); - Assertions.assertEquals("wytpzdmovz", response.supportPlanId()); - Assertions.assertEquals("fvaawzqa", response.contactDetails().firstName()); - Assertions.assertEquals("f", response.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, response.contactDetails().preferredContactMethod()); - Assertions.assertEquals("z", response.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("glae", response.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("gxobfirclnp", response.contactDetails().phoneNumber()); - Assertions.assertEquals("ciayzriykhya", response.contactDetails().preferredTimeZone()); - Assertions.assertEquals("fvjlboxqvkjlmx", response.contactDetails().country()); - Assertions.assertEquals("omdynhdwdigum", response.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("hhqyi", response.title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-02T22:13:33Z"), response.problemStartTime()); - Assertions.assertEquals("lauyav", response.serviceId()); - Assertions.assertEquals("uzqgnjdgkynsc", response.fileWorkspaceName()); - Assertions.assertEquals("vhxnk", response.technicalTicketDetails().resourceId()); - Assertions.assertEquals("kubotppnvdxz", response.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("ihfrbbcevqa", response.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("dhlfkqojpykvgt", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("cnifm", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals("owepbqpcrfkb", response.problemScopingQuestions()); + Assertions.assertEquals("csnjvcdwxlpqekft", response.supportPlanId()); + Assertions.assertEquals("khtj", response.contactDetails().firstName()); + Assertions.assertEquals("y", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("gwfqatmt", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("mdvy", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("irryuzhlh", response.contactDetails().phoneNumber()); + Assertions.assertEquals("joqrvqqaatj", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("nrvgoupmfiibfgg", response.contactDetails().country()); + Assertions.assertEquals("ioolvrwxkvtkkgll", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("uvwzfbnh", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-19T20:32:18Z"), response.problemStartTime()); + Assertions.assertEquals("tlpdn", response.serviceId()); + Assertions.assertEquals("ax", response.fileWorkspaceName()); + Assertions.assertEquals("rrvqa", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("ghtpw", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("nhyjsv", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("z", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("voowvr", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("brn", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("reafxtsgumhjg", response.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsListMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsListMockTests.java index b700a5266d02..bf38054f5766 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsListMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsListMockTests.java @@ -6,89 +6,73 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; 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.support.SupportManager; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsNoSubscriptionsListMockTests { @Test public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"value\":[{\"properties\":{\"supportTicketId\":\"qfkuvscxkdmli\",\"description\":\"ovibrxkp\",\"problemClassificationId\":\"loazuruocbgoo\",\"problemClassificationDisplayName\":\"te\",\"severity\":\"moderate\",\"enrollmentId\":\"fhjxakvvjgs\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"mywwtkgkxnyed\",\"supportPlanId\":\"gyvudtjuewbc\",\"contactDetails\":{\"firstName\":\"hxuuwhcjyxccybvp\",\"lastName\":\"yakk\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"zp\",\"additionalEmailAddresses\":[\"jplmagstcy\",\"hpfkyrkdbdgi\"],\"phoneNumber\":\"sjkmnwqj\",\"preferredTimeZone\":\"obaiyhddviaceg\",\"country\":\"n\",\"preferredSupportLanguage\":\"ntfpmvmemfnc\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-02-26T10:32:08Z\",\"expirationTime\":\"2021-03-30T03:39:15Z\",\"slaMinutes\":128886656},\"supportEngineer\":{\"emailAddress\":\"l\"},\"supportPlanType\":\"hpodbzev\",\"supportPlanDisplayName\":\"dnhfuk\",\"title\":\"vsjcswsmystuluqy\",\"problemStartTime\":\"2021-07-06T16:20:37Z\",\"serviceId\":\"vlerchpqbmfpjba\",\"serviceDisplayName\":\"idfcxsspuunnoxyh\",\"status\":\"g\",\"createdDate\":\"2021-07-24T05:54:49Z\",\"modifiedDate\":\"2020-12-28T12:46:28Z\",\"fileWorkspaceName\":\"fhoqca\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"omdjvlpjxxkzbrm\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"ivsiy\",\"quotaChangeRequestVersion\":\"kdncj\",\"quotaChangeRequests\":[{\"region\":\"bzo\",\"payload\":\"culapzwyrpgogtq\"},{\"region\":\"pnylb\",\"payload\":\"ajlyjtlvofqzhv\"},{\"region\":\"ibyfmo\",\"payload\":\"xrkjpvdw\"},{\"region\":\"zwiivwzjbhyzs\",\"payload\":\"rkambt\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"nvuqeqvldspa\"}]},\"id\":\"tjb\",\"name\":\"kdmflvestmjlx\",\"type\":\"ril\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"value\":[{\"properties\":{\"supportTicketId\":\"fhmouwq\",\"description\":\"gzrf\",\"problemClassificationId\":\"eeyebi\",\"problemClassificationDisplayName\":\"kayuhqlbjbs\",\"severity\":\"critical\",\"enrollmentId\":\"qwrvtldgmfp\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"paslthaqfxssmwu\",\"supportPlanId\":\"bdsrez\",\"contactDetails\":{\"firstName\":\"drhneuyow\",\"lastName\":\"kdw\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"i\",\"additionalEmailAddresses\":[\"ircgpikpz\"],\"phoneNumber\":\"ejzanlfz\",\"preferredTimeZone\":\"iavrm\",\"country\":\"zonokixrjqci\",\"preferredSupportLanguage\":\"gzpfrla\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-07-24T19:53:33Z\",\"expirationTime\":\"2021-05-24T12:41:33Z\",\"slaMinutes\":755855856},\"supportEngineer\":{\"emailAddress\":\"dfpwpjylwbtlhfls\"},\"supportPlanType\":\"dhszfjv\",\"supportPlanDisplayName\":\"gofel\",\"title\":\"a\",\"problemStartTime\":\"2021-09-13T20:46:53Z\",\"serviceId\":\"mqhldvrii\",\"serviceDisplayName\":\"jnalghf\",\"status\":\"tvsexsowuel\",\"createdDate\":\"2021-11-06T19:32:24Z\",\"modifiedDate\":\"2021-09-24T19:31:57Z\",\"fileWorkspaceName\":\"hxvrhmzkwpjg\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"ghftqsxhqxujxuk\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"digrjguufzdmsyqt\",\"quotaChangeRequestVersion\":\"hwhbotzingamv\",\"quotaChangeRequests\":[{\"region\":\"szqzudphqamv\",\"payload\":\"fwynwcvtbvkay\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"qiatkzwpcnp\"},{\"userConsent\":\"No\",\"type\":\"a\"},{\"userConsent\":\"Yes\",\"type\":\"v\"}]},\"id\":\"ccyajg\",\"name\":\"qfhwyg\",\"type\":\"lvdnkfx\"}]}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); PagedIterable response - = manager.supportTicketsNoSubscriptions().list(1264491301, "yiopi", com.azure.core.util.Context.NONE); + = manager.supportTicketsNoSubscriptions().list(1557744046, "jk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("qfkuvscxkdmli", response.iterator().next().supportTicketId()); - Assertions.assertEquals("ovibrxkp", response.iterator().next().description()); - Assertions.assertEquals("loazuruocbgoo", response.iterator().next().problemClassificationId()); - Assertions.assertEquals(SeverityLevel.MODERATE, response.iterator().next().severity()); - Assertions.assertEquals("fhjxakvvjgs", response.iterator().next().enrollmentId()); - Assertions.assertEquals(false, response.iterator().next().require24X7Response()); + Assertions.assertEquals("fhmouwq", response.iterator().next().supportTicketId()); + Assertions.assertEquals("gzrf", response.iterator().next().description()); + Assertions.assertEquals("eeyebi", response.iterator().next().problemClassificationId()); + Assertions.assertEquals(SeverityLevel.CRITICAL, response.iterator().next().severity()); + Assertions.assertEquals("qwrvtldgmfp", response.iterator().next().enrollmentId()); + Assertions.assertEquals(true, response.iterator().next().require24X7Response()); Assertions.assertEquals(Consent.YES, response.iterator().next().advancedDiagnosticConsent()); - Assertions.assertEquals("mywwtkgkxnyed", response.iterator().next().problemScopingQuestions()); - Assertions.assertEquals("gyvudtjuewbc", response.iterator().next().supportPlanId()); - Assertions.assertEquals("hxuuwhcjyxccybvp", response.iterator().next().contactDetails().firstName()); - Assertions.assertEquals("yakk", response.iterator().next().contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, + Assertions.assertEquals("paslthaqfxssmwu", response.iterator().next().problemScopingQuestions()); + Assertions.assertEquals("bdsrez", response.iterator().next().supportPlanId()); + Assertions.assertEquals("drhneuyow", response.iterator().next().contactDetails().firstName()); + Assertions.assertEquals("kdw", response.iterator().next().contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, response.iterator().next().contactDetails().preferredContactMethod()); - Assertions.assertEquals("zp", response.iterator().next().contactDetails().primaryEmailAddress()); - Assertions.assertEquals("jplmagstcy", + Assertions.assertEquals("i", response.iterator().next().contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ircgpikpz", response.iterator().next().contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("sjkmnwqj", response.iterator().next().contactDetails().phoneNumber()); - Assertions.assertEquals("obaiyhddviaceg", response.iterator().next().contactDetails().preferredTimeZone()); - Assertions.assertEquals("n", response.iterator().next().contactDetails().country()); - Assertions.assertEquals("ntfpmvmemfnc", response.iterator().next().contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("vsjcswsmystuluqy", response.iterator().next().title()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:20:37Z"), + Assertions.assertEquals("ejzanlfz", response.iterator().next().contactDetails().phoneNumber()); + Assertions.assertEquals("iavrm", response.iterator().next().contactDetails().preferredTimeZone()); + Assertions.assertEquals("zonokixrjqci", response.iterator().next().contactDetails().country()); + Assertions.assertEquals("gzpfrla", response.iterator().next().contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("a", response.iterator().next().title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-13T20:46:53Z"), response.iterator().next().problemStartTime()); - Assertions.assertEquals("vlerchpqbmfpjba", response.iterator().next().serviceId()); - Assertions.assertEquals("fhoqca", response.iterator().next().fileWorkspaceName()); - Assertions.assertEquals("omdjvlpjxxkzbrm", response.iterator().next().technicalTicketDetails().resourceId()); - Assertions.assertEquals("ivsiy", response.iterator().next().quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("kdncj", response.iterator().next().quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("bzo", + Assertions.assertEquals("mqhldvrii", response.iterator().next().serviceId()); + Assertions.assertEquals("hxvrhmzkwpjg", response.iterator().next().fileWorkspaceName()); + Assertions.assertEquals("ghftqsxhqxujxuk", response.iterator().next().technicalTicketDetails().resourceId()); + Assertions.assertEquals("digrjguufzdmsyqt", + response.iterator().next().quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("hwhbotzingamv", + response.iterator().next().quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("szqzudphqamv", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("culapzwyrpgogtq", + Assertions.assertEquals("fwynwcvtbvkay", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.YES, response.iterator().next().secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("nvuqeqvldspa", response.iterator().next().secondaryConsent().get(0).type()); + Assertions.assertEquals("qiatkzwpcnp", response.iterator().next().secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsUpdateWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsUpdateWithResponseMockTests.java index 98f4eedca36d..e35488ac1fc3 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsUpdateWithResponseMockTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionsUpdateWithResponseMockTests.java @@ -6,11 +6,9 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.PreferredContactMethod; @@ -21,84 +19,76 @@ import com.azure.resourcemanager.support.models.UpdateContactProfile; import com.azure.resourcemanager.support.models.UpdateSupportTicket; import com.azure.resourcemanager.support.models.UserConsent; -import java.nio.ByteBuffer; 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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; public final class SupportTicketsNoSubscriptionsUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - String responseStr - = "{\"properties\":{\"supportTicketId\":\"qwogfnzjvus\",\"description\":\"zldmozuxy\",\"problemClassificationId\":\"fsbtkad\",\"problemClassificationDisplayName\":\"s\",\"severity\":\"minimal\",\"enrollmentId\":\"btgkbugrjqctoj\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"ieypef\",\"supportPlanId\":\"yqdhcuplcplcw\",\"contactDetails\":{\"firstName\":\"hihihlhzdsqtzbsr\",\"lastName\":\"nowc\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"fgmvecactxmwo\",\"additionalEmailAddresses\":[\"owcluqo\"],\"phoneNumber\":\"kqvgqouw\",\"preferredTimeZone\":\"fzmpjwyivq\",\"country\":\"kfxcvhrfs\",\"preferredSupportLanguage\":\"huagrttikteusqc\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-12-08T16:17:07Z\",\"expirationTime\":\"2021-07-05T09:11:28Z\",\"slaMinutes\":505977286},\"supportEngineer\":{\"emailAddress\":\"jaffmmfblcqcuu\"},\"supportPlanType\":\"qibrtalme\",\"supportPlanDisplayName\":\"t\",\"title\":\"gdslqxihhrmoo\",\"problemStartTime\":\"2020-12-28T03:13:13Z\",\"serviceId\":\"seypxiutcxapz\",\"serviceDisplayName\":\"rpetogebjoxsl\",\"status\":\"nhl\",\"createdDate\":\"2021-03-04T02:03:13Z\",\"modifiedDate\":\"2021-09-04T15:55:16Z\",\"fileWorkspaceName\":\"kzjcjbtrgae\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"rxjjstoqbeitpk\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"moob\",\"quotaChangeRequestVersion\":\"ft\",\"quotaChangeRequests\":[{\"region\":\"cwq\",\"payload\":\"imaq\"},{\"region\":\"hemjy\",\"payload\":\"hujswtwkozzwcul\"},{\"region\":\"awpfajnjwltlwtjj\",\"payload\":\"ktalhsnvkcdmxz\"},{\"region\":\"oaimlnw\",\"payload\":\"aomylwea\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"thwwn\"},{\"userConsent\":\"Yes\",\"type\":\"fz\"},{\"userConsent\":\"Yes\",\"type\":\"hwahfbousn\"}]},\"id\":\"epgfew\",\"name\":\"twly\",\"type\":\"gncxykxhdj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); + = "{\"properties\":{\"supportTicketId\":\"dscwxqupevzhf\",\"description\":\"totxhojujb\",\"problemClassificationId\":\"pelmcuvhixbjxyf\",\"problemClassificationDisplayName\":\"yl\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"o\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"kiwkkbnujr\",\"supportPlanId\":\"vtylbfpncu\",\"contactDetails\":{\"firstName\":\"doiwi\",\"lastName\":\"thtywub\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"bihwqknfdnt\",\"additionalEmailAddresses\":[\"hrdgoihxumwcto\",\"dzjlu\",\"dfdlwggyts\",\"wtovvtgsein\"],\"phoneNumber\":\"iufxqknpir\",\"preferredTimeZone\":\"nepttwqmsni\",\"country\":\"fcdmqnrojlpijn\",\"preferredSupportLanguage\":\"rxfrddhc\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-10-24T17:40:19Z\",\"expirationTime\":\"2021-08-13T20:41:57Z\",\"slaMinutes\":99900434},\"supportEngineer\":{\"emailAddress\":\"sxiftozq\"},\"supportPlanType\":\"hftwesgog\",\"supportPlanDisplayName\":\"honnxkrlgnyhmos\",\"title\":\"xkk\",\"problemStartTime\":\"2021-10-30T19:25:09Z\",\"serviceId\":\"rrghxjbdhqxvcxgf\",\"serviceDisplayName\":\"dsofbshrns\",\"status\":\"uswdv\",\"createdDate\":\"2021-07-28T13:53:22Z\",\"modifiedDate\":\"2021-02-22T05:56:13Z\",\"fileWorkspaceName\":\"nu\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"tkfa\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"pqgik\",\"quotaChangeRequestVersion\":\"irtx\",\"quotaChangeRequests\":[{\"region\":\"zejntps\",\"payload\":\"gioilqu\"},{\"region\":\"ydxtqm\",\"payload\":\"ox\"},{\"region\":\"ggufhyaomtb\",\"payload\":\"havgrvk\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"hpjbib\"},{\"userConsent\":\"No\",\"type\":\"xumvfcluyovw\"},{\"userConsent\":\"No\",\"type\":\"fezzxscyhwzdg\"},{\"userConsent\":\"Yes\",\"type\":\"bzbomvzzbtdcqvpn\"}]},\"id\":\"yujviylwdshfssn\",\"name\":\"bgye\",\"type\":\"rymsgaojfmw\"}"; - SupportManager manager = SupportManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SupportManager manager = SupportManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureEnvironment.AZURE)); SupportTicketDetails response = manager.supportTicketsNoSubscriptions() - .updateWithResponse("kbunzoz", - new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL).withStatus(Status.OPEN) - .withContactDetails(new UpdateContactProfile().withFirstName("moy").withLastName("dyuib") - .withPreferredContactMethod(PreferredContactMethod.EMAIL).withPrimaryEmailAddress("nbzydvfvfcj") - .withAdditionalEmailAddresses(Arrays.asList("oisrvhmgorffu", "is", "vwmzhwplefaxvxil")) - .withPhoneNumber("tg").withPreferredTimeZone("nzeyqxtjj").withCountry("qlqhycavodg") - .withPreferredSupportLanguage("dbeesmie")) - .withAdvancedDiagnosticConsent(Consent.NO).withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("awiuagyd"), - new SecondaryConsent().withUserConsent(UserConsent.YES).withType("ylyrfgiagtco"))), + .updateWithResponse("brnjwmw", + new UpdateSupportTicket().withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withStatus(Status.OPEN) + .withContactDetails(new UpdateContactProfile().withFirstName("ejjoqkagfhsxtta") + .withLastName("zxnfaaz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("n") + .withAdditionalEmailAddresses(Arrays.asList("kqjjlwuenvrkp", "ou")) + .withPhoneNumber("bre") + .withPreferredTimeZone("aays") + .withCountry("ixqtn") + .withPreferredSupportLanguage("tezlwff")) + .withAdvancedDiagnosticConsent(Consent.NO) + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("qmt"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("mmji"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("zphv"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("qncygupkvi"))), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("qwogfnzjvus", response.supportTicketId()); - Assertions.assertEquals("zldmozuxy", response.description()); - Assertions.assertEquals("fsbtkad", response.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.MINIMAL, response.severity()); - Assertions.assertEquals("btgkbugrjqctoj", response.enrollmentId()); + Assertions.assertEquals("dscwxqupevzhf", response.supportTicketId()); + Assertions.assertEquals("totxhojujb", response.description()); + Assertions.assertEquals("pelmcuvhixbjxyf", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, response.severity()); + Assertions.assertEquals("o", response.enrollmentId()); Assertions.assertEquals(true, response.require24X7Response()); - Assertions.assertEquals(Consent.YES, response.advancedDiagnosticConsent()); - Assertions.assertEquals("ieypef", response.problemScopingQuestions()); - Assertions.assertEquals("yqdhcuplcplcw", response.supportPlanId()); - Assertions.assertEquals("hihihlhzdsqtzbsr", response.contactDetails().firstName()); - Assertions.assertEquals("nowc", response.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, response.contactDetails().preferredContactMethod()); - Assertions.assertEquals("fgmvecactxmwo", response.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("owcluqo", response.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("kqvgqouw", response.contactDetails().phoneNumber()); - Assertions.assertEquals("fzmpjwyivq", response.contactDetails().preferredTimeZone()); - Assertions.assertEquals("kfxcvhrfs", response.contactDetails().country()); - Assertions.assertEquals("huagrttikteusqc", response.contactDetails().preferredSupportLanguage()); - Assertions.assertEquals("gdslqxihhrmoo", response.title()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-28T03:13:13Z"), response.problemStartTime()); - Assertions.assertEquals("seypxiutcxapz", response.serviceId()); - Assertions.assertEquals("kzjcjbtrgae", response.fileWorkspaceName()); - Assertions.assertEquals("rxjjstoqbeitpk", response.technicalTicketDetails().resourceId()); - Assertions.assertEquals("moob", response.quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("ft", response.quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("cwq", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("imaq", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); - Assertions.assertEquals(UserConsent.YES, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("thwwn", response.secondaryConsent().get(0).type()); + Assertions.assertEquals(Consent.NO, response.advancedDiagnosticConsent()); + Assertions.assertEquals("kiwkkbnujr", response.problemScopingQuestions()); + Assertions.assertEquals("vtylbfpncu", response.supportPlanId()); + Assertions.assertEquals("doiwi", response.contactDetails().firstName()); + Assertions.assertEquals("thtywub", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("bihwqknfdnt", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("hrdgoihxumwcto", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("iufxqknpir", response.contactDetails().phoneNumber()); + Assertions.assertEquals("nepttwqmsni", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("fcdmqnrojlpijn", response.contactDetails().country()); + Assertions.assertEquals("rxfrddhc", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("xkk", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:25:09Z"), response.problemStartTime()); + Assertions.assertEquals("rrghxjbdhqxvcxgf", response.serviceId()); + Assertions.assertEquals("nu", response.fileWorkspaceName()); + Assertions.assertEquals("tkfa", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("pqgik", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("irtx", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("zejntps", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("gioilqu", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("hpjbib", response.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/TechnicalTicketDetailsTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/TechnicalTicketDetailsTests.java index f63ac4279efc..e481e9da077c 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/TechnicalTicketDetailsTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/TechnicalTicketDetailsTests.java @@ -12,14 +12,14 @@ public final class TechnicalTicketDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TechnicalTicketDetails model - = BinaryData.fromString("{\"resourceId\":\"johxcrsb\"}").toObject(TechnicalTicketDetails.class); - Assertions.assertEquals("johxcrsb", model.resourceId()); + = BinaryData.fromString("{\"resourceId\":\"dhmdua\"}").toObject(TechnicalTicketDetails.class); + Assertions.assertEquals("dhmdua", model.resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TechnicalTicketDetails model = new TechnicalTicketDetails().withResourceId("johxcrsb"); + TechnicalTicketDetails model = new TechnicalTicketDetails().withResourceId("dhmdua"); model = BinaryData.fromObject(model).toObject(TechnicalTicketDetails.class); - Assertions.assertEquals("johxcrsb", model.resourceId()); + Assertions.assertEquals("dhmdua", model.resourceId()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateContactProfileTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateContactProfileTests.java index fd7861f72a04..3a93b7c429ea 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateContactProfileTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateContactProfileTests.java @@ -14,34 +14,39 @@ public final class UpdateContactProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateContactProfile model = BinaryData.fromString( - "{\"firstName\":\"ets\",\"lastName\":\"szhedplvw\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"mwmbes\",\"additionalEmailAddresses\":[\"k\"],\"phoneNumber\":\"tppjflcx\",\"preferredTimeZone\":\"aokonzmnsik\",\"country\":\"kqze\",\"preferredSupportLanguage\":\"kdltfzxmhhvhg\"}") + "{\"firstName\":\"eualupjmkhf\",\"lastName\":\"bbcswsrtjri\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"pbewtghfgblcgwx\",\"additionalEmailAddresses\":[\"v\",\"hjkbegibtnmxieb\",\"waloayqcgwr\",\"zjuzgwyz\"],\"phoneNumber\":\"txon\",\"preferredTimeZone\":\"ts\",\"country\":\"jcbpwxqpsrknft\",\"preferredSupportLanguage\":\"vriuhprwmdyvx\"}") .toObject(UpdateContactProfile.class); - Assertions.assertEquals("ets", model.firstName()); - Assertions.assertEquals("szhedplvw", model.lastName()); + Assertions.assertEquals("eualupjmkhf", model.firstName()); + Assertions.assertEquals("bbcswsrtjri", model.lastName()); Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); - Assertions.assertEquals("mwmbes", model.primaryEmailAddress()); - Assertions.assertEquals("k", model.additionalEmailAddresses().get(0)); - Assertions.assertEquals("tppjflcx", model.phoneNumber()); - Assertions.assertEquals("aokonzmnsik", model.preferredTimeZone()); - Assertions.assertEquals("kqze", model.country()); - Assertions.assertEquals("kdltfzxmhhvhg", model.preferredSupportLanguage()); + Assertions.assertEquals("pbewtghfgblcgwx", model.primaryEmailAddress()); + Assertions.assertEquals("v", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("txon", model.phoneNumber()); + Assertions.assertEquals("ts", model.preferredTimeZone()); + Assertions.assertEquals("jcbpwxqpsrknft", model.country()); + Assertions.assertEquals("vriuhprwmdyvx", model.preferredSupportLanguage()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UpdateContactProfile model = new UpdateContactProfile().withFirstName("ets").withLastName("szhedplvw") - .withPreferredContactMethod(PreferredContactMethod.PHONE).withPrimaryEmailAddress("mwmbes") - .withAdditionalEmailAddresses(Arrays.asList("k")).withPhoneNumber("tppjflcx") - .withPreferredTimeZone("aokonzmnsik").withCountry("kqze").withPreferredSupportLanguage("kdltfzxmhhvhg"); + UpdateContactProfile model = new UpdateContactProfile().withFirstName("eualupjmkhf") + .withLastName("bbcswsrtjri") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("pbewtghfgblcgwx") + .withAdditionalEmailAddresses(Arrays.asList("v", "hjkbegibtnmxieb", "waloayqcgwr", "zjuzgwyz")) + .withPhoneNumber("txon") + .withPreferredTimeZone("ts") + .withCountry("jcbpwxqpsrknft") + .withPreferredSupportLanguage("vriuhprwmdyvx"); model = BinaryData.fromObject(model).toObject(UpdateContactProfile.class); - Assertions.assertEquals("ets", model.firstName()); - Assertions.assertEquals("szhedplvw", model.lastName()); + Assertions.assertEquals("eualupjmkhf", model.firstName()); + Assertions.assertEquals("bbcswsrtjri", model.lastName()); Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); - Assertions.assertEquals("mwmbes", model.primaryEmailAddress()); - Assertions.assertEquals("k", model.additionalEmailAddresses().get(0)); - Assertions.assertEquals("tppjflcx", model.phoneNumber()); - Assertions.assertEquals("aokonzmnsik", model.preferredTimeZone()); - Assertions.assertEquals("kqze", model.country()); - Assertions.assertEquals("kdltfzxmhhvhg", model.preferredSupportLanguage()); + Assertions.assertEquals("pbewtghfgblcgwx", model.primaryEmailAddress()); + Assertions.assertEquals("v", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("txon", model.phoneNumber()); + Assertions.assertEquals("ts", model.preferredTimeZone()); + Assertions.assertEquals("jcbpwxqpsrknft", model.country()); + Assertions.assertEquals("vriuhprwmdyvx", model.preferredSupportLanguage()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateSupportTicketTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateSupportTicketTests.java index 3b217fbf7ec3..042c765bbd81 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateSupportTicketTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UpdateSupportTicketTests.java @@ -20,49 +20,54 @@ public final class UpdateSupportTicketTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateSupportTicket model = BinaryData.fromString( - "{\"severity\":\"critical\",\"status\":\"closed\",\"contactDetails\":{\"firstName\":\"lqlfm\",\"lastName\":\"n\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"zpswiydmc\",\"additionalEmailAddresses\":[\"zdxss\",\"dbzm\",\"vdfznudaodvxzb\"],\"phoneNumber\":\"blylpstdbh\",\"preferredTimeZone\":\"srzdzucerscdn\",\"country\":\"evfiwjmygt\",\"preferredSupportLanguage\":\"slswtm\"},\"advancedDiagnosticConsent\":\"No\",\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"yqsemwa\"}]}") + "{\"severity\":\"highestcriticalimpact\",\"status\":\"open\",\"contactDetails\":{\"firstName\":\"ooxdjebwpuc\",\"lastName\":\"fvovbvmeuecivy\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"uojgj\",\"additionalEmailAddresses\":[\"ueiotwmcdyt\",\"x\",\"it\",\"nrjawgqwg\"],\"phoneNumber\":\"ni\",\"preferredTimeZone\":\"x\",\"country\":\"kpycgklwndnhjd\",\"preferredSupportLanguage\":\"whvylw\"},\"advancedDiagnosticConsent\":\"No\",\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"znbmpowuwprzq\"}]}") .toObject(UpdateSupportTicket.class); - Assertions.assertEquals(SeverityLevel.CRITICAL, model.severity()); - Assertions.assertEquals(Status.CLOSED, model.status()); - Assertions.assertEquals("lqlfm", model.contactDetails().firstName()); - Assertions.assertEquals("n", model.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod()); - Assertions.assertEquals("zpswiydmc", model.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("zdxss", model.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("blylpstdbh", model.contactDetails().phoneNumber()); - Assertions.assertEquals("srzdzucerscdn", model.contactDetails().preferredTimeZone()); - Assertions.assertEquals("evfiwjmygt", model.contactDetails().country()); - Assertions.assertEquals("slswtm", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); + Assertions.assertEquals(Status.OPEN, model.status()); + Assertions.assertEquals("ooxdjebwpuc", model.contactDetails().firstName()); + Assertions.assertEquals("fvovbvmeuecivy", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("uojgj", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ueiotwmcdyt", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("ni", model.contactDetails().phoneNumber()); + Assertions.assertEquals("x", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("kpycgklwndnhjd", model.contactDetails().country()); + Assertions.assertEquals("whvylw", model.contactDetails().preferredSupportLanguage()); Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); - Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("yqsemwa", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("znbmpowuwprzq", model.secondaryConsent().get(0).type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UpdateSupportTicket model = new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL) - .withStatus(Status.CLOSED) - .withContactDetails(new UpdateContactProfile().withFirstName("lqlfm").withLastName("n") - .withPreferredContactMethod(PreferredContactMethod.PHONE).withPrimaryEmailAddress("zpswiydmc") - .withAdditionalEmailAddresses(Arrays.asList("zdxss", "dbzm", "vdfznudaodvxzb")) - .withPhoneNumber("blylpstdbh").withPreferredTimeZone("srzdzucerscdn").withCountry("evfiwjmygt") - .withPreferredSupportLanguage("slswtm")) - .withAdvancedDiagnosticConsent(Consent.NO).withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("yqsemwa"))); + UpdateSupportTicket model = new UpdateSupportTicket().withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withStatus(Status.OPEN) + .withContactDetails(new UpdateContactProfile().withFirstName("ooxdjebwpuc") + .withLastName("fvovbvmeuecivy") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("uojgj") + .withAdditionalEmailAddresses(Arrays.asList("ueiotwmcdyt", "x", "it", "nrjawgqwg")) + .withPhoneNumber("ni") + .withPreferredTimeZone("x") + .withCountry("kpycgklwndnhjd") + .withPreferredSupportLanguage("whvylw")) + .withAdvancedDiagnosticConsent(Consent.NO) + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("znbmpowuwprzq"))); model = BinaryData.fromObject(model).toObject(UpdateSupportTicket.class); - Assertions.assertEquals(SeverityLevel.CRITICAL, model.severity()); - Assertions.assertEquals(Status.CLOSED, model.status()); - Assertions.assertEquals("lqlfm", model.contactDetails().firstName()); - Assertions.assertEquals("n", model.contactDetails().lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod()); - Assertions.assertEquals("zpswiydmc", model.contactDetails().primaryEmailAddress()); - Assertions.assertEquals("zdxss", model.contactDetails().additionalEmailAddresses().get(0)); - Assertions.assertEquals("blylpstdbh", model.contactDetails().phoneNumber()); - Assertions.assertEquals("srzdzucerscdn", model.contactDetails().preferredTimeZone()); - Assertions.assertEquals("evfiwjmygt", model.contactDetails().country()); - Assertions.assertEquals("slswtm", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); + Assertions.assertEquals(Status.OPEN, model.status()); + Assertions.assertEquals("ooxdjebwpuc", model.contactDetails().firstName()); + Assertions.assertEquals("fvovbvmeuecivy", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("uojgj", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ueiotwmcdyt", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("ni", model.contactDetails().phoneNumber()); + Assertions.assertEquals("x", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("kpycgklwndnhjd", model.contactDetails().country()); + Assertions.assertEquals("whvylw", model.contactDetails().preferredSupportLanguage()); Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); - Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("yqsemwa", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("znbmpowuwprzq", model.secondaryConsent().get(0).type()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UploadFileTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UploadFileTests.java index c501397a19b0..f477ffaa56d3 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UploadFileTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/UploadFileTests.java @@ -11,17 +11,17 @@ public final class UploadFileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UploadFile model - = BinaryData.fromString("{\"content\":\"i\",\"chunkIndex\":1822288960}").toObject(UploadFile.class); - Assertions.assertEquals("i", model.content()); - Assertions.assertEquals(1822288960, model.chunkIndex()); + UploadFile model = BinaryData.fromString("{\"content\":\"wlrbqtkoievseo\",\"chunkIndex\":143823433}") + .toObject(UploadFile.class); + Assertions.assertEquals("wlrbqtkoievseo", model.content()); + Assertions.assertEquals(143823433, model.chunkIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UploadFile model = new UploadFile().withContent("i").withChunkIndex(1822288960); + UploadFile model = new UploadFile().withContent("wlrbqtkoievseo").withChunkIndex(143823433); model = BinaryData.fromObject(model).toObject(UploadFile.class); - Assertions.assertEquals("i", model.content()); - Assertions.assertEquals(1822288960, model.chunkIndex()); + Assertions.assertEquals("wlrbqtkoievseo", model.content()); + Assertions.assertEquals(143823433, model.chunkIndex()); } }