diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 520a2c8dd721..f8e529dd3646 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -362,7 +362,7 @@ com.azure.resourcemanager:azure-resourcemanager-mariadb;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-servicefabric;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-peering;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-policyinsights;1.0.0;1.1.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-support;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-support;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-subscription;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-powerbidedicated;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-applicationinsights;1.1.0;1.2.0-beta.2 diff --git a/sdk/support/azure-resourcemanager-support/CHANGELOG.md b/sdk/support/azure-resourcemanager-support/CHANGELOG.md index 72a452f518e8..4a382902b45b 100644 --- a/sdk/support/azure-resourcemanager-support/CHANGELOG.md +++ b/sdk/support/azure-resourcemanager-support/CHANGELOG.md @@ -1,14 +1,188 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2026-07-06) -### Features Added +- Azure Resource Manager Support client library for Java. This package contains Microsoft Azure SDK for Support Management SDK. Microsoft Azure Support Resource Provider. Package api-version 2026-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.ChatTranscriptsListResult` was removed + +#### `models.OperationsListResult` was removed + +#### `models.SupportTicketsListResult` was removed + +#### `models.FilesListResult` was removed + +#### `models.CommunicationsListResult` was removed + +#### `models.TranscriptContentType` was removed + +#### `models.ServicesListResult` was removed + +#### `models.ProblemClassificationsListResult` was removed + +#### `models.CheckNameAvailabilityInput` was modified + +* `validate()` was removed + +#### `models.TechnicalTicketDetails` was modified + +* `validate()` was removed + +#### `models.QuotaChangeRequest` was modified + +* `validate()` was removed + +#### `models.UpdateContactProfile` was modified + +* `validate()` was removed + +#### `models.UpdateSupportTicket` was modified + +* `validate()` was removed + +#### `models.ContactProfile` was modified + +* `validate()` was removed + +#### `models.QuotaTicketDetails` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `validate()` was removed + +#### `models.MessageProperties` was modified + +* `MessageProperties()` was changed to private access +* `validate()` was removed +* `models.TranscriptContentType contentType()` -> `java.lang.String contentType()` +* `withBody(java.lang.String)` was removed +* `withSender(java.lang.String)` was removed + +#### `models.SecondaryConsent` was modified + +* `validate()` was removed + +#### `SupportManager` was modified + +* `fluent.MicrosoftSupport serviceClient()` -> `fluent.SupportManagementClient serviceClient()` + +#### `models.SecondaryConsentEnabled` was modified + +* `SecondaryConsentEnabled()` was changed to private access +* `withDescription(java.lang.String)` was removed +* `validate()` was removed +* `withType(java.lang.String)` was removed + +#### `models.UploadFile` was modified + +* `validate()` was removed + +#### `models.ServiceLevelAgreement` was modified + +* `validate()` was removed + +#### `models.SupportEngineer` was modified + +* `validate()` was removed + +### Features Added + +* `models.EscalationStatus` was added + +* `models.ActionType` was added + +* `models.ClassifyProblemsNoSubscriptions` was added + +* `models.ClassifyServicesNoSubscriptions` was added + +* `models.LookUpResourceIdRequest` was added + +* `models.SupportChannel` was added + +* `models.ClassificationService` was added + +* `models.LookUpResourceIdRequestType` was added + +* `models.ClassifyServices` was added + +* `models.ServiceClassificationRequest` was added + +* `models.ProblemClassificationsClassificationOutput` was added + +* `models.Origin` was added + +* `models.DirectConnectEscalation` was added + +* `models.ServiceClassificationOutput` was added + +* `models.ProblemClassificationsClassificationResult` was added + +* `models.LookUpResourceIdResponse` was added + +* `models.ServiceClassificationAnswer` was added + +* `models.ClassifyProblems` was added + +* `models.ProblemClassificationsClassificationInput` was added + +* `models.ChatConversationStatus` was added + +#### `models.ProblemClassification` was modified + +* `systemData()` was added + +#### `models.Service` was modified + +* `systemData()` was added + +#### `models.UpdateSupportTicket` was modified + +* `directConnectEscalation()` was added +* `withDirectConnectEscalation(models.DirectConnectEscalation)` was added + +#### `models.Operation` was modified + +* `origin()` was added +* `actionType()` was added +* `isDataAction()` was added + +#### `models.SupportTickets` was modified + +* `lookUpResourceId(models.LookUpResourceIdRequest)` was added +* `lookUpResourceIdWithResponse(models.LookUpResourceIdRequest,com.azure.core.util.Context)` was added + +#### `SupportManager` was modified + +* `classifyProblems()` was added +* `classifyServices()` was added +* `classifyServicesNoSubscriptions()` was added +* `classifyProblemsNoSubscriptions()` was added + +#### `models.CommunicationDetails` was modified + +* `systemData()` was added + +#### `models.SupportTicketDetails` was modified + +* `chatConversationStatus()` was added +* `communityForumPost()` was added +* `supportChannel()` was added +* `directConnectEscalation()` was added +* `systemData()` was added + +#### `models.SupportTicketDetails$Definition` was modified + +* `withDirectConnectEscalation(models.DirectConnectEscalation)` was added +* `withCommunityForumPost(java.lang.String)` was added + +#### `models.SupportTicketDetails$Update` was modified -### Other Changes +* `withDirectConnectEscalation(models.DirectConnectEscalation)` was added ## 1.1.0 (2024-12-19) diff --git a/sdk/support/azure-resourcemanager-support/README.md b/sdk/support/azure-resourcemanager-support/README.md index f58b58a8a719..1888808339c9 100644 --- a/sdk/support/azure-resourcemanager-support/README.md +++ b/sdk/support/azure-resourcemanager-support/README.md @@ -1,8 +1,8 @@ -# Azure Resource Manager support client library for Java +# Azure Resource Manager Support client library for Java -Azure Resource Manager support client library for Java. +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). +This package contains Microsoft Azure SDK for Support Management SDK. Microsoft Azure Support Resource Provider. Package api-version 2026-07-01. 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.2.0-beta.1 + 1.2.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ SupportManager manager = SupportManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/support/azure-resourcemanager-support/SAMPLE.md b/sdk/support/azure-resourcemanager-support/SAMPLE.md index c7500563949d..11c0fbed26b6 100644 --- a/sdk/support/azure-resourcemanager-support/SAMPLE.md +++ b/sdk/support/azure-resourcemanager-support/SAMPLE.md @@ -11,6 +11,22 @@ - [Get](#chattranscriptsnosubscription_get) - [List](#chattranscriptsnosubscription_list) +## ClassifyProblems + +- [ClassifyProblems](#classifyproblems_classifyproblems) + +## ClassifyProblemsNoSubscription + +- [ClassifyProblems](#classifyproblemsnosubscription_classifyproblems) + +## ClassifyServices + +- [ClassifyServices](#classifyservices_classifyservices) + +## ClassifyServicesNoSubscription + +- [ClassifyServices](#classifyservicesnosubscription_classifyservices) + ## Communications - [CheckNameAvailability](#communications_checknameavailability) @@ -69,6 +85,7 @@ - [Create](#supporttickets_create) - [Get](#supporttickets_get) - [List](#supporttickets_list) +- [LookUpResourceId](#supporttickets_lookupresourceid) - [Update](#supporttickets_update) ## SupportTicketsNoSubscription @@ -86,8 +103,7 @@ */ public final class ChatTranscriptsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetchatTranscriptDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/GetchatTranscriptDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. @@ -110,8 +126,7 @@ public final class ChatTranscriptsGetSamples { */ public final class ChatTranscriptsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListChatTranscriptsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/ListChatTranscriptsForSubscriptionSupportTicket.json */ /** * Sample code: List chat transcripts for a subscription support ticket. @@ -133,8 +148,7 @@ public final class ChatTranscriptsListSamples { */ public final class ChatTranscriptsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetchatTranscriptDetailsForSupportTicket.json + * x-ms-original-file: 2026-07-01/GetchatTranscriptDetailsForSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. @@ -157,8 +171,7 @@ public final class ChatTranscriptsNoSubscriptionGetSamples { */ public final class ChatTranscriptsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListChatTranscriptsForSupportTicket.json + * x-ms-original-file: 2026-07-01/ListChatTranscriptsForSupportTicket.json */ /** * Sample code: List chat transcripts for a no-subscription support ticket. @@ -172,6 +185,119 @@ public final class ChatTranscriptsNoSubscriptionListSamples { } ``` +### ClassifyProblems_ClassifyProblems + +```java +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; + +/** + * Samples for ClassifyProblems ClassifyProblems. + */ +public final class ClassifyProblemsClassifyProblemsSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyProblems() + .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); + } +} +``` + +### ClassifyProblemsNoSubscription_ClassifyProblems + +```java +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; + +/** + * Samples for ClassifyProblemsNoSubscription ClassifyProblems. + */ +public final class ClassifyProblemsNoSubscriptionClassifyProblemsSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyProblemsNoSubscriptions() + .classifyProblemsWithResponse("serviceId1", + new ProblemClassificationsClassificationInput().withIssueSummary("Can not connect to Windows VM"), + com.azure.core.util.Context.NONE); + } +} +``` + +### ClassifyServices_ClassifyServices + +```java +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; + +/** + * Samples for ClassifyServices ClassifyServices. + */ +public final class ClassifyServicesClassifyServicesSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyServices() + .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); + } +} +``` + +### ClassifyServicesNoSubscription_ClassifyServices + +```java +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; + +/** + * Samples for ClassifyServicesNoSubscription ClassifyServices. + */ +public final class ClassifyServicesNoSubscriptionClassifyServicesSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyServicesNoSubscriptions() + .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); + } +} +``` + ### Communications_CheckNameAvailability ```java @@ -183,8 +309,7 @@ import com.azure.resourcemanager.support.models.Type; */ public final class CommunicationsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CheckNameAvailabilityForSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CheckNameAvailabilityForSupportTicketCommunication.json */ /** * Sample code: Checks whether name is available for Communication resource for a subscription support ticket. @@ -209,8 +334,7 @@ public final class CommunicationsCheckNameAvailabilitySamples { */ public final class CommunicationsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CreateSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToSubscriptionTicket. @@ -237,8 +361,7 @@ public final class CommunicationsCreateSamples { */ public final class CommunicationsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetCommunicationDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/GetCommunicationDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get communication details for a subscription support ticket. @@ -260,8 +383,7 @@ public final class CommunicationsGetSamples { */ public final class CommunicationsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/ListCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List communications for a subscription support ticket. @@ -274,8 +396,7 @@ public final class CommunicationsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListWebCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List web communications for a subscription support ticket. @@ -289,8 +410,7 @@ public final class CommunicationsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a subscription support ticket. @@ -317,8 +437,7 @@ import com.azure.resourcemanager.support.models.Type; */ public final class CommunicationsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: Checks whether name is available for Communication resource. @@ -345,8 +464,7 @@ import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner */ public final class CommunicationsNoSubscriptionCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CreateNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToNoSubscriptionTicket. @@ -373,8 +491,7 @@ public final class CommunicationsNoSubscriptionCreateSamples { */ public final class CommunicationsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetCommunicationDetailsForSupportTicket.json + * x-ms-original-file: 2026-07-01/GetCommunicationDetailsForSupportTicket.json */ /** * Sample code: Get communication details for a no-subscription support ticket. @@ -397,8 +514,7 @@ public final class CommunicationsNoSubscriptionGetSamples { */ public final class CommunicationsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListCommunicationsForSupportTicket.json + * x-ms-original-file: 2026-07-01/ListCommunicationsForSupportTicket.json */ /** * Sample code: List communications for a no-subscription support ticket. @@ -411,8 +527,7 @@ public final class CommunicationsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a no-subscription support ticket. @@ -427,8 +542,7 @@ public final class CommunicationsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListWebCommunicationsForSupportTicket.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSupportTicket.json */ /** * Sample code: List web communications for a no-subscription support ticket. @@ -451,8 +565,7 @@ public final class CommunicationsNoSubscriptionListSamples { */ public final class FileWorkspacesCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateFileWorkspaceForSubscription.json + * x-ms-original-file: 2026-07-01/CreateFileWorkspaceForSubscription.json */ /** * Sample code: Create a file workspace for a subscription. @@ -473,8 +586,7 @@ public final class FileWorkspacesCreateSamples { */ public final class FileWorkspacesGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetFileWorkspaceDetailsForSubscription.json + * x-ms-original-file: 2026-07-01/GetFileWorkspaceDetailsForSubscription.json */ /** * Sample code: Get details of a subscription file workspace. @@ -496,8 +608,7 @@ public final class FileWorkspacesGetSamples { */ public final class FileWorkspacesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspace.json + * x-ms-original-file: 2026-07-01/CreateFileWorkspace.json */ /** * Sample code: Create a file workspace. @@ -518,8 +629,7 @@ public final class FileWorkspacesNoSubscriptionCreateSamples { */ public final class FileWorkspacesNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetails.json + * x-ms-original-file: 2026-07-01/GetFileWorkspaceDetails.json */ /** * Sample code: Get details of a file workspace. @@ -540,9 +650,7 @@ public final class FileWorkspacesNoSubscriptionGetSamples { */ public final class FilesCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileForSubscription. - * json + * x-ms-original-file: 2026-07-01/CreateFileForSubscription.json */ /** * Sample code: Create a file under a subscription workspace. @@ -570,9 +678,7 @@ public final class FilesCreateSamples { */ public final class FilesGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetailsForSubscription - * .json + * x-ms-original-file: 2026-07-01/GetFileDetailsForSubscription.json */ /** * Sample code: Get details of a subscription file. @@ -593,8 +699,7 @@ public final class FilesGetSamples { */ public final class FilesListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListFilesForSubscriptionUnderFileWorkspace.json + * x-ms-original-file: 2026-07-01/ListFilesForSubscriptionUnderFileWorkspace.json */ /** * Sample code: List files under a workspace for a subscription. @@ -618,9 +723,7 @@ import com.azure.resourcemanager.support.models.UploadFile; */ public final class FilesUploadSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFileForSubscription. - * json + * x-ms-original-file: 2026-07-01/UploadFileForSubscription.json */ /** * Sample code: UploadFileForSubscription. @@ -646,8 +749,7 @@ import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; */ public final class FilesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFile.json + * x-ms-original-file: 2026-07-01/CreateFile.json */ /** * Sample code: Create a file workspace. @@ -671,8 +773,7 @@ public final class FilesNoSubscriptionCreateSamples { */ public final class FilesNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetails.json + * x-ms-original-file: 2026-07-01/GetFileDetails.json */ /** * Sample code: Get details of a subscription file. @@ -693,9 +794,7 @@ public final class FilesNoSubscriptionGetSamples { */ public final class FilesNoSubscriptionListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesUnderFileWorkspace. - * json + * x-ms-original-file: 2026-07-01/ListFilesUnderFileWorkspace.json */ /** * Sample code: List files under a workspace. @@ -718,8 +817,7 @@ import com.azure.resourcemanager.support.models.UploadFile; */ public final class FilesNoSubscriptionUploadSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFile.json + * x-ms-original-file: 2026-07-01/UploadFile.json */ /** * Sample code: UploadFile. @@ -743,8 +841,7 @@ public final class FilesNoSubscriptionUploadSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListOperations.json + * x-ms-original-file: 2026-07-01/ListOperations.json */ /** * Sample code: Get all operations. @@ -765,8 +862,7 @@ public final class OperationsListSamples { */ public final class ProblemClassificationsGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetProblemClassification.json + * x-ms-original-file: 2026-07-01/GetProblemClassification.json */ /** * Sample code: Gets details of problemClassification for Azure service. @@ -789,9 +885,7 @@ public final class ProblemClassificationsGetSamples { */ public final class ProblemClassificationsListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListProblemClassifications. - * json + * x-ms-original-file: 2026-07-01/ListProblemClassifications.json */ /** * Sample code: Gets list of problemClassifications for a service for which a support ticket can be created. @@ -813,8 +907,7 @@ public final class ProblemClassificationsListSamples { */ public final class ServicesGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetService.json + * x-ms-original-file: 2026-07-01/GetService.json */ /** * Sample code: Gets details of the Azure service. @@ -835,8 +928,7 @@ public final class ServicesGetSamples { */ public final class ServicesListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListServices.json + * x-ms-original-file: 2026-07-01/ListServices.json */ /** * Sample code: Gets list of services for which a support ticket can be created. @@ -861,8 +953,7 @@ import com.azure.resourcemanager.support.models.Type; */ public final class SupportTicketsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CheckNameAvailabilityWithSubscription.json + * x-ms-original-file: 2026-07-01/CheckNameAvailabilityWithSubscription.json */ /** * Sample code: Checks whether name is available for a subscription support ticket resource. @@ -897,8 +988,7 @@ import java.util.Arrays; */ public final class SupportTicketsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatawarehouseQuotaTicketForDTUs.json + * x-ms-original-file: 2026-07-01/CreateSqlDatawarehouseQuotaTicketForDTUs.json */ /** * Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics. @@ -933,8 +1023,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json */ /** * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. @@ -969,8 +1058,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateMachineLearningQuotaTicketForLowPriorityCores.json + * x-ms-original-file: 2026-07-01/CreateMachineLearningQuotaTicketForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service. @@ -1005,8 +1093,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription. @@ -1041,21 +1128,22 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatabaseQuotaTicketForDTUs.json + * x-ms-original-file: 2026-07-01/CreateGenericQuotaTicket.json */ /** - * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. + * Sample code: Create a ticket to request Quota increase for services that do not require additional details in the + * quotaTicketDetails object. * * @param manager Entry point to SupportManager. */ - public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( - com.azure.resourcemanager.support.SupportManager manager) { + public static void + createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( + com.azure.resourcemanager.support.SupportManager manager) { manager.supportTickets() .define("testticket") - .withDescription("my description") + .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") .withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) .withAdvancedDiagnosticConsent(Consent.YES) .withContactDetails(new ContactProfile().withFirstName("abc") @@ -1067,33 +1155,24 @@ public final class SupportTicketsCreateSamples { .withPreferredSupportLanguage("en-US")) .withTitle("my title") .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") - .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/stable/2024-04-01/examples/CreateGenericQuotaTicket.json + * x-ms-original-file: 2026-07-01/CreateSqlDatabaseQuotaTicketForDTUs.json */ /** - * Sample code: Create a ticket to request Quota increase for services that do not require additional details in the - * quotaTicketDetails object. + * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. * * @param manager Entry point to SupportManager. */ - public static void - createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( - com.azure.resourcemanager.support.SupportManager manager) { + public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( + com.azure.resourcemanager.support.SupportManager manager) { manager.supportTickets() .define("testticket") - .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") + .withDescription("my description") .withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) .withAdvancedDiagnosticConsent(Consent.YES) .withContactDetails(new ContactProfile().withFirstName("abc") @@ -1105,12 +1184,17 @@ public final class SupportTicketsCreateSamples { .withPreferredSupportLanguage("en-US")) .withTitle("my title") .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") + .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/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account. @@ -1145,8 +1229,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlManagedInstanceQuotaTicket.json + * x-ms-original-file: 2026-07-01/CreateSqlManagedInstanceQuotaTicket.json */ /** * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. @@ -1184,8 +1267,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSubMgmtSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateSubMgmtSupportTicketForSubscription.json */ /** * Sample code: Create a ticket for Subscription Management related issues for a subscription. @@ -1217,8 +1299,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateTechnicalSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateTechnicalSupportTicketForSubscription.json */ /** * Sample code: Create a ticket for Technical issue related to a specific resource for a subscription. @@ -1252,12 +1333,13 @@ public final class SupportTicketsCreateSamples { "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) .withSecondaryConsent(Arrays.asList( new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))) + .withCommunityForumPost( + "https://learn.microsoft.com/en-us/answers/questions/2283704/unverified-app-listed-under-applications-from-pers") .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json */ /** * Sample code: Create a ticket to request Quota increase for Pools for a Batch account. @@ -1292,8 +1374,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account. @@ -1329,8 +1410,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatabaseQuotaTicketForServers.json + * x-ms-original-file: 2026-07-01/CreateSqlDatabaseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for SQL Database. @@ -1365,8 +1445,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBillingSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateBillingSupportTicketForSubscription.json */ /** * Sample code: Create a ticket for Billing related issues. @@ -1397,8 +1476,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateMachineLearningQuotaTicketForDedicatedCores.json + * x-ms-original-file: 2026-07-01/CreateMachineLearningQuotaTicketForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service. @@ -1433,8 +1511,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatawarehouseQuotaTicketForServers.json + * x-ms-original-file: 2026-07-01/CreateSqlDatawarehouseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics. @@ -1469,8 +1546,7 @@ public final class SupportTicketsCreateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateCoresQuotaTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateCoresQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Compute VM Cores. @@ -1513,8 +1589,7 @@ public final class SupportTicketsCreateSamples { */ public final class SupportTicketsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetSubscriptionSupportTicketDetails.json + * x-ms-original-file: 2026-07-01/GetSubscriptionSupportTicketDetails.json */ /** * Sample code: Get details of a subscription ticket. @@ -1535,8 +1610,7 @@ public final class SupportTicketsGetSamples { */ public final class SupportTicketsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsServiceIdEqualsForSubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsServiceIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain service id for a subscription. @@ -1549,8 +1623,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in open state for a subscription. @@ -1564,8 +1637,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsInUpdatingStateBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets in updating state for a subscription. @@ -1578,8 +1650,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state for a subscription. @@ -1594,8 +1665,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsProblemClassificationIdEqualsForSubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain problem classification id for a subscription. @@ -1610,8 +1680,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsBySubscription.json */ /** * Sample code: List support tickets for a subscription. @@ -1623,8 +1692,7 @@ public final class SupportTicketsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsInOpenStateBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsInOpenStateBySubscription.json */ /** * Sample code: List support tickets in open state for a subscription. @@ -1638,10 +1706,40 @@ public final class SupportTicketsListSamples { } ``` +### SupportTickets_LookUpResourceId + +```java +import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequestType; + +/** + * Samples for SupportTickets LookUpResourceId. + */ +public final class SupportTicketsLookUpResourceIdSamples { + /* + * x-ms-original-file: 2026-07-01/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.supportTickets() + .lookUpResourceIdWithResponse( + new LookUpResourceIdRequest().withIdentifier("1234668596") + .withType(LookUpResourceIdRequestType.MICROSOFT_SUPPORT_SUPPORT_TICKETS), + com.azure.core.util.Context.NONE); + } +} +``` + ### SupportTickets_Update ```java import com.azure.resourcemanager.support.models.Consent; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.Status; @@ -1654,8 +1752,27 @@ import java.util.Arrays; */ public final class SupportTicketsUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateEscalationStatusOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update escalation status of a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void + updateEscalationStatusOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource + = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withContactDetails(new UpdateContactProfile().withPhoneNumber("123-456-7890")) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_INITIATED) + .withReasonForEscalation("Server is down and business is impacted")) + .apply(); + } + + /* + * x-ms-original-file: 2026-07-01/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json */ /** * Sample code: Update advanced diagnostic consent of a subscription support ticket. @@ -1670,8 +1787,7 @@ public final class SupportTicketsUpdateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateSeverityOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateSeverityOfSupportTicketForSubscription.json */ /** * Sample code: Update severity of a subscription support ticket. @@ -1686,8 +1802,7 @@ public final class SupportTicketsUpdateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateStatusOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateStatusOfSupportTicketForSubscription.json */ /** * Sample code: Update status of a subscription support ticket. @@ -1702,8 +1817,7 @@ public final class SupportTicketsUpdateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateContactDetailsOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateContactDetailsOfSupportTicketForSubscription.json */ /** * Sample code: Update contact details of a subscription support ticket. @@ -1740,8 +1854,7 @@ import com.azure.resourcemanager.support.models.Type; */ public final class SupportTicketsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailability.json + * x-ms-original-file: 2026-07-01/CheckNameAvailability.json */ /** * Sample code: Checks whether name is available for SupportTicket resource. @@ -1774,9 +1887,7 @@ import java.util.Arrays; */ public final class SupportTicketsNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicket. - * json + * x-ms-original-file: 2026-07-01/CreateBillingSupportTicket.json */ /** * Sample code: Create a ticket for Billing related issues. @@ -1806,9 +1917,7 @@ public final class SupportTicketsNoSubscriptionCreateSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicket. - * json + * x-ms-original-file: 2026-07-01/CreateSubMgmtSupportTicket.json */ /** * Sample code: Create a ticket for Subscription Management related issues. @@ -1839,9 +1948,7 @@ public final class SupportTicketsNoSubscriptionCreateSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicket. - * json + * x-ms-original-file: 2026-07-01/CreateTechnicalSupportTicket.json */ /** * Sample code: Create a ticket for Technical issue related to a specific resource. @@ -1871,7 +1978,9 @@ public final class SupportTicketsNoSubscriptionCreateSamples { .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"))), + .withType("virtualmachinerunninglinuxservice"))) + .withCommunityForumPost( + "https://learn.microsoft.com/en-us/answers/questions/2283704/unverified-app-listed-under-applications-from-pers"), com.azure.core.util.Context.NONE); } } @@ -1885,8 +1994,7 @@ public final class SupportTicketsNoSubscriptionCreateSamples { */ public final class SupportTicketsNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSupportTicketDetails.json + * x-ms-original-file: 2026-07-01/GetSupportTicketDetails.json */ /** * Sample code: Get details of a ticket. @@ -1907,8 +2015,7 @@ public final class SupportTicketsNoSubscriptionGetSamples { */ public final class SupportTicketsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state. @@ -1923,9 +2030,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenState - * .json + * x-ms-original-file: 2026-07-01/ListSupportTicketsInOpenState.json */ /** * Sample code: List support tickets in open state. @@ -1937,8 +2042,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTickets.json + * x-ms-original-file: 2026-07-01/ListSupportTickets.json */ /** * Sample code: List support tickets. @@ -1950,8 +2054,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsInUpdatingState.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsInUpdatingState.json */ /** * Sample code: List support tickets in updating state. @@ -1963,8 +2066,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenState.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json */ /** * Sample code: List support tickets created on or after a certain date and in open state. @@ -1978,8 +2080,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsServiceIdEquals.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsServiceIdEquals.json */ /** * Sample code: List support tickets with a certain service id. @@ -1993,8 +2094,7 @@ public final class SupportTicketsNoSubscriptionListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsProblemClassificationIdEquals.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsProblemClassificationIdEquals.json */ /** * Sample code: List support tickets with a certain problem classification id. @@ -2014,6 +2114,8 @@ public final class SupportTicketsNoSubscriptionListSamples { ```java import com.azure.resourcemanager.support.models.Consent; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.Status; @@ -2026,8 +2128,7 @@ import java.util.Arrays; */ public final class SupportTicketsNoSubscriptionUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicket.json + * x-ms-original-file: 2026-07-01/UpdateAdvancedDiagnosticConsentOfSupportTicket.json */ /** * Sample code: Update advanced diagnostic consent of a support ticket. @@ -2042,9 +2143,7 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicket - * .json + * x-ms-original-file: 2026-07-01/UpdateSeverityOfSupportTicket.json */ /** * Sample code: Update severity of a support ticket. @@ -2058,9 +2157,7 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicket. - * json + * x-ms-original-file: 2026-07-01/UpdateStatusOfSupportTicket.json */ /** * Sample code: Update status of a support ticket. @@ -2074,8 +2171,26 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateContactDetailsOfSupportTicket.json + * x-ms-original-file: 2026-07-01/UpdateEscalationStatusOfSupportTicket.json + */ + /** + * Sample code: Update escalation status of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void + updateEscalationStatusOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", + new UpdateSupportTicket().withContactDetails(new UpdateContactProfile().withPhoneNumber("123-456-7890")) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_INITIATED) + .withReasonForEscalation("Server is down and business is impacted")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01/UpdateContactDetailsOfSupportTicket.json */ /** * Sample code: Update contact details of a support ticket. diff --git a/sdk/support/azure-resourcemanager-support/pom.xml b/sdk/support/azure-resourcemanager-support/pom.xml index 515583369c13..7aa3e1116c17 100644 --- a/sdk/support/azure-resourcemanager-support/pom.xml +++ b/sdk/support/azure-resourcemanager-support/pom.xml @@ -1,9 +1,9 @@ - + 4.0.0 com.azure @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-support - 1.2.0-beta.1 + 1.2.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-2024-04. + 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 api-version 2026-07-01. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true 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 747c853fe12a..b08b260ca7b9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support; @@ -22,24 +22,33 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.support.fluent.MicrosoftSupport; +import com.azure.resourcemanager.support.fluent.SupportManagementClient; import com.azure.resourcemanager.support.implementation.ChatTranscriptsImpl; import com.azure.resourcemanager.support.implementation.ChatTranscriptsNoSubscriptionsImpl; +import com.azure.resourcemanager.support.implementation.ClassifyProblemsImpl; +import com.azure.resourcemanager.support.implementation.ClassifyProblemsNoSubscriptionsImpl; +import com.azure.resourcemanager.support.implementation.ClassifyServicesImpl; +import com.azure.resourcemanager.support.implementation.ClassifyServicesNoSubscriptionsImpl; 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.MicrosoftSupportBuilder; import com.azure.resourcemanager.support.implementation.OperationsImpl; import com.azure.resourcemanager.support.implementation.ProblemClassificationsImpl; import com.azure.resourcemanager.support.implementation.ServicesImpl; +import com.azure.resourcemanager.support.implementation.SupportManagementClientBuilder; import com.azure.resourcemanager.support.implementation.SupportTicketsImpl; import com.azure.resourcemanager.support.implementation.SupportTicketsNoSubscriptionsImpl; import com.azure.resourcemanager.support.models.ChatTranscripts; import com.azure.resourcemanager.support.models.ChatTranscriptsNoSubscriptions; +import com.azure.resourcemanager.support.models.ClassifyProblems; +import com.azure.resourcemanager.support.models.ClassifyProblemsNoSubscriptions; +import com.azure.resourcemanager.support.models.ClassifyServices; +import com.azure.resourcemanager.support.models.ClassifyServicesNoSubscriptions; import com.azure.resourcemanager.support.models.Communications; import com.azure.resourcemanager.support.models.CommunicationsNoSubscriptions; import com.azure.resourcemanager.support.models.FileWorkspaces; @@ -55,6 +64,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -67,16 +77,24 @@ public final class SupportManager { private Services services; - private ProblemClassifications problemClassifications; + private ClassifyServices classifyServices; - private SupportTickets supportTickets; + private ClassifyServicesNoSubscriptions classifyServicesNoSubscriptions; - private SupportTicketsNoSubscriptions supportTicketsNoSubscriptions; + private ClassifyProblems classifyProblems; + + private ClassifyProblemsNoSubscriptions classifyProblemsNoSubscriptions; + + private ProblemClassifications problemClassifications; private Communications communications; + private SupportTickets supportTickets; + private CommunicationsNoSubscriptions communicationsNoSubscriptions; + private SupportTicketsNoSubscriptions supportTicketsNoSubscriptions; + private ChatTranscripts chatTranscripts; private ChatTranscriptsNoSubscriptions chatTranscriptsNoSubscriptions; @@ -89,12 +107,12 @@ public final class SupportManager { private FilesNoSubscriptions filesNoSubscriptions; - private final MicrosoftSupport clientObject; + private final SupportManagementClient 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) + this.clientObject = new SupportManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -102,11 +120,11 @@ private SupportManager(HttpPipeline httpPipeline, AzureProfile profile, Duration } /** - * Creates an instance of support service API entry point. + * Creates an instance of Support service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the support service API instance. + * @return the Support service API instance. */ public static SupportManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); @@ -115,11 +133,11 @@ public static SupportManager authenticate(TokenCredential credential, AzureProfi } /** - * Creates an instance of support service API entry point. + * Creates an instance of Support service API entry point. * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. - * @return the support service API instance. + * @return the Support service API instance. */ public static SupportManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); @@ -141,6 +159,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-support.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -238,22 +259,24 @@ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { } /** - * Creates an instance of support service API entry point. + * Creates an instance of Support service API entry point. * * @param credential the credential to use. * @param profile the Azure profile for client. - * @return the support service API instance. + * @return the Support service API instance. */ public SupportManager authenticate(TokenCredential credential, AzureProfile profile) { Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.support") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -324,41 +347,66 @@ public Services services() { } /** - * Gets the resource collection API of ProblemClassifications. + * Gets the resource collection API of ClassifyServices. * - * @return Resource collection API of ProblemClassifications. + * @return Resource collection API of ClassifyServices. */ - public ProblemClassifications problemClassifications() { - if (this.problemClassifications == null) { - this.problemClassifications - = new ProblemClassificationsImpl(clientObject.getProblemClassifications(), this); + public ClassifyServices classifyServices() { + if (this.classifyServices == null) { + this.classifyServices = new ClassifyServicesImpl(clientObject.getClassifyServices(), this); } - return problemClassifications; + return classifyServices; } /** - * Gets the resource collection API of SupportTickets. It manages SupportTicketDetails. + * Gets the resource collection API of ClassifyServicesNoSubscriptions. * - * @return Resource collection API of SupportTickets. + * @return Resource collection API of ClassifyServicesNoSubscriptions. */ - public SupportTickets supportTickets() { - if (this.supportTickets == null) { - this.supportTickets = new SupportTicketsImpl(clientObject.getSupportTickets(), this); + public ClassifyServicesNoSubscriptions classifyServicesNoSubscriptions() { + if (this.classifyServicesNoSubscriptions == null) { + this.classifyServicesNoSubscriptions + = new ClassifyServicesNoSubscriptionsImpl(clientObject.getClassifyServicesNoSubscriptions(), this); } - return supportTickets; + return classifyServicesNoSubscriptions; } /** - * Gets the resource collection API of SupportTicketsNoSubscriptions. + * Gets the resource collection API of ClassifyProblems. * - * @return Resource collection API of SupportTicketsNoSubscriptions. + * @return Resource collection API of ClassifyProblems. */ - public SupportTicketsNoSubscriptions supportTicketsNoSubscriptions() { - if (this.supportTicketsNoSubscriptions == null) { - this.supportTicketsNoSubscriptions - = new SupportTicketsNoSubscriptionsImpl(clientObject.getSupportTicketsNoSubscriptions(), this); + public ClassifyProblems classifyProblems() { + if (this.classifyProblems == null) { + this.classifyProblems = new ClassifyProblemsImpl(clientObject.getClassifyProblems(), this); } - return supportTicketsNoSubscriptions; + return classifyProblems; + } + + /** + * Gets the resource collection API of ClassifyProblemsNoSubscriptions. + * + * @return Resource collection API of ClassifyProblemsNoSubscriptions. + */ + public ClassifyProblemsNoSubscriptions classifyProblemsNoSubscriptions() { + if (this.classifyProblemsNoSubscriptions == null) { + this.classifyProblemsNoSubscriptions + = new ClassifyProblemsNoSubscriptionsImpl(clientObject.getClassifyProblemsNoSubscriptions(), this); + } + return classifyProblemsNoSubscriptions; + } + + /** + * Gets the resource collection API of ProblemClassifications. + * + * @return Resource collection API of ProblemClassifications. + */ + public ProblemClassifications problemClassifications() { + if (this.problemClassifications == null) { + this.problemClassifications + = new ProblemClassificationsImpl(clientObject.getProblemClassifications(), this); + } + return problemClassifications; } /** @@ -373,6 +421,18 @@ public Communications communications() { return communications; } + /** + * Gets the resource collection API of SupportTickets. It manages SupportTicketDetails. + * + * @return Resource collection API of SupportTickets. + */ + public SupportTickets supportTickets() { + if (this.supportTickets == null) { + this.supportTickets = new SupportTicketsImpl(clientObject.getSupportTickets(), this); + } + return supportTickets; + } + /** * Gets the resource collection API of CommunicationsNoSubscriptions. * @@ -386,6 +446,19 @@ public CommunicationsNoSubscriptions communicationsNoSubscriptions() { return communicationsNoSubscriptions; } + /** + * Gets the resource collection API of SupportTicketsNoSubscriptions. + * + * @return Resource collection API of SupportTicketsNoSubscriptions. + */ + public SupportTicketsNoSubscriptions supportTicketsNoSubscriptions() { + if (this.supportTicketsNoSubscriptions == null) { + this.supportTicketsNoSubscriptions + = new SupportTicketsNoSubscriptionsImpl(clientObject.getSupportTicketsNoSubscriptions(), this); + } + return supportTicketsNoSubscriptions; + } + /** * Gets the resource collection API of ChatTranscripts. * @@ -461,12 +534,12 @@ public FilesNoSubscriptions filesNoSubscriptions() { } /** - * Gets wrapped service client MicrosoftSupport providing direct access to the underlying auto-generated API + * Gets wrapped service client SupportManagementClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. * - * @return Wrapped service client MicrosoftSupport. + * @return Wrapped service client SupportManagementClient. */ - public MicrosoftSupport serviceClient() { + public SupportManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsClient.java index e58b26cb25c9..39740ece890d 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -16,55 +16,55 @@ */ public interface ChatTranscriptsClient { /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String supportTicketName, String chatTranscriptName, + Context context); /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName); /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String supportTicketName, String chatTranscriptName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName); /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName, Context context); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsNoSubscriptionsClient.java index 339aa9f69e4b..21f4364e9138 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsNoSubscriptionsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsNoSubscriptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -16,55 +16,55 @@ */ public interface ChatTranscriptsNoSubscriptionsClient { /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String supportTicketName, String chatTranscriptName, + Context context); /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName); /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String supportTicketName, String chatTranscriptName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName); /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName, Context context); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsClient.java new file mode 100644 index 000000000000..9502bb3e6bbe --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyProblemsClient. + */ +public interface ClassifyProblemsClient { + /** + * 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/ClassifyProblemsNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsNoSubscriptionsClient.java new file mode 100644 index 000000000000..5a63ae510a28 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsNoSubscriptionsClient.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyProblemsNoSubscriptionsClient. + */ +public interface ClassifyProblemsNoSubscriptionsClient { + /** + * 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/ClassifyServicesClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyServicesClient.java new file mode 100644 index 000000000000..ba40b84c2ff9 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyServicesClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyServicesClient. + */ +public interface ClassifyServicesClient { + /** + * 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/ClassifyServicesNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyServicesNoSubscriptionsClient.java new file mode 100644 index 000000000000..23a898cdb0e5 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/ClassifyServicesNoSubscriptionsClient.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyServicesNoSubscriptionsClient. + */ +public interface ClassifyServicesNoSubscriptionsClient { + /** + * 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/CommunicationsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsClient.java index 55e2c3a2fe48..d6b0c264abc4 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -20,164 +20,164 @@ */ public interface CommunicationsClient { /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + Response getWithResponse(String supportTicketName, String communicationName, + Context context); /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return object that represents a Communication resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput); + CommunicationDetailsInner get(String supportTicketName, String communicationName); /** - * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also - * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The - * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which - * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available - * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might - * cause an error. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, + String communicationName, CommunicationDetailsInner createCommunicationParameters); /** - * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also - * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The - * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which - * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available - * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might - * cause an error. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param top The number of values to return in the collection. Default is 10 and max is 10. - * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate - * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and - * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical - * And ('and') operator. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName, Integer top, String filter, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, + String communicationName, CommunicationDetailsInner createCommunicationParameters, Context context); /** - * Returns communication details for a support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response}. + * @return object that represents a Communication resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String supportTicketName, String communicationName, - Context context); + CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters); /** - * Returns communication details for a support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that represents a Communication resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommunicationDetailsInner get(String supportTicketName, String communicationName); + CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The + * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which + * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available + * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might + * cause an error. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, - String communicationName, CommunicationDetailsInner createCommunicationParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName); /** - * Adds a new customer communication to an Azure support ticket. + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The + * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which + * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available + * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might + * cause an error. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param supportTicketName The name of the SupportTicketDetails. + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate + * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and + * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical + * And ('and') operator. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, - String communicationName, CommunicationDetailsInner createCommunicationParameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName, Integer top, String filter, + Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters); + Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context); + CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsNoSubscriptionsClient.java index bf18574ce9c5..01fe417d01af 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsNoSubscriptionsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsNoSubscriptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -20,164 +20,164 @@ */ public interface CommunicationsNoSubscriptionsClient { /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + Response getWithResponse(String supportTicketName, String communicationName, + Context context); /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return object that represents a Communication resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput); + CommunicationDetailsInner get(String supportTicketName, String communicationName); /** - * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also - * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The - * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which - * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available - * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might - * cause an error. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, + String communicationName, CommunicationDetailsInner createCommunicationParameters); /** - * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also - * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The - * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which - * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available - * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might - * cause an error. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param top The number of values to return in the collection. Default is 10 and max is 10. - * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate - * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and - * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical - * And ('and') operator. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String supportTicketName, Integer top, String filter, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, + String communicationName, CommunicationDetailsInner createCommunicationParameters, Context context); /** - * Returns communication details for a support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response}. + * @return object that represents a Communication resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String supportTicketName, String communicationName, - Context context); + CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters); /** - * Returns communication details for a support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that represents a Communication resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommunicationDetailsInner get(String supportTicketName, String communicationName); + CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The + * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which + * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available + * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might + * cause an error. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, - String communicationName, CommunicationDetailsInner createCommunicationParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName); /** - * Adds a new customer communication to an Azure support ticket. + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also + * filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The + * only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which + * you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available + * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might + * cause an error. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param supportTicketName The name of the SupportTicketDetails. + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate + * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and + * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical + * And ('and') operator. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommunicationDetailsInner> beginCreate(String supportTicketName, - String communicationName, CommunicationDetailsInner createCommunicationParameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String supportTicketName, Integer top, String filter, + Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters); + Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context); + CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesClient.java index 4812ac526f63..4d542e22c068 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -17,7 +17,7 @@ public interface FileWorkspacesClient { /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,7 +30,7 @@ public interface FileWorkspacesClient { /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -42,7 +42,7 @@ public interface FileWorkspacesClient { /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -55,7 +55,7 @@ public interface FileWorkspacesClient { /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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/FileWorkspacesNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesNoSubscriptionsClient.java index 7771d3477549..055874d0baa9 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesNoSubscriptionsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesNoSubscriptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -17,7 +17,7 @@ public interface FileWorkspacesNoSubscriptionsClient { /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,7 +30,7 @@ public interface FileWorkspacesNoSubscriptionsClient { /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -42,7 +42,7 @@ public interface FileWorkspacesNoSubscriptionsClient { /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -55,7 +55,7 @@ public interface FileWorkspacesNoSubscriptionsClient { /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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/FilesClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FilesClient.java index 64d9f80007b3..507a2b5a79c2 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FilesClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FilesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -16,36 +16,11 @@ * An instance of this class provides access to all the operations defined in FilesClient. */ public interface FilesClient { - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String fileWorkspaceName); - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String fileWorkspaceName, Context context); - /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,8 +33,8 @@ public interface FilesClient { /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -71,8 +46,8 @@ public interface FilesClient { /** * Creates a new file under a workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param createFileParameters Create file object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -87,8 +62,8 @@ Response createWithResponse(String fileWorkspaceName, String f /** * Creates a new file under a workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -98,11 +73,36 @@ Response createWithResponse(String fileWorkspaceName, String f @ServiceMethod(returns = ReturnType.SINGLE) FileDetailsInner create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters); + /** + * Lists all the Files information under a workspace for an Azure subscription. + * + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String fileWorkspaceName); + + /** + * Lists all the Files information under a workspace for an Azure subscription. + * + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String fileWorkspaceName, Context context); + /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,8 +117,8 @@ Response uploadWithResponse(String fileWorkspaceName, String fileName, Upl /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @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/FilesNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FilesNoSubscriptionsClient.java index 2c4747a3f003..4de836df13b4 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FilesNoSubscriptionsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/FilesNoSubscriptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -16,36 +16,11 @@ * An instance of this class provides access to all the operations defined in FilesNoSubscriptionsClient. */ public interface FilesNoSubscriptionsClient { - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String fileWorkspaceName); - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String fileWorkspaceName, Context context); - /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -58,8 +33,8 @@ public interface FilesNoSubscriptionsClient { /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -71,8 +46,8 @@ public interface FilesNoSubscriptionsClient { /** * Creates a new file under a workspace. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param createFileParameters Create file object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -87,8 +62,8 @@ Response createWithResponse(String fileWorkspaceName, String f /** * Creates a new file under a workspace. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -98,11 +73,36 @@ Response createWithResponse(String fileWorkspaceName, String f @ServiceMethod(returns = ReturnType.SINGLE) FileDetailsInner create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters); + /** + * Lists all the Files information under a workspace for an Azure subscription. + * + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String fileWorkspaceName); + + /** + * Lists all the Files information under a workspace for an Azure subscription. + * + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String fileWorkspaceName, Context context); + /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -117,8 +117,8 @@ Response uploadWithResponse(String fileWorkspaceName, String fileName, Upl /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @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/OperationsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/OperationsClient.java index ddceb5eb3657..18749d3e1cc0 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/OperationsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -15,24 +15,24 @@ */ public interface OperationsClient { /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) 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 361c1fb240af..db80ee9902e9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -16,59 +16,59 @@ */ public interface ProblemClassificationsClient { /** - * 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 - * set of service and problem classification Ids. + * 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. + * @param problemClassificationName Name of problem classification. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. + * @return problem classification details for a specific Azure service along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String serviceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceName, String problemClassificationName, + Context context); /** - * 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 - * set of service and problem classification Ids. + * 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 context The context to associate with this operation. + * @param serviceName Name of the Azure service. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. + * @return problem classification details for a specific Azure service. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String serviceName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ProblemClassificationInner get(String serviceName, String problemClassificationName); /** - * Get problem classification details for a specific Azure service. + * 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 + * set of service and problem classification Ids. * - * @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. + * @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. - * @return problem classification details for a specific Azure service along with {@link Response}. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String serviceName, String problemClassificationName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceName); /** - * Get problem classification details for a specific Azure service. + * 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 + * set of service and problem classification Ids. * - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return problem classification details for a specific Azure service. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ProblemClassificationInner get(String serviceName, String problemClassificationName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String serviceName, Context context); } 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 67669e94c1a7..fe72d3bf2ea4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -15,6 +15,31 @@ * An instance of this class provides access to all the operations defined in ServicesClient. */ public interface ServicesClient { + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific Azure service for support ticket creation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String serviceName, Context context); + + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @return a specific Azure service for support ticket creation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceInner get(String serviceName); + /** * Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service * Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's @@ -46,29 +71,4 @@ public interface ServicesClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); - - /** - * Gets a specific Azure service for support ticket creation. - * - * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Azure service for support ticket creation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String serviceName, Context context); - - /** - * Gets a specific Azure service for support ticket creation. - * - * @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. - * @return a specific Azure service for support ticket creation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceInner get(String serviceName); } 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/SupportManagementClient.java similarity index 76% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/MicrosoftSupport.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportManagementClient.java index e45ad9ccd5d3..e0c9ec63f764 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/SupportManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for MicrosoftSupport class. + * The interface for SupportManagementClient class. */ -public interface MicrosoftSupport { +public interface SupportManagementClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -61,25 +61,39 @@ public interface MicrosoftSupport { ServicesClient getServices(); /** - * Gets the ProblemClassificationsClient object to access its operations. + * Gets the ClassifyServicesClient object to access its operations. * - * @return the ProblemClassificationsClient object. + * @return the ClassifyServicesClient object. */ - ProblemClassificationsClient getProblemClassifications(); + ClassifyServicesClient getClassifyServices(); /** - * Gets the SupportTicketsClient object to access its operations. + * Gets the ClassifyServicesNoSubscriptionsClient object to access its operations. * - * @return the SupportTicketsClient object. + * @return the ClassifyServicesNoSubscriptionsClient object. */ - SupportTicketsClient getSupportTickets(); + ClassifyServicesNoSubscriptionsClient getClassifyServicesNoSubscriptions(); /** - * Gets the SupportTicketsNoSubscriptionsClient object to access its operations. + * Gets the ClassifyProblemsClient object to access its operations. * - * @return the SupportTicketsNoSubscriptionsClient object. + * @return the ClassifyProblemsClient object. */ - SupportTicketsNoSubscriptionsClient getSupportTicketsNoSubscriptions(); + ClassifyProblemsClient getClassifyProblems(); + + /** + * Gets the ClassifyProblemsNoSubscriptionsClient object to access its operations. + * + * @return the ClassifyProblemsNoSubscriptionsClient object. + */ + ClassifyProblemsNoSubscriptionsClient getClassifyProblemsNoSubscriptions(); + + /** + * Gets the ProblemClassificationsClient object to access its operations. + * + * @return the ProblemClassificationsClient object. + */ + ProblemClassificationsClient getProblemClassifications(); /** * Gets the CommunicationsClient object to access its operations. @@ -88,6 +102,13 @@ public interface MicrosoftSupport { */ CommunicationsClient getCommunications(); + /** + * Gets the SupportTicketsClient object to access its operations. + * + * @return the SupportTicketsClient object. + */ + SupportTicketsClient getSupportTickets(); + /** * Gets the CommunicationsNoSubscriptionsClient object to access its operations. * @@ -95,6 +116,13 @@ public interface MicrosoftSupport { */ CommunicationsNoSubscriptionsClient getCommunicationsNoSubscriptions(); + /** + * Gets the SupportTicketsNoSubscriptionsClient object to access its operations. + * + * @return the SupportTicketsNoSubscriptionsClient object. + */ + SupportTicketsNoSubscriptionsClient getSupportTicketsNoSubscriptions(); + /** * Gets the ChatTranscriptsClient object to access its operations. * diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsClient.java index e920c680890f..f5e6c4c8a2cd 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -12,85 +12,21 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; import com.azure.resourcemanager.support.models.UpdateSupportTicket; /** * An instance of this class provides access to all the operations defined in SupportTicketsClient. */ public interface SupportTicketsClient { - /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. - * - * @param checkNameAvailabilityInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); - - /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. - * - * @param checkNameAvailabilityInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); - - /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and - * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the - * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer top, String filter, Context context); - /** * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -104,7 +40,7 @@ public interface SupportTicketsClient { * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -113,40 +49,6 @@ public interface SupportTicketsClient { @ServiceMethod(returns = ReturnType.SINGLE) SupportTicketDetailsInner get(String supportTicketName); - /** - * This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact - * information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support - * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer - * to request severity update by adding a new communication using the Communications API. - * - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String supportTicketName, - UpdateSupportTicket updateSupportTicket, Context context); - - /** - * This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact - * information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support - * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer - * to request severity update by adding a new communication using the Communications API. - * - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SupportTicketDetailsInner update(String supportTicketName, UpdateSupportTicket updateSupportTicket); - /** * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required @@ -166,7 +68,7 @@ Response updateWithResponse(String supportTicketName, * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -196,7 +98,7 @@ SyncPoller, SupportTicketDetailsInner> beg * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -227,7 +129,7 @@ SyncPoller, SupportTicketDetailsInner> beg * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -256,7 +158,7 @@ SyncPoller, SupportTicketDetailsInner> beg * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -267,4 +169,128 @@ SyncPoller, SupportTicketDetailsInner> beg @ServiceMethod(returns = ReturnType.SINGLE) SupportTicketDetailsInner create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context); + + /** + * This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact + * information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support + * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer + * to request severity update by adding a new communication using the Communications API. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param updateSupportTicket UpdateSupportTicket object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents SupportTicketDetails resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String supportTicketName, + UpdateSupportTicket updateSupportTicket, Context context); + + /** + * This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact + * information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support + * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer + * to request severity update by adding a new communication using the Communications API. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param updateSupportTicket UpdateSupportTicket object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents SupportTicketDetails resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportTicketDetailsInner update(String supportTicketName, UpdateSupportTicket updateSupportTicket); + + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn + * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and + * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the + * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine + * them using the logical 'AND'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, String filter, Context context); + + /** + * 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 + lookUpResourceIdWithResponse(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 lookUpResourceId(LookUpResourceIdRequest lookUpResourceIdRequest); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsNoSubscriptionsClient.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsNoSubscriptionsClient.java index 73e88375589b..cd7b642ba014 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsNoSubscriptionsClient.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsNoSubscriptionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent; @@ -20,80 +20,11 @@ * An instance of this class provides access to all the operations defined in SupportTicketsNoSubscriptionsClient. */ public interface SupportTicketsNoSubscriptionsClient { - /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. - * - * @param checkNameAvailabilityInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); - - /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. - * - * @param checkNameAvailabilityInput Input to check. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); - - /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Integer top, String filter, Context context); - /** * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -107,7 +38,7 @@ public interface SupportTicketsNoSubscriptionsClient { * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -116,40 +47,6 @@ public interface SupportTicketsNoSubscriptionsClient { @ServiceMethod(returns = ReturnType.SINGLE) SupportTicketDetailsInner get(String supportTicketName); - /** - * This API allows you to update the severity level, ticket status, and your contact information in the support - * ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being - * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity - * update by adding a new communication using the Communications API. - * - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String supportTicketName, - UpdateSupportTicket updateSupportTicket, Context context); - - /** - * This API allows you to update the severity level, ticket status, and your contact information in the support - * ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being - * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity - * update by adding a new communication using the Communications API. - * - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SupportTicketDetailsInner update(String supportTicketName, UpdateSupportTicket updateSupportTicket); - /** * Creates a new support ticket for Billing, and Subscription Management issues. Learn the * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call @@ -162,7 +59,7 @@ Response updateWithResponse(String supportTicketName, * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -185,7 +82,7 @@ SyncPoller, SupportTicketDetailsInner> beg * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -209,7 +106,7 @@ SyncPoller, SupportTicketDetailsInner> beg * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -231,7 +128,7 @@ SyncPoller, SupportTicketDetailsInner> beg * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -242,4 +139,105 @@ SyncPoller, SupportTicketDetailsInner> beg @ServiceMethod(returns = ReturnType.SINGLE) SupportTicketDetailsInner create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context); + + /** + * This API allows you to update the severity level, ticket status, and your contact information in the support + * ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being + * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity + * update by adding a new communication using the Communications API. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param updateSupportTicket UpdateSupportTicket object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents SupportTicketDetails resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String supportTicketName, + UpdateSupportTicket updateSupportTicket, Context context); + + /** + * This API allows you to update the severity level, ticket status, and your contact information in the support + * ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being + * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity + * update by adding a new communication using the Communications API. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param updateSupportTicket UpdateSupportTicket object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents SupportTicketDetails resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SupportTicketDetailsInner update(String supportTicketName, UpdateSupportTicket updateSupportTicket); + + /** + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Integer top, String filter, Context context); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsInner.java index 3d48219009b9..a6928558b892 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -18,7 +18,7 @@ /** * Object that represents a Chat Transcript resource. */ -@Fluent +@Immutable public final class ChatTranscriptDetailsInner extends ProxyResource { /* * Properties of the resource. @@ -48,7 +48,7 @@ public final class ChatTranscriptDetailsInner extends ProxyResource { /** * Creates an instance of ChatTranscriptDetailsInner class. */ - public ChatTranscriptDetailsInner() { + private ChatTranscriptDetailsInner() { } /** @@ -108,20 +108,6 @@ public List messages() { return this.innerProperties() == null ? null : this.innerProperties().messages(); } - /** - * Set the messages property: List of chat transcript communication resources. - * - * @param messages the messages value to set. - * @return the ChatTranscriptDetailsInner object itself. - */ - public ChatTranscriptDetailsInner withMessages(List messages) { - if (this.innerProperties() == null) { - this.innerProperties = new ChatTranscriptDetailsProperties(); - } - this.innerProperties().withMessages(messages); - return this; - } - /** * Get the startTime property: Time in UTC (ISO 8601 format) when the chat began. * @@ -131,17 +117,6 @@ public OffsetDateTime startTime() { return this.innerProperties() == null ? null : this.innerProperties().startTime(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsProperties.java index dece455fe257..b4d6d6652841 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * Describes the properties of a Chat Transcript Details resource. */ -@Fluent +@Immutable public final class ChatTranscriptDetailsProperties implements JsonSerializable { /* * List of chat transcript communication resources. @@ -33,7 +33,7 @@ public final class ChatTranscriptDetailsProperties implements JsonSerializable messages() { return this.messages; } - /** - * Set the messages property: List of chat transcript communication resources. - * - * @param messages the messages value to set. - * @return the ChatTranscriptDetailsProperties object itself. - */ - public ChatTranscriptDetailsProperties withMessages(List messages) { - this.messages = messages; - return this; - } - /** * Get the startTime property: Time in UTC (ISO 8601 format) when the chat began. * @@ -65,17 +54,6 @@ public OffsetDateTime startTime() { return this.startTime; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (messages() != null) { - messages().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CheckNameAvailabilityOutputInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CheckNameAvailabilityOutputInner.java index 03732acb0dac..a5a9a3093ac7 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CheckNameAvailabilityOutputInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CheckNameAvailabilityOutputInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; @@ -34,7 +34,7 @@ public final class CheckNameAvailabilityOutputInner implements JsonSerializable< /** * Creates an instance of CheckNameAvailabilityOutputInner class. */ - public CheckNameAvailabilityOutputInner() { + private CheckNameAvailabilityOutputInner() { } /** @@ -64,14 +64,6 @@ public String message() { return this.message; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 9944f66694db..b8b5f5758465 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 @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -25,6 +25,11 @@ public final class CommunicationDetailsInner extends ProxyResource { */ private CommunicationDetailsProperties innerProperties = new CommunicationDetailsProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -55,6 +60,15 @@ private CommunicationDetailsProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -181,23 +195,6 @@ public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - 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); - /** * {@inheritDoc} */ @@ -233,6 +230,8 @@ public static CommunicationDetailsInner fromJson(JsonReader jsonReader) throws I } else if ("properties".equals(fieldName)) { deserializedCommunicationDetailsInner.innerProperties = CommunicationDetailsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCommunicationDetailsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 2ca70acbc902..d533e1545e35 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 @@ -1,12 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -144,26 +143,6 @@ public OffsetDateTime createdDate() { return this.createdDate; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subject() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property subject in model CommunicationDetailsProperties")); - } - if (body() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property body in model CommunicationDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CommunicationDetailsProperties.class); - /** * {@inheritDoc} */ 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 906d890feb70..a12a67a73ccb 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; @@ -179,17 +179,6 @@ public FileDetailsInner withNumberOfChunks(Integer numberOfChunks) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ 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 920065517c74..c7020f33bc35 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; @@ -117,14 +117,6 @@ public FileDetailsProperties withNumberOfChunks(Integer numberOfChunks) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsInner.java index e0178c321e06..d10671fe37a9 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; @@ -46,7 +46,7 @@ public final class FileWorkspaceDetailsInner extends ProxyResource { /** * Creates an instance of FileWorkspaceDetailsInner class. */ - public FileWorkspaceDetailsInner() { + private FileWorkspaceDetailsInner() { } /** @@ -115,17 +115,6 @@ public OffsetDateTime expirationTime() { return this.innerProperties() == null ? null : this.innerProperties().expirationTime(); } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsProperties.java index 45f3fad585b5..9ca3e4ff44bb 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; @@ -31,7 +31,7 @@ public final class FileWorkspaceDetailsProperties implements JsonSerializable { + /* + * The resource Id of support resource type. + */ + private String resourceId; + + /** + * Creates an instance of LookUpResourceIdResponseInner class. + */ + private LookUpResourceIdResponseInner() { + } + + /** + * Get the resourceId property: The resource Id of support resource type. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LookUpResourceIdResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LookUpResourceIdResponseInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the LookUpResourceIdResponseInner. + */ + public static LookUpResourceIdResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LookUpResourceIdResponseInner deserializedLookUpResourceIdResponseInner + = new LookUpResourceIdResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resourceId".equals(fieldName)) { + deserializedLookUpResourceIdResponseInner.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLookUpResourceIdResponseInner; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/OperationInner.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/OperationInner.java index fa2fa9c1fef1..b312b4d2a1e5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/OperationInner.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/OperationInner.java @@ -1,40 +1,63 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.support.models.ActionType; import com.azure.resourcemanager.support.models.OperationDisplay; +import com.azure.resourcemanager.support.models.Origin; import java.io.IOException; /** - * The operation supported by Microsoft Support resource provider. + * REST API Operation + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* - * Operation name: {provider}/{resource}/{operation}. + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ private String name; /* - * The object that describes the operation. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + * Resource Manager/control-plane operations. + */ + private Boolean isDataAction; + + /* + * Localized display information for this particular operation. */ private OperationDisplay display; + /* + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + * value is "user,system" + */ + private Origin origin; + + /* + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ + private ActionType actionType; + /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. + * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". * * @return the name value. */ @@ -43,7 +66,17 @@ public String name() { } /** - * Get the display property: The object that describes the operation. + * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane + * operations and "false" for Azure Resource Manager/control-plane operations. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Get the display property: Localized display information for this particular operation. * * @return the display value. */ @@ -52,25 +85,23 @@ public OperationDisplay display() { } /** - * Set the display property: The object that describes the operation. + * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and + * audit logs UX. Default value is "user,system". * - * @param display the display value to set. - * @return the OperationInner object itself. + * @return the origin value. */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; + public Origin origin() { + return this.origin; } /** - * Validates the instance. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the actionType value. */ - public void validate() { - if (display() != null) { - display().validate(); - } + public ActionType actionType() { + return this.actionType; } /** @@ -100,8 +131,14 @@ public static OperationInner fromJson(JsonReader jsonReader) throws IOException if ("name".equals(fieldName)) { deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); } else if ("display".equals(fieldName)) { deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); } else { reader.skipChildren(); } 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 1034e1aecac0..5e092270437a 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; @@ -16,91 +17,94 @@ /** * ProblemClassification resource object. */ -@Fluent -public final class ProblemClassificationInner implements JsonSerializable { +@Immutable +public final class ProblemClassificationInner extends ProxyResource { /* - * Id of the resource. + * Properties of the resource. */ - private String id; + private ProblemClassificationProperties innerProperties; /* - * Name of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String name; + private SystemData systemData; /* - * Type of the resource 'Microsoft.Support/problemClassification'. + * The type of the resource. */ private String type; /* - * Properties of the resource. + * The name of the resource. */ - private ProblemClassificationProperties innerProperties; + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; /** * Creates an instance of ProblemClassificationInner class. */ - public ProblemClassificationInner() { + private ProblemClassificationInner() { } /** - * Get the id property: Id of the resource. + * Get the innerProperties property: Properties of the resource. * - * @return the id value. + * @return the innerProperties value. */ - public String id() { - return this.id; + private ProblemClassificationProperties innerProperties() { + return this.innerProperties; } /** - * Get the name property: Name of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the name value. + * @return the systemData value. */ - public String name() { - return this.name; + public SystemData systemData() { + return this.systemData; } /** - * Get the type property: Type of the resource 'Microsoft.Support/problemClassification'. + * Get the type property: The type of the resource. * * @return the type value. */ + @Override public String type() { return this.type; } /** - * Get the innerProperties property: Properties of the resource. + * Get the name property: The name of the resource. * - * @return the innerProperties value. + * @return the name value. */ - private ProblemClassificationProperties innerProperties() { - return this.innerProperties; + @Override + public String name() { + return this.name; } /** - * Get the displayName property: Localized name of problem classification. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the displayName value. + * @return the id value. */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); + @Override + public String id() { + return this.id; } /** - * Set the displayName property: Localized name of problem classification. + * Get the displayName property: Localized name of problem classification. * - * @param displayName the displayName value to set. - * @return the ProblemClassificationInner object itself. + * @return the displayName value. */ - public ProblemClassificationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ProblemClassificationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -113,33 +117,6 @@ public List secondaryConsentEnabled() { return this.innerProperties() == null ? null : this.innerProperties().secondaryConsentEnabled(); } - /** - * Set the secondaryConsentEnabled property: This property indicates whether secondary consent is present for - * problem classification. - * - * @param secondaryConsentEnabled the secondaryConsentEnabled value to set. - * @return the ProblemClassificationInner object itself. - */ - public ProblemClassificationInner - withSecondaryConsentEnabled(List secondaryConsentEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new ProblemClassificationProperties(); - } - this.innerProperties().withSecondaryConsentEnabled(secondaryConsentEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -156,6 +133,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ProblemClassificationInner if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ProblemClassificationInner. */ public static ProblemClassificationInner fromJson(JsonReader jsonReader) throws IOException { @@ -174,6 +152,8 @@ public static ProblemClassificationInner fromJson(JsonReader jsonReader) throws } else if ("properties".equals(fieldName)) { deserializedProblemClassificationInner.innerProperties = ProblemClassificationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedProblemClassificationInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java index 5fa12d454096..fe25854703ba 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * Details about a problem classification available for an Azure service. */ -@Fluent +@Immutable public final class ProblemClassificationProperties implements JsonSerializable { /* * Localized name of problem classification. @@ -31,7 +31,7 @@ public final class ProblemClassificationProperties implements JsonSerializable

secondaryConsentEnabled() { return this.secondaryConsentEnabled; } - /** - * Set the secondaryConsentEnabled property: This property indicates whether secondary consent is present for - * problem classification. - * - * @param secondaryConsentEnabled the secondaryConsentEnabled value to set. - * @return the ProblemClassificationProperties object itself. - */ - public ProblemClassificationProperties - withSecondaryConsentEnabled(List secondaryConsentEnabled) { - this.secondaryConsentEnabled = secondaryConsentEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secondaryConsentEnabled() != null) { - secondaryConsentEnabled().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 new file mode 100644 index 000000000000..0724625a74e9 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationsClassificationOutputInner.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult; +import java.io.IOException; +import java.util.List; + +/** + * Output of the problem classification Classification API. + */ +@Immutable +public final class ProblemClassificationsClassificationOutputInner + implements JsonSerializable { + /* + * Set of problem classification objects classified. + */ + private List problemClassificationResults; + + /** + * Creates an instance of ProblemClassificationsClassificationOutputInner class. + */ + private ProblemClassificationsClassificationOutputInner() { + } + + /** + * Get the problemClassificationResults property: Set of problem classification objects classified. + * + * @return the problemClassificationResults value. + */ + public List problemClassificationResults() { + return this.problemClassificationResults; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("problemClassificationResults", this.problemClassificationResults, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProblemClassificationsClassificationOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProblemClassificationsClassificationOutputInner if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProblemClassificationsClassificationOutputInner. + */ + public static ProblemClassificationsClassificationOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProblemClassificationsClassificationOutputInner deserializedProblemClassificationsClassificationOutputInner + = new ProblemClassificationsClassificationOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("problemClassificationResults".equals(fieldName)) { + List problemClassificationResults + = reader.readArray(reader1 -> ProblemClassificationsClassificationResult.fromJson(reader1)); + deserializedProblemClassificationsClassificationOutputInner.problemClassificationResults + = problemClassificationResults; + } else { + reader.skipChildren(); + } + } + + return deserializedProblemClassificationsClassificationOutputInner; + }); + } +} 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 new file mode 100644 index 000000000000..7b6d7b9c5a67 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceClassificationOutputInner.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.support.models.ServiceClassificationAnswer; +import java.io.IOException; +import java.util.List; + +/** + * Output of the service classification API. + */ +@Immutable +public final class ServiceClassificationOutputInner implements JsonSerializable { + /* + * Set of problem classification objects classified. + */ + private List serviceClassificationResults; + + /** + * Creates an instance of ServiceClassificationOutputInner class. + */ + private ServiceClassificationOutputInner() { + } + + /** + * Get the serviceClassificationResults property: Set of problem classification objects classified. + * + * @return the serviceClassificationResults value. + */ + public List serviceClassificationResults() { + return this.serviceClassificationResults; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("serviceClassificationResults", this.serviceClassificationResults, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceClassificationOutputInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceClassificationOutputInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceClassificationOutputInner. + */ + public static ServiceClassificationOutputInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceClassificationOutputInner deserializedServiceClassificationOutputInner + = new ServiceClassificationOutputInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceClassificationResults".equals(fieldName)) { + List serviceClassificationResults + = reader.readArray(reader1 -> ServiceClassificationAnswer.fromJson(reader1)); + deserializedServiceClassificationOutputInner.serviceClassificationResults + = serviceClassificationResults; + } else { + reader.skipChildren(); + } + } + + return deserializedServiceClassificationOutputInner; + }); + } +} 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 ca538c0c4bf2..b57af81eeba0 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 @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -15,91 +16,94 @@ /** * Object that represents a Service resource. */ -@Fluent -public final class ServiceInner implements JsonSerializable { +@Immutable +public final class ServiceInner extends ProxyResource { /* - * Id of the resource. + * Properties of the resource. */ - private String id; + private ServiceProperties innerProperties; /* - * Name of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String name; + private SystemData systemData; /* - * Type of the resource 'Microsoft.Support/services'. + * The type of the resource. */ private String type; /* - * Properties of the resource. + * The name of the resource. */ - private ServiceProperties innerProperties; + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; /** * Creates an instance of ServiceInner class. */ - public ServiceInner() { + private ServiceInner() { } /** - * Get the id property: Id of the resource. + * Get the innerProperties property: Properties of the resource. * - * @return the id value. + * @return the innerProperties value. */ - public String id() { - return this.id; + private ServiceProperties innerProperties() { + return this.innerProperties; } /** - * Get the name property: Name of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the name value. + * @return the systemData value. */ - public String name() { - return this.name; + public SystemData systemData() { + return this.systemData; } /** - * Get the type property: Type of the resource 'Microsoft.Support/services'. + * Get the type property: The type of the resource. * * @return the type value. */ + @Override public String type() { return this.type; } /** - * Get the innerProperties property: Properties of the resource. + * Get the name property: The name of the resource. * - * @return the innerProperties value. + * @return the name value. */ - private ServiceProperties innerProperties() { - return this.innerProperties; + @Override + public String name() { + return this.name; } /** - * Get the displayName property: Localized name of the Azure service. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the displayName value. + * @return the id value. */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); + @Override + public String id() { + return this.id; } /** - * Set the displayName property: Localized name of the Azure service. + * Get the displayName property: Localized name of the Azure service. * - * @param displayName the displayName value to set. - * @return the ServiceInner object itself. + * @return the displayName value. */ - public ServiceInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -111,31 +115,6 @@ public List resourceTypes() { return this.innerProperties() == null ? null : this.innerProperties().resourceTypes(); } - /** - * Set the resourceTypes property: ARM Resource types. - * - * @param resourceTypes the resourceTypes value to set. - * @return the ServiceInner object itself. - */ - public ServiceInner withResourceTypes(List resourceTypes) { - if (this.innerProperties() == null) { - this.innerProperties = new ServiceProperties(); - } - this.innerProperties().withResourceTypes(resourceTypes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } - /** * {@inheritDoc} */ @@ -152,6 +131,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ServiceInner if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ServiceInner. */ public static ServiceInner fromJson(JsonReader jsonReader) throws IOException { @@ -169,6 +149,8 @@ public static ServiceInner fromJson(JsonReader jsonReader) throws IOException { deserializedServiceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedServiceInner.innerProperties = ServiceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServiceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 9bb8bed13003..49e5ce955c54 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Details about an Azure service available for support ticket creation. */ -@Fluent +@Immutable public final class ServiceProperties implements JsonSerializable { /* * Localized name of the Azure service. @@ -30,7 +30,7 @@ public final class ServiceProperties implements JsonSerializable resourceTypes() { return this.resourceTypes; } - /** - * Set the resourceTypes property: ARM Resource types. - * - * @param resourceTypes the resourceTypes value to set. - * @return the ServiceProperties object itself. - */ - public ServiceProperties withResourceTypes(List resourceTypes) { - this.resourceTypes = resourceTypes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 cd91d870a054..0962411af5b4 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 @@ -1,22 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.support.models.ChatConversationStatus; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; import com.azure.resourcemanager.support.models.IsTemporaryTicket; import com.azure.resourcemanager.support.models.QuotaTicketDetails; import com.azure.resourcemanager.support.models.SecondaryConsent; import com.azure.resourcemanager.support.models.ServiceLevelAgreement; import com.azure.resourcemanager.support.models.SeverityLevel; +import com.azure.resourcemanager.support.models.SupportChannel; import com.azure.resourcemanager.support.models.SupportEngineer; import com.azure.resourcemanager.support.models.TechnicalTicketDetails; import java.io.IOException; @@ -33,6 +36,11 @@ public final class SupportTicketDetailsInner extends ProxyResource { */ private SupportTicketDetailsProperties innerProperties = new SupportTicketDetailsProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -63,6 +71,15 @@ private SupportTicketDetailsProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -615,21 +632,68 @@ public SupportTicketDetailsInner withSecondaryConsent(List sec } /** - * Validates the instance. + * Get the directConnectEscalation property: Direct Connect Escalation details for a support ticket. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the directConnectEscalation value. */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property innerProperties in model SupportTicketDetailsInner")); - } else { - innerProperties().validate(); + public DirectConnectEscalation directConnectEscalation() { + return this.innerProperties() == null ? null : this.innerProperties().directConnectEscalation(); + } + + /** + * Set the directConnectEscalation property: Direct Connect Escalation details for a support ticket. + * + * @param directConnectEscalation the directConnectEscalation value to set. + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withDirectConnectEscalation(DirectConnectEscalation directConnectEscalation) { + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); } + this.innerProperties().withDirectConnectEscalation(directConnectEscalation); + return this; } - private static final ClientLogger LOGGER = new ClientLogger(SupportTicketDetailsInner.class); + /** + * Get the communityForumPost property: Contains a link to the post on the community forum. + * + * @return the communityForumPost value. + */ + public String communityForumPost() { + return this.innerProperties() == null ? null : this.innerProperties().communityForumPost(); + } + + /** + * Set the communityForumPost property: Contains a link to the post on the community forum. + * + * @param communityForumPost the communityForumPost value to set. + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withCommunityForumPost(String communityForumPost) { + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withCommunityForumPost(communityForumPost); + return this; + } + + /** + * Get the supportChannel property: Support channel type for the support ticket. + * + * @return the supportChannel value. + */ + public SupportChannel supportChannel() { + return this.innerProperties() == null ? null : this.innerProperties().supportChannel(); + } + + /** + * Get the chatConversationStatus property: Status of the chat conversation associated with the support ticket. + * + * @return the chatConversationStatus value. + */ + public ChatConversationStatus chatConversationStatus() { + return this.innerProperties() == null ? null : this.innerProperties().chatConversationStatus(); + } /** * {@inheritDoc} @@ -666,6 +730,8 @@ public static SupportTicketDetailsInner fromJson(JsonReader jsonReader) throws I } else if ("properties".equals(fieldName)) { deserializedSupportTicketDetailsInner.innerProperties = SupportTicketDetailsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSupportTicketDetailsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } 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 c7ce69f2e51a..32f898565f18 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 @@ -1,23 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.support.models.ChatConversationStatus; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; import com.azure.resourcemanager.support.models.IsTemporaryTicket; import com.azure.resourcemanager.support.models.QuotaTicketDetails; import com.azure.resourcemanager.support.models.SecondaryConsent; import com.azure.resourcemanager.support.models.ServiceLevelAgreement; import com.azure.resourcemanager.support.models.SeverityLevel; +import com.azure.resourcemanager.support.models.SupportChannel; import com.azure.resourcemanager.support.models.SupportEngineer; import com.azure.resourcemanager.support.models.TechnicalTicketDetails; import java.io.IOException; @@ -168,6 +170,26 @@ public final class SupportTicketDetailsProperties implements JsonSerializable secondaryConsent; + /* + * Direct Connect Escalation details for a support ticket. + */ + private DirectConnectEscalation directConnectEscalation; + + /* + * Contains a link to the post on the community forum. + */ + private String communityForumPost; + + /* + * Support channel type for the support ticket. + */ + private SupportChannel supportChannel; + + /* + * Status of the chat conversation associated with the support ticket. + */ + private ChatConversationStatus chatConversationStatus; + /** * Creates an instance of SupportTicketDetailsProperties class. */ @@ -639,66 +661,62 @@ public SupportTicketDetailsProperties withSecondaryConsent(List e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SupportTicketDetailsProperties.class); + * Get the directConnectEscalation property: Direct Connect Escalation details for a support ticket. + * + * @return the directConnectEscalation value. + */ + public DirectConnectEscalation directConnectEscalation() { + return this.directConnectEscalation; + } + + /** + * Set the directConnectEscalation property: Direct Connect Escalation details for a support ticket. + * + * @param directConnectEscalation the directConnectEscalation value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withDirectConnectEscalation(DirectConnectEscalation directConnectEscalation) { + this.directConnectEscalation = directConnectEscalation; + return this; + } + + /** + * Get the communityForumPost property: Contains a link to the post on the community forum. + * + * @return the communityForumPost value. + */ + public String communityForumPost() { + return this.communityForumPost; + } + + /** + * Set the communityForumPost property: Contains a link to the post on the community forum. + * + * @param communityForumPost the communityForumPost value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withCommunityForumPost(String communityForumPost) { + this.communityForumPost = communityForumPost; + return this; + } + + /** + * Get the supportChannel property: Support channel type for the support ticket. + * + * @return the supportChannel value. + */ + public SupportChannel supportChannel() { + return this.supportChannel; + } + + /** + * Get the chatConversationStatus property: Status of the chat conversation associated with the support ticket. + * + * @return the chatConversationStatus value. + */ + public ChatConversationStatus chatConversationStatus() { + return this.chatConversationStatus; + } /** * {@inheritDoc} @@ -730,6 +748,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("quotaTicketDetails", this.quotaTicketDetails); jsonWriter.writeArrayField("secondaryConsent", this.secondaryConsent, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("directConnectEscalation", this.directConnectEscalation); + jsonWriter.writeStringField("communityForumPost", this.communityForumPost); return jsonWriter.writeEndObject(); } @@ -814,6 +834,17 @@ public static SupportTicketDetailsProperties fromJson(JsonReader jsonReader) thr List secondaryConsent = reader.readArray(reader1 -> SecondaryConsent.fromJson(reader1)); deserializedSupportTicketDetailsProperties.secondaryConsent = secondaryConsent; + } else if ("directConnectEscalation".equals(fieldName)) { + deserializedSupportTicketDetailsProperties.directConnectEscalation + = DirectConnectEscalation.fromJson(reader); + } else if ("communityForumPost".equals(fieldName)) { + deserializedSupportTicketDetailsProperties.communityForumPost = reader.getString(); + } else if ("supportChannel".equals(fieldName)) { + deserializedSupportTicketDetailsProperties.supportChannel + = SupportChannel.fromString(reader.getString()); + } else if ("chatConversationStatus".equals(fieldName)) { + deserializedSupportTicketDetailsProperties.chatConversationStatus + = ChatConversationStatus.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/package-info.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/package-info.java index fd226a7b121d..3f1e661017a5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/package-info.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for MicrosoftSupport. + * Package containing the inner data models for Support. * Microsoft Azure Support Resource Provider. */ package com.azure.resourcemanager.support.fluent.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/package-info.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/package-info.java index 871c993c0085..5d19487cc05d 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/package-info.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for MicrosoftSupport. + * Package containing the service clients for Support. * Microsoft Azure Support Resource Provider. */ package com.azure.resourcemanager.support.fluent; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptDetailsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptDetailsImpl.java index 1714cd86bf73..ee91d0d0ba5c 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptDetailsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptDetailsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsClientImpl.java index 9276b585e8cd..073634a36086 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.ChatTranscriptsClient; import com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsInner; -import com.azure.resourcemanager.support.models.ChatTranscriptsListResult; +import com.azure.resourcemanager.support.implementation.models.ChatTranscriptsListResult; import reactor.core.publisher.Mono; /** @@ -42,302 +42,271 @@ public final class ChatTranscriptsClientImpl implements ChatTranscriptsClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of ChatTranscriptsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ChatTranscriptsClientImpl(MicrosoftSupportImpl client) { + ChatTranscriptsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(ChatTranscriptsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportChatTranscripts to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for SupportManagementClientChatTranscripts to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportChat") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientChatTranscripts") public interface ChatTranscriptsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts/{chatTranscriptName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("supportTicketName") String supportTicketName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("chatTranscriptName") String chatTranscriptName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts/{chatTranscriptName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("supportTicketName") String supportTicketName, - @PathParam("chatTranscriptName") String chatTranscriptName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("chatTranscriptName") String chatTranscriptName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of + * @return object that represents a Chat Transcript resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String supportTicketName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String supportTicketName, + String chatTranscriptName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), supportTicketName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, chatTranscriptName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return object that represents a Chat Transcript resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String supportTicketName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), supportTicketName, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono getAsync(String supportTicketName, String chatTranscriptName) { + return getWithResponseAsync(supportTicketName, chatTranscriptName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedFlux}. + * @return object that represents a Chat Transcript resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName) { - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String supportTicketName, String chatTranscriptName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + supportTicketName, chatTranscriptName, accept, context); } /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedFlux}. + * @return object that represents a Chat Transcript resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName) { + return getWithResponse(supportTicketName, chatTranscriptName, Context.NONE).getValue(); } /** * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String supportTicketName) { - return new PagedIterable<>(listAsync(supportTicketName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String supportTicketName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String supportTicketName, Context context) { - return new PagedIterable<>(listAsync(supportTicketName, context)); + private PagedFlux listAsync(String supportTicketName) { + return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String chatTranscriptName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (chatTranscriptName == null) { - return Mono - .error(new IllegalArgumentException("Parameter chatTranscriptName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listSinglePage(String supportTicketName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), supportTicketName, chatTranscriptName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), supportTicketName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String chatTranscriptName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (chatTranscriptName == null) { - return Mono - .error(new IllegalArgumentException("Parameter chatTranscriptName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listSinglePage(String supportTicketName, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), supportTicketName, chatTranscriptName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), supportTicketName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource on successful completion of {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String supportTicketName, String chatTranscriptName) { - return getWithResponseAsync(supportTicketName, chatTranscriptName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String supportTicketName) { + return new PagedIterable<>(() -> listSinglePage(supportTicketName), nextLink -> listNextSinglePage(nextLink)); } /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String supportTicketName, String chatTranscriptName, - Context context) { - return getWithResponseAsync(supportTicketName, chatTranscriptName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String supportTicketName, Context context) { + return new PagedIterable<>(() -> listSinglePage(supportTicketName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Returns chatTranscript details for a support ticket under a subscription. + * Get the next page of items. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName) { - return getWithResponse(supportTicketName, chatTranscriptName, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -347,23 +316,15 @@ public ChatTranscriptDetailsInner get(String supportTicketName, String chatTrans * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -374,22 +335,14 @@ private Mono> listNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsImpl.java index d8aa9d93127f..d81dd1608a1a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,26 +27,12 @@ public ChatTranscriptsImpl(ChatTranscriptsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String supportTicketName) { - PagedIterable inner = this.serviceClient().list(supportTicketName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(String supportTicketName, Context context) { - PagedIterable inner = this.serviceClient().list(supportTicketName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); - } - public Response getWithResponse(String supportTicketName, String chatTranscriptName, Context context) { Response inner = this.serviceClient().getWithResponse(supportTicketName, chatTranscriptName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ChatTranscriptDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ChatTranscriptDetailsImpl(inner.getValue(), this.manager())); } public ChatTranscriptDetails get(String supportTicketName, String chatTranscriptName) { @@ -58,6 +44,16 @@ public ChatTranscriptDetails get(String supportTicketName, String chatTranscript } } + public PagedIterable list(String supportTicketName) { + PagedIterable inner = this.serviceClient().list(supportTicketName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); + } + + public PagedIterable list(String supportTicketName, Context context) { + PagedIterable inner = this.serviceClient().list(supportTicketName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); + } + private ChatTranscriptsClient serviceClient() { return this.innerClient; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsClientImpl.java index cbc850c820e7..8ca0057bb355 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsInner; -import com.azure.resourcemanager.support.models.ChatTranscriptsListResult; +import com.azure.resourcemanager.support.implementation.models.ChatTranscriptsListResult; import reactor.core.publisher.Mono; /** @@ -42,41 +42,58 @@ public final class ChatTranscriptsNoSubscriptionsClientImpl implements ChatTrans /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of ChatTranscriptsNoSubscriptionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ChatTranscriptsNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { + ChatTranscriptsNoSubscriptionsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(ChatTranscriptsNoSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportChatTranscriptsNoSubscriptions to be used by the - * proxy service to perform REST calls. + * The interface defining all the services for SupportManagementClientChatTranscriptsNoSubscriptions to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportChat") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientChatTranscriptsNoSubscriptions") public interface ChatTranscriptsNoSubscriptionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts/{chatTranscriptName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @PathParam("chatTranscriptName") String chatTranscriptName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts/{chatTranscriptName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @PathParam("chatTranscriptName") String chatTranscriptName, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("api-version") String apiVersion, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts/{chatTranscriptName}") + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/chatTranscripts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, - @PathParam("chatTranscriptName") String chatTranscriptName, @QueryParam("api-version") String apiVersion, + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -84,240 +101,208 @@ Mono> get(@HostParam("$host") String endpoi @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of + * @return object that represents a Chat Transcript resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String supportTicketName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String supportTicketName, + String chatTranscriptName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), supportTicketName, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, chatTranscriptName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return object that represents a Chat Transcript resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String supportTicketName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), supportTicketName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + private Mono getAsync(String supportTicketName, String chatTranscriptName) { + return getWithResponseAsync(supportTicketName, chatTranscriptName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedFlux}. + * @return object that represents a Chat Transcript resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName) { - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String supportTicketName, String chatTranscriptName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + chatTranscriptName, accept, context); } /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedFlux}. + * @return object that represents a Chat Transcript resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName) { + return getWithResponse(supportTicketName, chatTranscriptName, Context.NONE).getValue(); } /** * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String supportTicketName) { - return new PagedIterable<>(listAsync(supportTicketName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String supportTicketName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String supportTicketName, Context context) { - return new PagedIterable<>(listAsync(supportTicketName, context)); + private PagedFlux listAsync(String supportTicketName) { + return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String chatTranscriptName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (chatTranscriptName == null) { - return Mono - .error(new IllegalArgumentException("Parameter chatTranscriptName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String supportTicketName) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), supportTicketName, chatTranscriptName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), supportTicketName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String chatTranscriptName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (chatTranscriptName == null) { - return Mono - .error(new IllegalArgumentException("Parameter chatTranscriptName is required and cannot be null.")); - } + private PagedResponse listSinglePage(String supportTicketName, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), supportTicketName, chatTranscriptName, - this.client.getApiVersion(), accept, context); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), supportTicketName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource on successful completion of {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String supportTicketName, String chatTranscriptName) { - return getWithResponseAsync(supportTicketName, chatTranscriptName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String supportTicketName) { + return new PagedIterable<>(() -> listSinglePage(supportTicketName), nextLink -> listNextSinglePage(nextLink)); } /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String supportTicketName, String chatTranscriptName, - Context context) { - return getWithResponseAsync(supportTicketName, chatTranscriptName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String supportTicketName, Context context) { + return new PagedIterable<>(() -> listSinglePage(supportTicketName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Returns chatTranscript details for a no subscription support ticket. + * Get the next page of items. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ChatTranscriptDetailsInner get(String supportTicketName, String chatTranscriptName) { - return getWithResponse(supportTicketName, chatTranscriptName, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -327,23 +312,15 @@ public ChatTranscriptDetailsInner get(String supportTicketName, String chatTrans * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -354,22 +331,14 @@ private Mono> listNextSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsImpl.java index 860b19394901..8aa184a80545 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,26 +27,12 @@ public ChatTranscriptsNoSubscriptionsImpl(ChatTranscriptsNoSubscriptionsClient i this.serviceManager = serviceManager; } - public PagedIterable list(String supportTicketName) { - PagedIterable inner = this.serviceClient().list(supportTicketName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(String supportTicketName, Context context) { - PagedIterable inner = this.serviceClient().list(supportTicketName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); - } - public Response getWithResponse(String supportTicketName, String chatTranscriptName, Context context) { Response inner = this.serviceClient().getWithResponse(supportTicketName, chatTranscriptName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ChatTranscriptDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ChatTranscriptDetailsImpl(inner.getValue(), this.manager())); } public ChatTranscriptDetails get(String supportTicketName, String chatTranscriptName) { @@ -58,6 +44,16 @@ public ChatTranscriptDetails get(String supportTicketName, String chatTranscript } } + public PagedIterable list(String supportTicketName) { + PagedIterable inner = this.serviceClient().list(supportTicketName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); + } + + public PagedIterable list(String supportTicketName, Context context) { + PagedIterable inner = this.serviceClient().list(supportTicketName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ChatTranscriptDetailsImpl(inner1, this.manager())); + } + private ChatTranscriptsNoSubscriptionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CheckNameAvailabilityOutputImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CheckNameAvailabilityOutputImpl.java index 355f07b7b84f..7cc62474c198 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CheckNameAvailabilityOutputImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CheckNameAvailabilityOutputImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsClientImpl.java new file mode 100644 index 000000000000..f168eabe7ed3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsClientImpl.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.ClassifyProblemsClient; +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 ClassifyProblemsClient. + */ +public final class ClassifyProblemsClientImpl implements ClassifyProblemsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClassifyProblemsService service; + + /** + * The service client containing this operation class. + */ + private final SupportManagementClientImpl client; + + /** + * Initializes an instance of ClassifyProblemsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClassifyProblemsClientImpl(SupportManagementClientImpl client) { + this.service + = RestProxy.create(ClassifyProblemsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SupportManagementClientClassifyProblems to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientClassifyProblems") + public interface ClassifyProblemsService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> classifyProblems( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("problemServiceName") String problemServiceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProblemClassificationsClassificationInput problemClassificationsClassificationInput, + Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response classifyProblemsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("problemServiceName") String problemServiceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") 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 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.classifyProblems(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), problemServiceName, contentType, accept, + problemClassificationsClassificationInput, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.classifyProblemsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), problemServiceName, contentType, accept, + problemClassificationsClassificationInput, 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. + */ + @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/ClassifyProblemsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsImpl.java new file mode 100644 index 000000000000..dc7df9fb7848 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ClassifyProblemsClient; +import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; +import com.azure.resourcemanager.support.models.ClassifyProblems; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; + +public final class ClassifyProblemsImpl implements ClassifyProblems { + private static final ClientLogger LOGGER = new ClientLogger(ClassifyProblemsImpl.class); + + private final ClassifyProblemsClient innerClient; + + private final com.azure.resourcemanager.support.SupportManager serviceManager; + + public ClassifyProblemsImpl(ClassifyProblemsClient 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProblemClassificationsClassificationOutputImpl(inner.getValue(), this.manager())); + } + + 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 ClassifyProblemsClient 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/ClassifyProblemsNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsNoSubscriptionsClientImpl.java new file mode 100644 index 000000000000..1cb3aa5ab8a7 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsNoSubscriptionsClientImpl.java @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.ClassifyProblemsNoSubscriptionsClient; +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 ClassifyProblemsNoSubscriptionsClient. + */ +public final class ClassifyProblemsNoSubscriptionsClientImpl implements ClassifyProblemsNoSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClassifyProblemsNoSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final SupportManagementClientImpl client; + + /** + * Initializes an instance of ClassifyProblemsNoSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClassifyProblemsNoSubscriptionsClientImpl(SupportManagementClientImpl client) { + this.service = RestProxy.create(ClassifyProblemsNoSubscriptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SupportManagementClientClassifyProblemsNoSubscriptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientClassifyProblemsNoSubscriptions") + public interface ClassifyProblemsNoSubscriptionsService { + @Post("/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> classifyProblems( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("problemServiceName") String problemServiceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ProblemClassificationsClassificationInput problemClassificationsClassificationInput, + Context context); + + @Post("/providers/Microsoft.Support/services/{problemServiceName}/classifyProblems") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response classifyProblemsSync( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("problemServiceName") String problemServiceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") 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 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.classifyProblems(this.client.getEndpoint(), this.client.getApiVersion(), + problemServiceName, contentType, accept, problemClassificationsClassificationInput, 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.classifyProblemsSync(this.client.getEndpoint(), this.client.getApiVersion(), problemServiceName, + contentType, accept, problemClassificationsClassificationInput, 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. + */ + @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/ClassifyProblemsNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsNoSubscriptionsImpl.java new file mode 100644 index 000000000000..869dad4708ea --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsNoSubscriptionsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ClassifyProblemsNoSubscriptionsClient; +import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; +import com.azure.resourcemanager.support.models.ClassifyProblemsNoSubscriptions; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; + +public final class ClassifyProblemsNoSubscriptionsImpl implements ClassifyProblemsNoSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(ClassifyProblemsNoSubscriptionsImpl.class); + + private final ClassifyProblemsNoSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.support.SupportManager serviceManager; + + public ClassifyProblemsNoSubscriptionsImpl(ClassifyProblemsNoSubscriptionsClient 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProblemClassificationsClassificationOutputImpl(inner.getValue(), this.manager())); + } + + 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 ClassifyProblemsNoSubscriptionsClient 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/ClassifyServicesClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesClientImpl.java new file mode 100644 index 000000000000..b1864557e8d3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesClientImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.ClassifyServicesClient; +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 ClassifyServicesClient. + */ +public final class ClassifyServicesClientImpl implements ClassifyServicesClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClassifyServicesService service; + + /** + * The service client containing this operation class. + */ + private final SupportManagementClientImpl client; + + /** + * Initializes an instance of ClassifyServicesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClassifyServicesClientImpl(SupportManagementClientImpl client) { + this.service + = RestProxy.create(ClassifyServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SupportManagementClientClassifyServices to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientClassifyServices") + public interface ClassifyServicesService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/classifyServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> classifyServices(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceClassificationRequest serviceClassificationRequest, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/classifyServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response classifyServicesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") 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 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.classifyServices(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, serviceClassificationRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.classifyServicesSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, serviceClassificationRequest, 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. + */ + @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/ClassifyServicesImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesImpl.java new file mode 100644 index 000000000000..7199a569ba18 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ClassifyServicesClient; +import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; +import com.azure.resourcemanager.support.models.ClassifyServices; +import com.azure.resourcemanager.support.models.ServiceClassificationOutput; +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; + +public final class ClassifyServicesImpl implements ClassifyServices { + private static final ClientLogger LOGGER = new ClientLogger(ClassifyServicesImpl.class); + + private final ClassifyServicesClient innerClient; + + private final com.azure.resourcemanager.support.SupportManager serviceManager; + + public ClassifyServicesImpl(ClassifyServicesClient 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServiceClassificationOutputImpl(inner.getValue(), this.manager())); + } + + public ServiceClassificationOutput classifyServices(ServiceClassificationRequest serviceClassificationRequest) { + ServiceClassificationOutputInner inner = this.serviceClient().classifyServices(serviceClassificationRequest); + if (inner != null) { + return new ServiceClassificationOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + private ClassifyServicesClient 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/ClassifyServicesNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesNoSubscriptionsClientImpl.java new file mode 100644 index 000000000000..1e9d113e5ac3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesNoSubscriptionsClientImpl.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.ClassifyServicesNoSubscriptionsClient; +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 ClassifyServicesNoSubscriptionsClient. + */ +public final class ClassifyServicesNoSubscriptionsClientImpl implements ClassifyServicesNoSubscriptionsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ClassifyServicesNoSubscriptionsService service; + + /** + * The service client containing this operation class. + */ + private final SupportManagementClientImpl client; + + /** + * Initializes an instance of ClassifyServicesNoSubscriptionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ClassifyServicesNoSubscriptionsClientImpl(SupportManagementClientImpl client) { + this.service = RestProxy.create(ClassifyServicesNoSubscriptionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SupportManagementClientClassifyServicesNoSubscriptions to be used by + * the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientClassifyServicesNoSubscriptions") + public interface ClassifyServicesNoSubscriptionsService { + @Post("/providers/Microsoft.Support/classifyServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> classifyServices(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ServiceClassificationRequest serviceClassificationRequest, Context context); + + @Post("/providers/Microsoft.Support/classifyServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response classifyServicesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") 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 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.classifyServices(this.client.getEndpoint(), this.client.getApiVersion(), + contentType, accept, serviceClassificationRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * 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) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.classifyServicesSync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, accept, + serviceClassificationRequest, 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. + */ + @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/ClassifyServicesNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesNoSubscriptionsImpl.java new file mode 100644 index 000000000000..ff52a9415ec3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesNoSubscriptionsImpl.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.ClassifyServicesNoSubscriptionsClient; +import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; +import com.azure.resourcemanager.support.models.ClassifyServicesNoSubscriptions; +import com.azure.resourcemanager.support.models.ServiceClassificationOutput; +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; + +public final class ClassifyServicesNoSubscriptionsImpl implements ClassifyServicesNoSubscriptions { + private static final ClientLogger LOGGER = new ClientLogger(ClassifyServicesNoSubscriptionsImpl.class); + + private final ClassifyServicesNoSubscriptionsClient innerClient; + + private final com.azure.resourcemanager.support.SupportManager serviceManager; + + public ClassifyServicesNoSubscriptionsImpl(ClassifyServicesNoSubscriptionsClient 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); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServiceClassificationOutputImpl(inner.getValue(), this.manager())); + } + + public ServiceClassificationOutput classifyServices(ServiceClassificationRequest serviceClassificationRequest) { + ServiceClassificationOutputInner inner = this.serviceClient().classifyServices(serviceClassificationRequest); + if (inner != null) { + return new ServiceClassificationOutputImpl(inner, this.manager()); + } else { + return null; + } + } + + private ClassifyServicesNoSubscriptionsClient 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/CommunicationDetailsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationDetailsImpl.java index da2c725fa3cf..ccf4e14e4820 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationDetailsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationDetailsImpl.java @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; import com.azure.resourcemanager.support.models.CommunicationDetails; @@ -34,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public CommunicationType communicationType() { return this.innerModel().communicationType(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsClientImpl.java index 2b8300ec3a40..89ae1a95c227 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,6 +27,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -34,8 +35,8 @@ import com.azure.resourcemanager.support.fluent.CommunicationsClient; import com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; +import com.azure.resourcemanager.support.implementation.models.CommunicationsListResult; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; -import com.azure.resourcemanager.support.models.CommunicationsListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,208 +53,371 @@ public final class CommunicationsClientImpl implements CommunicationsClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of CommunicationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CommunicationsClientImpl(MicrosoftSupportImpl client) { + CommunicationsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(CommunicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportCommunications to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for SupportManagementClientCommunications to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportComm") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientCommunications") public interface CommunicationsService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("supportTicketName") String supportTicketName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, - @HeaderParam("Accept") String accept, Context context); + @PathParam("communicationName") String communicationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("$top") Integer top, - @QueryParam("$filter") String filter, @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, + @PathParam("communicationName") String communicationName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("supportTicketName") String supportTicketName, - @PathParam("communicationName") String communicationName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("communicationName") String communicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommunicationDetailsInner createCommunicationParameters, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("supportTicketName") String supportTicketName, - @PathParam("communicationName") String communicationName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CommunicationDetailsInner createCommunicationParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("communicationName") String communicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommunicationDetailsInner createCommunicationParameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @QueryParam("$top") Integer top, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @QueryParam("$top") Integer top, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of + * @return object that represents a Communication resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } + private Mono> getWithResponseAsync(String supportTicketName, + String communicationName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), supportTicketName, - this.client.getSubscriptionId(), this.client.getApiVersion(), checkNameAvailabilityInput, accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, communicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String supportTicketName, String communicationName) { + return getWithResponseAsync(supportTicketName, communicationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns communication details for a support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of + * @return object that represents a Communication resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String supportTicketName, String communicationName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + supportTicketName, communicationName, accept, context); + } + + /** + * Returns communication details for a support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunicationDetailsInner get(String supportTicketName, String communicationName) { + return getWithResponse(supportTicketName, communicationName, Context.NONE).getValue(); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } + private Mono>> createWithResponseAsync(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), supportTicketName, - this.client.getSubscriptionId(), this.client.getApiVersion(), checkNameAvailabilityInput, accept, context); + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, communicationName, contentType, accept, + createCommunicationParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API on successful completion of {@link Mono}. + * @return object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponseAsync(supportTicketName, checkNameAvailabilityInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response createWithResponse(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, communicationName, contentType, accept, + createCommunicationParameters, Context.NONE); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - return checkNameAvailabilityWithResponseAsync(supportTicketName, checkNameAvailabilityInput, context).block(); + private Response createWithResponse(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, communicationName, contentType, accept, + createCommunicationParameters, context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return the {@link PollerFlux} for polling of object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommunicationDetailsInner> beginCreateAsync( + String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + Mono>> mono + = createWithResponseAsync(supportTicketName, communicationName, createCommunicationParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, + this.client.getContext()); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommunicationDetailsInner> beginCreate( + String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + Response response + = createWithResponse(supportTicketName, communicationName, createCommunicationParameters); + return this.client.getLroResult(response, + CommunicationDetailsInner.class, CommunicationDetailsInner.class, Context.NONE); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommunicationDetailsInner> beginCreate( + String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, + Context context) { + Response response + = createWithResponse(supportTicketName, communicationName, createCommunicationParameters, context); + return this.client.getLroResult(response, + CommunicationDetailsInner.class, CommunicationDetailsInner.class, context); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, Context.NONE) - .getValue(); + private Mono createAsync(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + return beginCreate(supportTicketName, communicationName, createCommunicationParameters).getFinalResult(); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context) { + return beginCreate(supportTicketName, communicationName, createCommunicationParameters, context) + .getFinalResult(); } /** @@ -264,7 +428,7 @@ public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTick * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -273,28 +437,16 @@ public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTick * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String supportTicketName, Integer top, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), supportTicketName, top, filter, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, top, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -308,41 +460,21 @@ private Mono> listSinglePageAsync(Strin * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical * And ('and') operator. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String supportTicketName, Integer top, - String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), supportTicketName, top, filter, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String supportTicketName, Integer top, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -353,19 +485,16 @@ private Mono> listSinglePageAsync(Strin * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. - * @param top The number of values to return in the collection. Default is 10 and max is 10. - * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate - * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and - * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical - * And ('and') operator. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedFlux}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName, Integer top, String filter) { + private PagedFlux listAsync(String supportTicketName) { + final Integer top = null; + final String filter = null; return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -378,18 +507,26 @@ private PagedFlux listAsync(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate + * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and + * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical + * And ('and') operator. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedFlux}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName) { - final Integer top = null; - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String supportTicketName, Integer top, + String filter) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + supportTicketName, top, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -400,7 +537,7 @@ private PagedFlux listAsync(String supportTicketName) * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -410,13 +547,17 @@ private PagedFlux listAsync(String supportTicketName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedFlux}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName, Integer top, String filter, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String supportTicketName, Integer top, + String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + supportTicketName, top, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -427,17 +568,18 @@ private PagedFlux listAsync(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String supportTicketName) { final Integer top = null; final String filter = null; - return new PagedIterable<>(listAsync(supportTicketName, top, filter)); + return new PagedIterable<>(() -> listSinglePage(supportTicketName, top, filter), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -448,7 +590,7 @@ public PagedIterable list(String supportTicketName) { * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -458,380 +600,116 @@ public PagedIterable list(String supportTicketName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String supportTicketName, Integer top, String filter, Context context) { - return new PagedIterable<>(listAsync(supportTicketName, top, filter, context)); + return new PagedIterable<>(() -> listSinglePage(supportTicketName, top, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of + * @return output of check name availability API along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String communicationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> checkNameAvailabilityWithResponseAsync( + String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), supportTicketName, contentType, accept, + checkNameAvailabilityInput, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns communication details for a support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String communicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); - } - - /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource on successful completion of {@link Mono}. + * @return output of check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String supportTicketName, String communicationName) { - return getWithResponseAsync(supportTicketName, communicationName) + private Mono checkNameAvailabilityAsync(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(supportTicketName, checkNameAvailabilityInput) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response}. + * @return output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String supportTicketName, String communicationName, - Context context) { - return getWithResponseAsync(supportTicketName, communicationName, context).block(); + public Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, contentType, accept, checkNameAvailabilityInput, + context); } /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CommunicationDetailsInner get(String supportTicketName, String communicationName) { - return getWithResponse(supportTicketName, communicationName, Context.NONE).getValue(); + public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, Context.NONE) + .getValue(); } /** - * Adds a new customer communication to an Azure support ticket. + * Get the next page of items. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (createCommunicationParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createCommunicationParameters is required and cannot be null.")); - } else { - createCommunicationParameters.validate(); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getSubscriptionId(), this.client.getApiVersion(), createCommunicationParameters, accept, - context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (createCommunicationParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createCommunicationParameters is required and cannot be null.")); - } else { - createCommunicationParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getSubscriptionId(), this.client.getApiVersion(), createCommunicationParameters, accept, - context); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommunicationDetailsInner> beginCreateAsync( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { - Mono>> mono - = createWithResponseAsync(supportTicketName, communicationName, createCommunicationParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, - this.client.getContext()); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommunicationDetailsInner> beginCreateAsync( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(supportTicketName, communicationName, createCommunicationParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, context); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommunicationDetailsInner> beginCreate( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { - return this.beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters) - .getSyncPoller(); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommunicationDetailsInner> beginCreate( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, - Context context) { - return this.beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters, context) - .getSyncPoller(); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters) { - return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context) { - return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters) { - return createAsync(supportTicketName, communicationName, createCommunicationParameters).block(); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context) { - return createAsync(supportTicketName, communicationName, createCommunicationParameters, context).block(); - } - /** * Get the next page of items. * @@ -839,23 +717,15 @@ public CommunicationDetailsInner create(String supportTicketName, String communi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -866,22 +736,14 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsImpl.java index cb308bb6c875..3911e649ea98 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -30,24 +30,18 @@ public CommunicationsImpl(CommunicationsClient innerClient, this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - Response inner = this.serviceClient() - .checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getWithResponse(String supportTicketName, String communicationName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(supportTicketName, communicationName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CommunicationDetailsImpl(inner.getValue(), this.manager())); } - public CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput) { - CheckNameAvailabilityOutputInner inner - = this.serviceClient().checkNameAvailability(supportTicketName, checkNameAvailabilityInput); + public CommunicationDetails get(String supportTicketName, String communicationName) { + CommunicationDetailsInner inner = this.serviceClient().get(supportTicketName, communicationName); if (inner != null) { - return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + return new CommunicationDetailsImpl(inner, this.manager()); } else { return null; } @@ -65,22 +59,20 @@ public PagedIterable list(String supportTicketName, Intege return ResourceManagerUtils.mapPage(inner, inner1 -> new CommunicationDetailsImpl(inner1, this.manager())); } - public Response getWithResponse(String supportTicketName, String communicationName, - Context context) { - Response inner - = this.serviceClient().getWithResponse(supportTicketName, communicationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommunicationDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner = this.serviceClient() + .checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); } - public CommunicationDetails get(String supportTicketName, String communicationName) { - CommunicationDetailsInner inner = this.serviceClient().get(supportTicketName, communicationName); + public CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner + = this.serviceClient().checkNameAvailability(supportTicketName, checkNameAvailabilityInput); if (inner != null) { - return new CommunicationDetailsImpl(inner, this.manager()); + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsClientImpl.java index 8d55d95df707..fdee54b9ecbc 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,6 +27,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -34,8 +35,8 @@ import com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; +import com.azure.resourcemanager.support.implementation.models.CommunicationsListResult; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; -import com.azure.resourcemanager.support.models.CommunicationsListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -52,196 +53,362 @@ public final class CommunicationsNoSubscriptionsClientImpl implements Communicat /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of CommunicationsNoSubscriptionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - CommunicationsNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { + CommunicationsNoSubscriptionsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(CommunicationsNoSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportCommunicationsNoSubscriptions to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for SupportManagementClientCommunicationsNoSubscriptions to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportComm") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientCommunicationsNoSubscriptions") public interface CommunicationsNoSubscriptionsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @PathParam("communicationName") String communicationName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("$top") Integer top, - @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @PathParam("communicationName") String communicationName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @PathParam("communicationName") String communicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommunicationDetailsInner createCommunicationParameters, Context context); + + @Put("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @PathParam("communicationName") String communicationName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommunicationDetailsInner createCommunicationParameters, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, - @PathParam("communicationName") String communicationName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") - @ExpectedResponses({ 200, 202 }) + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, - @PathParam("communicationName") String communicationName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CommunicationDetailsInner createCommunicationParameters, - @HeaderParam("Accept") String accept, Context context); + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, + Context context); + + @Post("/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + @Post("/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of + * @return object that represents a Communication resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } + private Mono> getWithResponseAsync(String supportTicketName, + String communicationName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), supportTicketName, - this.client.getApiVersion(), checkNameAvailabilityInput, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, communicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String supportTicketName, String communicationName) { + return getWithResponseAsync(supportTicketName, communicationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Returns communication details for a support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of + * @return object that represents a Communication resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String supportTicketName, String communicationName, + Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + communicationName, accept, context); + } + + /** + * Returns communication details for a support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunicationDetailsInner get(String supportTicketName, String communicationName) { + return getWithResponse(supportTicketName, communicationName, Context.NONE).getValue(); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameAvailabilityWithResponseAsync( - String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } + private Mono>> createWithResponseAsync(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), supportTicketName, this.client.getApiVersion(), - checkNameAvailabilityInput, accept, context); + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, communicationName, contentType, accept, createCommunicationParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API on successful completion of {@link Mono}. + * @return object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono checkNameAvailabilityAsync(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponseAsync(supportTicketName, checkNameAvailabilityInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Response createWithResponse(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + communicationName, contentType, accept, createCommunicationParameters, Context.NONE); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - return checkNameAvailabilityWithResponseAsync(supportTicketName, checkNameAvailabilityInput, context).block(); + private Response createWithResponse(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + communicationName, contentType, accept, createCommunicationParameters, context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Adds a new customer communication to an Azure support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return the {@link PollerFlux} for polling of object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CommunicationDetailsInner> beginCreateAsync( + String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + Mono>> mono + = createWithResponseAsync(supportTicketName, communicationName, createCommunicationParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, + this.client.getContext()); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommunicationDetailsInner> beginCreate( + String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + Response response + = createWithResponse(supportTicketName, communicationName, createCommunicationParameters); + return this.client.getLroResult(response, + CommunicationDetailsInner.class, CommunicationDetailsInner.class, Context.NONE); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CommunicationDetailsInner> beginCreate( + String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, + Context context) { + Response response + = createWithResponse(supportTicketName, communicationName, createCommunicationParameters, context); + return this.client.getLroResult(response, + CommunicationDetailsInner.class, CommunicationDetailsInner.class, context); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, Context.NONE) - .getValue(); + private Mono createAsync(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters) { + return beginCreate(supportTicketName, communicationName, createCommunicationParameters).getFinalResult(); + } + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CommunicationDetailsInner create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context) { + return beginCreate(supportTicketName, communicationName, createCommunicationParameters, context) + .getFinalResult(); } /** @@ -252,7 +419,7 @@ public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTick * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -261,24 +428,16 @@ public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTick * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String supportTicketName, Integer top, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), supportTicketName, top, filter, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, top, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -292,37 +451,21 @@ private Mono> listSinglePageAsync(Strin * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical * And ('and') operator. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String supportTicketName, Integer top, - String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), supportTicketName, top, filter, this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String supportTicketName, Integer top, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -333,19 +476,16 @@ private Mono> listSinglePageAsync(Strin * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. - * @param top The number of values to return in the collection. Default is 10 and max is 10. - * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate - * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and - * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical - * And ('and') operator. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedFlux}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName, Integer top, String filter) { + private PagedFlux listAsync(String supportTicketName) { + final Integer top = null; + final String filter = null; return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -358,18 +498,25 @@ private PagedFlux listAsync(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate + * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and + * Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical + * And ('and') operator. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedFlux}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName) { - final Integer top = null; - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String supportTicketName, Integer top, + String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), supportTicketName, top, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -380,7 +527,7 @@ private PagedFlux listAsync(String supportTicketName) * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -390,13 +537,16 @@ private PagedFlux listAsync(String supportTicketName) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedFlux}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String supportTicketName, Integer top, String filter, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(supportTicketName, top, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String supportTicketName, Integer top, + String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), supportTicketName, top, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -407,17 +557,18 @@ private PagedFlux listAsync(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String supportTicketName) { final Integer top = null; final String filter = null; - return new PagedIterable<>(listAsync(supportTicketName, top, filter)); + return new PagedIterable<>(() -> listSinglePage(supportTicketName, top, filter), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -428,7 +579,7 @@ public PagedIterable list(String supportTicketName) { * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -438,362 +589,115 @@ public PagedIterable list(String supportTicketName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String supportTicketName, Integer top, String filter, Context context) { - return new PagedIterable<>(listAsync(supportTicketName, top, filter, context)); + return new PagedIterable<>(() -> listSinglePage(supportTicketName, top, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of + * @return output of check name availability API along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String communicationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } + private Mono> checkNameAvailabilityWithResponseAsync( + String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, contentType, accept, checkNameAvailabilityInput, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns communication details for a support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, - String communicationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), supportTicketName, communicationName, this.client.getApiVersion(), - accept, context); - } - - /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource on successful completion of {@link Mono}. + * @return output of check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String supportTicketName, String communicationName) { - return getWithResponseAsync(supportTicketName, communicationName) + private Mono checkNameAvailabilityAsync(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(supportTicketName, checkNameAvailabilityInput) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response}. + * @return output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String supportTicketName, String communicationName, - Context context) { - return getWithResponseAsync(supportTicketName, communicationName, context).block(); + public Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, contentType, accept, checkNameAvailabilityInput, context); } /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CommunicationDetailsInner get(String supportTicketName, String communicationName) { - return getWithResponse(supportTicketName, communicationName, Context.NONE).getValue(); + public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, Context.NONE) + .getValue(); } /** - * Adds a new customer communication to an Azure support ticket. + * Get the next page of items. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - if (createCommunicationParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createCommunicationParameters is required and cannot be null.")); - } else { - createCommunicationParameters.validate(); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getApiVersion(), createCommunicationParameters, accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (communicationName == null) { - return Mono - .error(new IllegalArgumentException("Parameter communicationName is required and cannot be null.")); - } - if (createCommunicationParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createCommunicationParameters is required and cannot be null.")); - } else { - createCommunicationParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), supportTicketName, communicationName, - this.client.getApiVersion(), createCommunicationParameters, accept, context); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommunicationDetailsInner> beginCreateAsync( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { - Mono>> mono - = createWithResponseAsync(supportTicketName, communicationName, createCommunicationParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, - this.client.getContext()); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommunicationDetailsInner> beginCreateAsync( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(supportTicketName, communicationName, createCommunicationParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, context); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommunicationDetailsInner> beginCreate( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { - return this.beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters) - .getSyncPoller(); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommunicationDetailsInner> beginCreate( - String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, - Context context) { - return this.beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters, context) - .getSyncPoller(); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters) { - return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context) { - return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters) { - return createAsync(supportTicketName, communicationName, createCommunicationParameters).block(); - } - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CommunicationDetailsInner create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context) { - return createAsync(supportTicketName, communicationName, createCommunicationParameters, context).block(); - } - /** * Get the next page of items. * @@ -801,23 +705,15 @@ public CommunicationDetailsInner create(String supportTicketName, String communi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -828,22 +724,14 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsImpl.java index e4fffaf1a693..fcb4a48e0f56 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -30,51 +30,12 @@ public CommunicationsNoSubscriptionsImpl(CommunicationsNoSubscriptionsClient inn this.serviceManager = serviceManager; } - public Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - Response inner = this.serviceClient() - .checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput) { - CheckNameAvailabilityOutputInner inner - = this.serviceClient().checkNameAvailability(supportTicketName, checkNameAvailabilityInput); - if (inner != null) { - return new CheckNameAvailabilityOutputImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String supportTicketName) { - PagedIterable inner = this.serviceClient().list(supportTicketName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommunicationDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(String supportTicketName, Integer top, String filter, - Context context) { - PagedIterable inner - = this.serviceClient().list(supportTicketName, top, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new CommunicationDetailsImpl(inner1, this.manager())); - } - public Response getWithResponse(String supportTicketName, String communicationName, Context context) { Response inner = this.serviceClient().getWithResponse(supportTicketName, communicationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CommunicationDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CommunicationDetailsImpl(inner.getValue(), this.manager())); } public CommunicationDetails get(String supportTicketName, String communicationName) { @@ -108,6 +69,37 @@ public CommunicationDetails create(String supportTicketName, String communicatio } } + public PagedIterable list(String supportTicketName) { + PagedIterable inner = this.serviceClient().list(supportTicketName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CommunicationDetailsImpl(inner1, this.manager())); + } + + public PagedIterable list(String supportTicketName, Integer top, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().list(supportTicketName, top, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new CommunicationDetailsImpl(inner1, this.manager())); + } + + public Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner = this.serviceClient() + .checkNameAvailabilityWithResponse(supportTicketName, checkNameAvailabilityInput, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } + + public CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner + = this.serviceClient().checkNameAvailability(supportTicketName, checkNameAvailabilityInput); + if (inner != null) { + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + } else { + return null; + } + } + private CommunicationsNoSubscriptionsClient serviceClient() { return this.innerClient; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileDetailsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileDetailsImpl.java index be37fc83bd6a..d91c63a1617a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileDetailsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileDetailsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspaceDetailsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspaceDetailsImpl.java index 358a8050d079..8cc16d3bbcdb 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspaceDetailsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspaceDetailsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesClientImpl.java index f2d5f06abae4..57e231d65728 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -38,49 +38,67 @@ public final class FileWorkspacesClientImpl implements FileWorkspacesClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of FileWorkspacesClientImpl. * * @param client the instance of the service client containing this operation class. */ - FileWorkspacesClientImpl(MicrosoftSupportImpl client) { + FileWorkspacesClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(FileWorkspacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportFileWorkspaces to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for SupportManagementClientFileWorkspaces to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportFile") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientFileWorkspaces") public interface FileWorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, + Context context); } /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -89,60 +107,17 @@ Mono> create(@HostParam("$host") String endp */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String fileWorkspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), fileWorkspaceName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific file workspace in an Azure subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String fileWorkspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), fileWorkspaceName, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); - } - - /** - * Gets details for a specific file workspace in an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -156,7 +131,7 @@ private Mono getAsync(String fileWorkspaceName) { /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -165,13 +140,15 @@ private Mono getAsync(String fileWorkspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String fileWorkspaceName, Context context) { - return getWithResponseAsync(fileWorkspaceName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + fileWorkspaceName, accept, context); } /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -185,7 +162,7 @@ public FileWorkspaceDetailsInner get(String fileWorkspaceName) { /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -194,61 +171,17 @@ public FileWorkspaceDetailsInner get(String fileWorkspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync(String fileWorkspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), fileWorkspaceName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents FileWorkspaceDetails resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String fileWorkspaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), fileWorkspaceName, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); - } - - /** - * Creates a new file workspace for the specified subscription. - * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -262,7 +195,7 @@ private Mono createAsync(String fileWorkspaceName) { /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -271,13 +204,15 @@ private Mono createAsync(String fileWorkspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(String fileWorkspaceName, Context context) { - return createWithResponseAsync(fileWorkspaceName, context).block(); + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, accept, context); } /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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/FileWorkspacesImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesImpl.java index 79bcb74c9bb3..113c8385affb 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -28,12 +28,8 @@ public FileWorkspacesImpl(FileWorkspacesClient innerClient, public Response getWithResponse(String fileWorkspaceName, Context context) { Response inner = this.serviceClient().getWithResponse(fileWorkspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); } public FileWorkspaceDetails get(String fileWorkspaceName) { @@ -47,12 +43,8 @@ public FileWorkspaceDetails get(String fileWorkspaceName) { public Response createWithResponse(String fileWorkspaceName, Context context) { Response inner = this.serviceClient().createWithResponse(fileWorkspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); } public FileWorkspaceDetails create(String fileWorkspaceName) { diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsClientImpl.java index e9d758c8aa7c..678478656f72 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -38,47 +38,63 @@ public final class FileWorkspacesNoSubscriptionsClientImpl implements FileWorksp /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of FileWorkspacesNoSubscriptionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - FileWorkspacesNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { + FileWorkspacesNoSubscriptionsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(FileWorkspacesNoSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportFileWorkspacesNoSubscriptions to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for SupportManagementClientFileWorkspacesNoSubscriptions to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportFile") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientFileWorkspacesNoSubscriptions") public interface FileWorkspacesNoSubscriptionsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, @QueryParam("api-version") String apiVersion, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, Context context); } /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -87,51 +103,17 @@ Mono> create(@HostParam("$host") String endp */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String fileWorkspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), fileWorkspaceName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific file workspace along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String fileWorkspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), fileWorkspaceName, this.client.getApiVersion(), accept, context); - } - - /** - * Gets details for a specific file workspace. - * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -145,7 +127,7 @@ private Mono getAsync(String fileWorkspaceName) { /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -154,13 +136,15 @@ private Mono getAsync(String fileWorkspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String fileWorkspaceName, Context context) { - return getWithResponseAsync(fileWorkspaceName, context).block(); + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), fileWorkspaceName, accept, + context); } /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -174,7 +158,7 @@ public FileWorkspaceDetailsInner get(String fileWorkspaceName) { /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -183,53 +167,17 @@ public FileWorkspaceDetailsInner get(String fileWorkspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync(String fileWorkspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), fileWorkspaceName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents FileWorkspaceDetails resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String fileWorkspaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), fileWorkspaceName, this.client.getApiVersion(), accept, - context); - } - - /** - * Creates a new file workspace. - * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -243,7 +191,7 @@ private Mono createAsync(String fileWorkspaceName) { /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -252,13 +200,15 @@ private Mono createAsync(String fileWorkspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse(String fileWorkspaceName, Context context) { - return createWithResponseAsync(fileWorkspaceName, context).block(); + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), fileWorkspaceName, accept, + context); } /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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/FileWorkspacesNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsImpl.java index ac184643e6e4..b0a75b960cee 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -28,12 +28,8 @@ public FileWorkspacesNoSubscriptionsImpl(FileWorkspacesNoSubscriptionsClient inn public Response getWithResponse(String fileWorkspaceName, Context context) { Response inner = this.serviceClient().getWithResponse(fileWorkspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); } public FileWorkspaceDetails get(String fileWorkspaceName) { @@ -47,12 +43,8 @@ public FileWorkspaceDetails get(String fileWorkspaceName) { public Response createWithResponse(String fileWorkspaceName, Context context) { Response inner = this.serviceClient().createWithResponse(fileWorkspaceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileWorkspaceDetailsImpl(inner.getValue(), this.manager())); } public FileWorkspaceDetails create(String fileWorkspaceName) { diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesClientImpl.java index 22a510dbccd4..ba9cd02bc10a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.FilesClient; import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; -import com.azure.resourcemanager.support.models.FilesListResult; +import com.azure.resourcemanager.support.implementation.models.FilesListResult; import com.azure.resourcemanager.support.models.UploadFile; import reactor.core.publisher.Mono; @@ -46,61 +46,97 @@ public final class FilesClientImpl implements FilesClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of FilesClientImpl. * * @param client the instance of the service client containing this operation class. */ - FilesClientImpl(MicrosoftSupportImpl client) { + FilesClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(FilesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportFiles to be used by the proxy service to perform REST - * calls. + * The interface defining all the services for SupportManagementClientFiles to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportFile") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientFiles") public interface FilesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FileDetailsInner createFileParameters, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileDetailsInner createFileParameters, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FileDetailsInner createFileParameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}/upload") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> upload(@HostParam("$host") String endpoint, + Mono> upload(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UploadFile uploadFile, @HeaderParam("Accept") String accept, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") UploadFile uploadFile, + Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}/upload") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response uploadSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") UploadFile uploadFile, Context context); @Headers({ "Content-Type: application/json" }) @@ -108,177 +144,90 @@ Mono> upload(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return object that represents File Details resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String fileWorkspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String fileWorkspaceName, String fileName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), fileWorkspaceName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, fileName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return object that represents File Details resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String fileWorkspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), fileWorkspaceName, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String fileWorkspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(fileWorkspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String fileWorkspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(fileWorkspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String fileWorkspaceName) { - return new PagedIterable<>(listAsync(fileWorkspaceName)); + private Mono getAsync(String fileWorkspaceName, String fileName) { + return getWithResponseAsync(fileWorkspaceName, fileName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. + * @return object that represents File Details resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String fileWorkspaceName, Context context) { - return new PagedIterable<>(listAsync(fileWorkspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String fileWorkspaceName, String fileName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + fileWorkspaceName, fileName, accept, context); } /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return object that represents File Details resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String fileWorkspaceName, String fileName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), fileWorkspaceName, fileName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public FileDetailsInner get(String fileWorkspaceName, String fileName) { + return getWithResponse(fileWorkspaceName, fileName, Context.NONE).getValue(); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace for the specified subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -286,49 +235,41 @@ private Mono> getWithResponseAsync(String fileWorkspa * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String fileWorkspaceName, String fileName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Mono> createWithResponseAsync(String fileWorkspaceName, String fileName, + FileDetailsInner createFileParameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), fileWorkspaceName, fileName, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, fileName, contentType, accept, createFileParameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace for the specified subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that represents File Details resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String fileWorkspaceName, String fileName) { - return getWithResponseAsync(fileWorkspaceName, fileName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createAsync(String fileWorkspaceName, String fileName, + FileDetailsInner createFileParameters) { + return createWithResponseAsync(fileWorkspaceName, fileName, createFileParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace for the specified subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -336,211 +277,140 @@ private Mono getAsync(String fileWorkspaceName, String fileNam * @return object that represents File Details resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String fileWorkspaceName, String fileName, Context context) { - return getWithResponseAsync(fileWorkspaceName, fileName, context).block(); + public Response createWithResponse(String fileWorkspaceName, String fileName, + FileDetailsInner createFileParameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, fileName, contentType, accept, createFileParameters, + context); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace for the specified subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that represents File Details resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FileDetailsInner get(String fileWorkspaceName, String fileName) { - return getWithResponse(fileWorkspaceName, fileName, Context.NONE).getValue(); + public FileDetailsInner create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters) { + return createWithResponse(fileWorkspaceName, fileName, createFileParameters, Context.NONE).getValue(); } /** - * Creates a new file under a workspace for the specified subscription. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response} on successful completion of + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (createFileParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createFileParameters is required and cannot be null.")); - } else { - createFileParameters.validate(); - } + private Mono> listSinglePageAsync(String fileWorkspaceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), fileWorkspaceName, fileName, - this.client.getSubscriptionId(), this.client.getApiVersion(), createFileParameters, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new file under a workspace for the specified subscription. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (createFileParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createFileParameters is required and cannot be null.")); - } else { - createFileParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), fileWorkspaceName, fileName, this.client.getSubscriptionId(), - this.client.getApiVersion(), createFileParameters, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String fileWorkspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(fileWorkspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Creates a new file under a workspace for the specified subscription. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource on successful completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters) { - return createWithResponseAsync(fileWorkspaceName, fileName, createFileParameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String fileWorkspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new file under a workspace for the specified subscription. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters, Context context) { - return createWithResponseAsync(fileWorkspaceName, fileName, createFileParameters, context).block(); + private PagedResponse listSinglePage(String fileWorkspaceName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new file under a workspace for the specified subscription. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileDetailsInner create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters) { - return createWithResponse(fileWorkspaceName, fileName, createFileParameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String fileWorkspaceName) { + return new PagedIterable<>(() -> listSinglePage(fileWorkspaceName), nextLink -> listNextSinglePage(nextLink)); } /** - * This API allows you to upload content to a file. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. - * @param uploadFile UploadFile object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> uploadWithResponseAsync(String fileWorkspaceName, String fileName, - UploadFile uploadFile) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (uploadFile == null) { - return Mono.error(new IllegalArgumentException("Parameter uploadFile is required and cannot be null.")); - } else { - uploadFile.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.upload(this.client.getEndpoint(), fileWorkspaceName, fileName, - this.client.getSubscriptionId(), this.client.getApiVersion(), uploadFile, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String fileWorkspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(fileWorkspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -548,38 +418,19 @@ private Mono> uploadWithResponseAsync(String fileWorkspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> uploadWithResponseAsync(String fileWorkspaceName, String fileName, - UploadFile uploadFile, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (uploadFile == null) { - return Mono.error(new IllegalArgumentException("Parameter uploadFile is required and cannot be null.")); - } else { - uploadFile.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.upload(this.client.getEndpoint(), fileWorkspaceName, fileName, this.client.getSubscriptionId(), - this.client.getApiVersion(), uploadFile, accept, context); + UploadFile uploadFile) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.upload(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, fileName, contentType, uploadFile, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -594,8 +445,8 @@ private Mono uploadAsync(String fileWorkspaceName, String fileName, Upload /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -606,14 +457,16 @@ private Mono uploadAsync(String fileWorkspaceName, String fileName, Upload @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithResponse(String fileWorkspaceName, String fileName, UploadFile uploadFile, Context context) { - return uploadWithResponseAsync(fileWorkspaceName, fileName, uploadFile, context).block(); + final String contentType = "application/json"; + return service.uploadSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), fileWorkspaceName, fileName, contentType, uploadFile, context); } /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -631,18 +484,11 @@ public void upload(String fileWorkspaceName, String fileName, UploadFile uploadF * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -650,6 +496,23 @@ private Mono> listNextSinglePageAsync(String nex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -658,22 +521,13 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesImpl.java index cc495e2b0bff..17ff6fd921f1 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,24 +27,10 @@ public FilesImpl(FilesClient innerClient, com.azure.resourcemanager.support.Supp this.serviceManager = serviceManager; } - public PagedIterable list(String fileWorkspaceName) { - PagedIterable inner = this.serviceClient().list(fileWorkspaceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(String fileWorkspaceName, Context context) { - PagedIterable inner = this.serviceClient().list(fileWorkspaceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); - } - public Response getWithResponse(String fileWorkspaceName, String fileName, Context context) { Response inner = this.serviceClient().getWithResponse(fileWorkspaceName, fileName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileDetailsImpl(inner.getValue(), this.manager())); } public FileDetails get(String fileWorkspaceName, String fileName) { @@ -56,6 +42,16 @@ public FileDetails get(String fileWorkspaceName, String fileName) { } } + public PagedIterable list(String fileWorkspaceName) { + PagedIterable inner = this.serviceClient().list(fileWorkspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); + } + + public PagedIterable list(String fileWorkspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(fileWorkspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); + } + public Response uploadWithResponse(String fileWorkspaceName, String fileName, UploadFile uploadFile, Context context) { return this.serviceClient().uploadWithResponse(fileWorkspaceName, fileName, uploadFile, context); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsClientImpl.java index d4c14ed61192..3cc646fc91e8 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -30,7 +30,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; -import com.azure.resourcemanager.support.models.FilesListResult; +import com.azure.resourcemanager.support.implementation.models.FilesListResult; import com.azure.resourcemanager.support.models.UploadFile; import reactor.core.publisher.Mono; @@ -46,223 +46,183 @@ public final class FilesNoSubscriptionsClientImpl implements FilesNoSubscription /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of FilesNoSubscriptionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - FilesNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { + FilesNoSubscriptionsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(FilesNoSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportFilesNoSubscriptions to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for SupportManagementClientFilesNoSubscriptions to be used by the proxy + * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportFile") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientFilesNoSubscriptions") public interface FilesNoSubscriptionsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files") + @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @PathParam("fileName") String fileName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @PathParam("fileName") String fileName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FileDetailsInner createFileParameters, @HeaderParam("Accept") String accept, + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @PathParam("fileName") String fileName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileDetailsInner createFileParameters, + Context context); + + @Put("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @PathParam("fileName") String fileName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FileDetailsInner createFileParameters, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}/upload") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> upload(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, + @PathParam("fileName") String fileName, @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") UploadFile uploadFile, Context context); + + @Headers({ "Accept: application/json;q=0.9" }) @Post("/providers/Microsoft.Support/fileWorkspaces/{fileWorkspaceName}/files/{fileName}/upload") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> upload(@HostParam("$host") String endpoint, + Response uploadSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("fileWorkspaceName") String fileWorkspaceName, @PathParam("fileName") String fileName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") UploadFile uploadFile, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") UploadFile uploadFile, + Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return object that represents File Details resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String fileWorkspaceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String fileWorkspaceName, String fileName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), fileWorkspaceName, - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, fileName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return object that represents File Details resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String fileWorkspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), fileWorkspaceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String fileWorkspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(fileWorkspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String fileWorkspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(fileWorkspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String fileWorkspaceName) { - return new PagedIterable<>(listAsync(fileWorkspaceName)); + private Mono getAsync(String fileWorkspaceName, String fileName) { + return getWithResponseAsync(fileWorkspaceName, fileName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. + * @return object that represents File Details resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String fileWorkspaceName, Context context) { - return new PagedIterable<>(listAsync(fileWorkspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String fileWorkspaceName, String fileName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), fileWorkspaceName, fileName, + accept, context); } /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return object that represents File Details resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String fileWorkspaceName, String fileName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), fileWorkspaceName, fileName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public FileDetailsInner get(String fileWorkspaceName, String fileName) { + return getWithResponse(fileWorkspaceName, fileName, Context.NONE).getValue(); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -270,45 +230,40 @@ private Mono> getWithResponseAsync(String fileWorkspa * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String fileWorkspaceName, String fileName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } + private Mono> createWithResponseAsync(String fileWorkspaceName, String fileName, + FileDetailsInner createFileParameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), fileWorkspaceName, fileName, this.client.getApiVersion(), accept, - context); + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, fileName, contentType, accept, createFileParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that represents File Details resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String fileWorkspaceName, String fileName) { - return getWithResponseAsync(fileWorkspaceName, fileName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createAsync(String fileWorkspaceName, String fileName, + FileDetailsInner createFileParameters) { + return createWithResponseAsync(fileWorkspaceName, fileName, createFileParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -316,199 +271,139 @@ private Mono getAsync(String fileWorkspaceName, String fileNam * @return object that represents File Details resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String fileWorkspaceName, String fileName, Context context) { - return getWithResponseAsync(fileWorkspaceName, fileName, context).block(); + public Response createWithResponse(String fileWorkspaceName, String fileName, + FileDetailsInner createFileParameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), fileWorkspaceName, fileName, + contentType, accept, createFileParameters, context); } /** - * Returns details of a specific file in a work space. + * Creates a new file under a workspace. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that represents File Details resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public FileDetailsInner get(String fileWorkspaceName, String fileName) { - return getWithResponse(fileWorkspaceName, fileName, Context.NONE).getValue(); + public FileDetailsInner create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters) { + return createWithResponse(fileWorkspaceName, fileName, createFileParameters, Context.NONE).getValue(); } /** - * Creates a new file under a workspace. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response} on successful completion of + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (createFileParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createFileParameters is required and cannot be null.")); - } else { - createFileParameters.validate(); - } + private Mono> listSinglePageAsync(String fileWorkspaceName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), fileWorkspaceName, fileName, - this.client.getApiVersion(), createFileParameters, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new file under a workspace. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (createFileParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter createFileParameters is required and cannot be null.")); - } else { - createFileParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), fileWorkspaceName, fileName, this.client.getApiVersion(), - createFileParameters, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String fileWorkspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(fileWorkspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Creates a new file under a workspace. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource on successful completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters) { - return createWithResponseAsync(fileWorkspaceName, fileName, createFileParameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listSinglePage(String fileWorkspaceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new file under a workspace. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse(String fileWorkspaceName, String fileName, - FileDetailsInner createFileParameters, Context context) { - return createWithResponseAsync(fileWorkspaceName, fileName, createFileParameters, context).block(); + private PagedResponse listSinglePage(String fileWorkspaceName, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new file under a workspace. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. - * @param createFileParameters Create file object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public FileDetailsInner create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters) { - return createWithResponse(fileWorkspaceName, fileName, createFileParameters, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String fileWorkspaceName) { + return new PagedIterable<>(() -> listSinglePage(fileWorkspaceName), nextLink -> listNextSinglePage(nextLink)); } /** - * This API allows you to upload content to a file. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. - * @param uploadFile UploadFile object. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> uploadWithResponseAsync(String fileWorkspaceName, String fileName, - UploadFile uploadFile) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (uploadFile == null) { - return Mono.error(new IllegalArgumentException("Parameter uploadFile is required and cannot be null.")); - } else { - uploadFile.validate(); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.upload(this.client.getEndpoint(), fileWorkspaceName, fileName, - this.client.getApiVersion(), uploadFile, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String fileWorkspaceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(fileWorkspaceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -516,34 +411,19 @@ private Mono> uploadWithResponseAsync(String fileWorkspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> uploadWithResponseAsync(String fileWorkspaceName, String fileName, - UploadFile uploadFile, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (fileWorkspaceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter fileWorkspaceName is required and cannot be null.")); - } - if (fileName == null) { - return Mono.error(new IllegalArgumentException("Parameter fileName is required and cannot be null.")); - } - if (uploadFile == null) { - return Mono.error(new IllegalArgumentException("Parameter uploadFile is required and cannot be null.")); - } else { - uploadFile.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.upload(this.client.getEndpoint(), fileWorkspaceName, fileName, this.client.getApiVersion(), - uploadFile, accept, context); + UploadFile uploadFile) { + final String contentType = "application/json"; + return FluxUtil + .withContext(context -> service.upload(this.client.getEndpoint(), this.client.getApiVersion(), + fileWorkspaceName, fileName, contentType, uploadFile, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -558,8 +438,8 @@ private Mono uploadAsync(String fileWorkspaceName, String fileName, Upload /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -570,14 +450,16 @@ private Mono uploadAsync(String fileWorkspaceName, String fileName, Upload @ServiceMethod(returns = ReturnType.SINGLE) public Response uploadWithResponse(String fileWorkspaceName, String fileName, UploadFile uploadFile, Context context) { - return uploadWithResponseAsync(fileWorkspaceName, fileName, uploadFile, context).block(); + final String contentType = "application/json"; + return service.uploadSync(this.client.getEndpoint(), this.client.getApiVersion(), fileWorkspaceName, fileName, + contentType, uploadFile, context); } /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -595,18 +477,11 @@ public void upload(String fileWorkspaceName, String fileName, UploadFile uploadF * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -614,6 +489,23 @@ private Mono> listNextSinglePageAsync(String nex .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -622,22 +514,13 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsImpl.java index fcfb6bf19c24..700ed1a2a8c5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -28,24 +28,10 @@ public FilesNoSubscriptionsImpl(FilesNoSubscriptionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String fileWorkspaceName) { - PagedIterable inner = this.serviceClient().list(fileWorkspaceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(String fileWorkspaceName, Context context) { - PagedIterable inner = this.serviceClient().list(fileWorkspaceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); - } - public Response getWithResponse(String fileWorkspaceName, String fileName, Context context) { Response inner = this.serviceClient().getWithResponse(fileWorkspaceName, fileName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileDetailsImpl(inner.getValue(), this.manager())); } public FileDetails get(String fileWorkspaceName, String fileName) { @@ -61,12 +47,8 @@ public Response createWithResponse(String fileWorkspaceName, String FileDetailsInner createFileParameters, Context context) { Response inner = this.serviceClient().createWithResponse(fileWorkspaceName, fileName, createFileParameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new FileDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new FileDetailsImpl(inner.getValue(), this.manager())); } public FileDetails create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters) { @@ -78,6 +60,16 @@ public FileDetails create(String fileWorkspaceName, String fileName, FileDetails } } + public PagedIterable list(String fileWorkspaceName) { + PagedIterable inner = this.serviceClient().list(fileWorkspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); + } + + public PagedIterable list(String fileWorkspaceName, Context context) { + PagedIterable inner = this.serviceClient().list(fileWorkspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new FileDetailsImpl(inner1, this.manager())); + } + public Response uploadWithResponse(String fileWorkspaceName, String fileName, UploadFile uploadFile, Context context) { return this.serviceClient().uploadWithResponse(fileWorkspaceName, fileName, uploadFile, context); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdResponseImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdResponseImpl.java new file mode 100644 index 000000000000..c29a999b8031 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdResponseImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.implementation; + +import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; +import com.azure.resourcemanager.support.models.LookUpResourceIdResponse; + +public final class LookUpResourceIdResponseImpl implements LookUpResourceIdResponse { + private LookUpResourceIdResponseInner innerObject; + + private final com.azure.resourcemanager.support.SupportManager serviceManager; + + LookUpResourceIdResponseImpl(LookUpResourceIdResponseInner innerObject, + com.azure.resourcemanager.support.SupportManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String resourceId() { + return this.innerModel().resourceId(); + } + + public LookUpResourceIdResponseInner 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/OperationImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationImpl.java index d301bc16f676..9e87e9806fce 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationImpl.java @@ -1,12 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; import com.azure.resourcemanager.support.fluent.models.OperationInner; +import com.azure.resourcemanager.support.models.ActionType; import com.azure.resourcemanager.support.models.Operation; import com.azure.resourcemanager.support.models.OperationDisplay; +import com.azure.resourcemanager.support.models.Origin; public final class OperationImpl implements Operation { private OperationInner innerObject; @@ -22,10 +24,22 @@ public String name() { return this.innerModel().name(); } + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + public OperationDisplay display() { return this.innerModel().display(); } + public Origin origin() { + return this.innerModel().origin(); + } + + public ActionType actionType() { + return this.innerModel().actionType(); + } + public OperationInner innerModel() { return this.innerObject; } 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 1497df6ae3e8..af995df5928d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -10,6 +10,7 @@ import com.azure.core.annotation.Headers; import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -26,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.OperationsClient; import com.azure.resourcemanager.support.fluent.models.OperationInner; -import com.azure.resourcemanager.support.models.OperationsListResult; +import com.azure.resourcemanager.support.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -41,133 +42,201 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(MicrosoftSupportImpl client) { + OperationsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * 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 SupportManagementClientOperations to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportOper") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsImpl.java index ef4c13026f84..452a14a36d3d 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; 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 41c1ce02aa57..7edee39736cd 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; import com.azure.resourcemanager.support.models.ProblemClassification; import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; @@ -33,6 +34,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } 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 new file mode 100644 index 000000000000..1a2903e0a249 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClassificationOutputImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 370451d51899..3a37bdff29c5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,7 +27,7 @@ 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.models.ProblemClassificationsListResult; +import com.azure.resourcemanager.support.implementation.models.ProblemClassificationsListResult; import reactor.core.publisher.Mono; /** @@ -42,101 +42,146 @@ public final class ProblemClassificationsClientImpl implements ProblemClassifica /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of ProblemClassificationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - ProblemClassificationsClientImpl(MicrosoftSupportImpl client) { + ProblemClassificationsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(ProblemClassificationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportProblemClassifications to be used by the proxy + * The interface defining all the services for SupportManagementClientProblemClassifications to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportProb") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientProblemClassifications") public interface ProblemClassificationsService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/services/{serviceName}/problemClassifications") + @Get("/providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("serviceName") String serviceName, @QueryParam("api-version") String apiVersion, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, + @PathParam("problemClassificationName") String problemClassificationName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("serviceName") String serviceName, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, @PathParam("problemClassificationName") String problemClassificationName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/services/{serviceName}/problemClassifications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/services/{serviceName}/problemClassifications") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * 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 - * set of service and problem classification Ids. + * 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. + * @param problemClassificationName Name of problem classification. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return problem classification details for a specific Azure service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String serviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } + private Mono> getWithResponseAsync(String serviceName, + String problemClassificationName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), serviceName, this.client.getApiVersion(), - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), serviceName, + problemClassificationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * 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 - * set of service and problem classification Ids. + * Get problem classification details for a specific Azure service. + * + * @param serviceName Name of the Azure service. + * @param problemClassificationName Name of problem classification. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return problem classification details for a specific Azure service on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceName, String problemClassificationName) { + return getWithResponseAsync(serviceName, problemClassificationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * 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. + * @param problemClassificationName Name of problem classification. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return problem classification details for a specific Azure service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String serviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } + public Response getWithResponse(String serviceName, String problemClassificationName, + Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), serviceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), serviceName, + problemClassificationName, accept, context); + } + + /** + * Get problem classification details for a specific Azure service. + * + * @param serviceName Name of the Azure service. + * @param problemClassificationName Name of problem classification. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return problem classification details for a specific Azure service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ProblemClassificationInner get(String serviceName, String problemClassificationName) { + return getWithResponse(serviceName, problemClassificationName, Context.NONE).getValue(); } /** @@ -144,15 +189,22 @@ private Mono> listSinglePageAsync(Stri * and problem classifications obtained programmatically. This practice ensures that you always have the most recent * set of service and problem classification Ids. * - * @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. - * @return collection of ProblemClassification resources as paginated response with {@link PagedFlux}. + * @return collection of ProblemClassification resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String serviceName) { - return new PagedFlux<>(() -> listSinglePageAsync(serviceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String serviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), serviceName, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -160,16 +212,15 @@ private PagedFlux listAsync(String serviceName) { * and problem classifications obtained programmatically. This practice ensures that you always have the most recent * set of service and problem classification Ids. * - * @param serviceName Name of the Azure service for which the problem classifications need to be retrieved. - * @param context The context to associate with this operation. + * @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. * @return collection of ProblemClassification resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String serviceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(serviceName, context)); + private PagedFlux listAsync(String serviceName) { + return new PagedFlux<>(() -> listSinglePageAsync(serviceName), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -177,15 +228,19 @@ private PagedFlux listAsync(String serviceName, Cont * and problem classifications obtained programmatically. This practice ensures that you always have the most recent * set of service and problem classification Ids. * - * @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. - * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. + * @return collection of ProblemClassification resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String serviceName) { - return new PagedIterable<>(listAsync(serviceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceName) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), serviceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -193,127 +248,109 @@ public PagedIterable list(String serviceName) { * and problem classifications obtained programmatically. This practice ensures that you always have the most recent * set of service and problem classification Ids. * - * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. + * @return collection of ProblemClassification resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String serviceName, Context context) { - return new PagedIterable<>(listAsync(serviceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String serviceName, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), serviceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get problem classification details for a specific Azure service. + * 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 + * set of service and problem classification Ids. * - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. + * @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. - * @return problem classification details for a specific Azure service along with {@link Response} on successful - * completion of {@link Mono}. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String serviceName, - String problemClassificationName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (problemClassificationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter problemClassificationName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), serviceName, problemClassificationName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceName) { + return new PagedIterable<>(() -> listSinglePage(serviceName), nextLink -> listNextSinglePage(nextLink)); } /** - * Get problem classification details for a specific Azure service. + * 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 + * set of service and problem classification Ids. * - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return problem classification details for a specific Azure service along with {@link Response} on successful - * completion of {@link Mono}. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String serviceName, - String problemClassificationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (problemClassificationName == null) { - return Mono.error( - new IllegalArgumentException("Parameter problemClassificationName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), serviceName, problemClassificationName, - this.client.getApiVersion(), accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String serviceName, Context context) { + return new PagedIterable<>(() -> listSinglePage(serviceName, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Get problem classification details for a specific Azure service. + * Get the next page of items. * - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return problem classification details for a specific Azure service on successful completion of {@link Mono}. + * @return collection of ProblemClassification resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String serviceName, String problemClassificationName) { - return getWithResponseAsync(serviceName, problemClassificationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> listNextSinglePageAsync(String nextLink) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get problem classification details for a specific Azure service. + * Get the next page of items. * - * @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. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return problem classification details for a specific Azure service along with {@link Response}. + * @return collection of ProblemClassification resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String serviceName, String problemClassificationName, - Context context) { - return getWithResponseAsync(serviceName, problemClassificationName, context).block(); + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get problem classification details for a specific Azure service. + * Get the next page of items. * - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return problem classification details for a specific Azure service. + * @return collection of ProblemClassification resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ProblemClassificationInner get(String serviceName, String problemClassificationName) { - return getWithResponse(serviceName, problemClassificationName, Context.NONE).getValue(); + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } 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 8b7e3dc2cc57..99b52d391e10 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,26 +27,12 @@ public ProblemClassificationsImpl(ProblemClassificationsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String serviceName) { - PagedIterable inner = this.serviceClient().list(serviceName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProblemClassificationImpl(inner1, this.manager())); - } - - public PagedIterable list(String serviceName, Context context) { - PagedIterable inner = this.serviceClient().list(serviceName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ProblemClassificationImpl(inner1, this.manager())); - } - public Response getWithResponse(String serviceName, String problemClassificationName, Context context) { Response inner = this.serviceClient().getWithResponse(serviceName, problemClassificationName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ProblemClassificationImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ProblemClassificationImpl(inner.getValue(), this.manager())); } public ProblemClassification get(String serviceName, String problemClassificationName) { @@ -58,6 +44,16 @@ public ProblemClassification get(String serviceName, String problemClassificatio } } + public PagedIterable list(String serviceName) { + PagedIterable inner = this.serviceClient().list(serviceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProblemClassificationImpl(inner1, this.manager())); + } + + public PagedIterable list(String serviceName, Context context) { + PagedIterable inner = this.serviceClient().list(serviceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ProblemClassificationImpl(inner1, this.manager())); + } + private ProblemClassificationsClient serviceClient() { return this.innerClient; } 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 5ea3d4a24adc..66621433b42d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; 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 new file mode 100644 index 000000000000..4e889486a94f --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationOutputImpl.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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/ServiceImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServiceImpl.java index d9c67d45023e..ecfb5ddaefd5 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.support.fluent.models.ServiceInner; import com.azure.resourcemanager.support.models.Service; import java.util.Collections; @@ -31,6 +32,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String displayName() { return this.innerModel().displayName(); } 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 7dfdec31a05c..49abc7e2814f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.support.fluent.ServicesClient; import com.azure.resourcemanager.support.fluent.models.ServiceInner; -import com.azure.resourcemanager.support.models.ServicesListResult; +import com.azure.resourcemanager.support.implementation.models.ServicesListResult; import reactor.core.publisher.Mono; /** @@ -42,39 +42,131 @@ public final class ServicesClientImpl implements ServicesClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of ServicesClientImpl. * * @param client the instance of the service client containing this operation class. */ - ServicesClientImpl(MicrosoftSupportImpl client) { + ServicesClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(ServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportServices to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for SupportManagementClientServices to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportServ") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientServices") public interface ServicesService { @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/services") + @Get("/providers/Microsoft.Support/services/{serviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Support/services/{serviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("serviceName") String serviceName, @QueryParam("api-version") String apiVersion, + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("serviceName") String serviceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/services") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/services") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @return a specific Azure service for support ticket creation along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String serviceName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), serviceName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @return a specific Azure service for support ticket creation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String serviceName) { + return getWithResponseAsync(serviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific Azure service for support ticket creation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String serviceName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), serviceName, accept, context); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @return a specific Azure service for support ticket creation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceInner get(String serviceName) { + return getWithResponse(serviceName, Context.NONE).getValue(); } /** @@ -92,16 +184,12 @@ Mono> get(@HostParam("$host") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -113,24 +201,13 @@ private Mono> listSinglePageAsync() { * ticket creation. This practice ensures that you always have the most recent set of service and problem * classification Ids. * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Service resources along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return collection of Service resources as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -143,11 +220,15 @@ private Mono> listSinglePageAsync(Context context) { * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Service resources as paginated response with {@link PagedFlux}. + * @return collection of Service resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -162,11 +243,15 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Service resources as paginated response with {@link PagedFlux}. + * @return collection of Service resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -183,7 +268,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -202,100 +287,61 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Gets a specific Azure service for support ticket creation. + * Get the next page of items. * - * @param serviceName Name of the Azure service. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Azure service for support ticket creation along with {@link Response} on successful completion - * of {@link Mono}. + * @return collection of Service resources along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String serviceName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } + private Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), serviceName, this.client.getApiVersion(), - accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a specific Azure service for support ticket creation. + * Get the next page of items. * - * @param serviceName Name of the Azure service. - * @param context The context to associate with this operation. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Azure service for support ticket creation along with {@link Response} on successful completion - * of {@link Mono}. + * @return collection of Service resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String serviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), serviceName, this.client.getApiVersion(), accept, context); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Gets a specific Azure service for support ticket creation. - * - * @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. - * @return a specific Azure service for support ticket creation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String serviceName) { - return getWithResponseAsync(serviceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific Azure service for support ticket creation. + * Get the next page of items. * - * @param serviceName Name of the Azure service. + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Azure service for support ticket creation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String serviceName, Context context) { - return getWithResponseAsync(serviceName, context).block(); - } - - /** - * Gets a specific Azure service for support ticket creation. - * - * @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. - * @return a specific Azure service for support ticket creation. + * @return collection of Service resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceInner get(String serviceName) { - return getWithResponse(serviceName, Context.NONE).getValue(); + private PagedResponse listNextSinglePage(String nextLink, Context context) { + final String accept = "application/json"; + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesImpl.java index a40b02a4cfc6..b9a200c28a2b 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/ServicesImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -26,24 +26,10 @@ public ServicesImpl(ServicesClient innerClient, com.azure.resourcemanager.suppor this.serviceManager = serviceManager; } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceImpl(inner1, this.manager())); - } - public Response getWithResponse(String serviceName, Context context) { Response inner = this.serviceClient().getWithResponse(serviceName, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new ServiceImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ServiceImpl(inner.getValue(), this.manager())); } public Service get(String serviceName) { @@ -55,6 +41,16 @@ public Service get(String serviceName) { } } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ServiceImpl(inner1, this.manager())); + } + private ServicesClient serviceClient() { return this.innerClient; } 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/SupportManagementClientBuilder.java similarity index 67% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportBuilder.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportManagementClientBuilder.java index 16d30af2e3af..da77175cacae 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/SupportManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the MicrosoftSupportImpl type. + * A builder for creating a new instance of the SupportManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { MicrosoftSupportImpl.class }) -public final class MicrosoftSupportBuilder { +@ServiceClientBuilder(serviceClients = { SupportManagementClientImpl.class }) +public final class SupportManagementClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the MicrosoftSupportBuilder. + * @param endpoint the endpoint value. + * @return the SupportManagementClientBuilder. */ - public MicrosoftSupportBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public SupportManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the MicrosoftSupportBuilder. + * @param subscriptionId the subscriptionId value. + * @return the SupportManagementClientBuilder. */ - public MicrosoftSupportBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public SupportManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public MicrosoftSupportBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the MicrosoftSupportBuilder. + * @return the SupportManagementClientBuilder. */ - public MicrosoftSupportBuilder environment(AzureEnvironment environment) { + public SupportManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public MicrosoftSupportBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the MicrosoftSupportBuilder. + * @return the SupportManagementClientBuilder. */ - public MicrosoftSupportBuilder pipeline(HttpPipeline pipeline) { + public SupportManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public MicrosoftSupportBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the MicrosoftSupportBuilder. + * @return the SupportManagementClientBuilder. */ - public MicrosoftSupportBuilder defaultPollInterval(Duration defaultPollInterval) { + public SupportManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public MicrosoftSupportBuilder defaultPollInterval(Duration defaultPollInterval) * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the MicrosoftSupportBuilder. + * @return the SupportManagementClientBuilder. */ - public MicrosoftSupportBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public SupportManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of MicrosoftSupportImpl with the provided parameters. + * Builds an instance of SupportManagementClientImpl with the provided parameters. * - * @return an instance of MicrosoftSupportImpl. + * @return an instance of SupportManagementClientImpl. */ - public MicrosoftSupportImpl buildClient() { + public SupportManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public MicrosoftSupportImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - MicrosoftSupportImpl client = new MicrosoftSupportImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + SupportManagementClientImpl client = new SupportManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } 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/SupportManagementClientImpl.java similarity index 78% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportManagementClientImpl.java index 45eea3d12580..33ddbf67bec5 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/SupportManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -15,26 +15,33 @@ 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.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.support.fluent.ChatTranscriptsClient; import com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient; +import com.azure.resourcemanager.support.fluent.ClassifyProblemsClient; +import com.azure.resourcemanager.support.fluent.ClassifyProblemsNoSubscriptionsClient; +import com.azure.resourcemanager.support.fluent.ClassifyServicesClient; +import com.azure.resourcemanager.support.fluent.ClassifyServicesNoSubscriptionsClient; 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.MicrosoftSupport; import com.azure.resourcemanager.support.fluent.OperationsClient; import com.azure.resourcemanager.support.fluent.ProblemClassificationsClient; import com.azure.resourcemanager.support.fluent.ServicesClient; +import com.azure.resourcemanager.support.fluent.SupportManagementClient; import com.azure.resourcemanager.support.fluent.SupportTicketsClient; import com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient; import java.io.IOException; @@ -47,31 +54,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the MicrosoftSupportImpl type. + * Initializes a new instance of the SupportManagementClientImpl type. */ -@ServiceClient(builder = MicrosoftSupportBuilder.class) -public final class MicrosoftSupportImpl implements MicrosoftSupport { +@ServiceClient(builder = SupportManagementClientBuilder.class) +public final class SupportManagementClientImpl implements SupportManagementClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -80,12 +73,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -93,6 +86,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -164,45 +171,73 @@ public ServicesClient getServices() { } /** - * The ProblemClassificationsClient object to access its operations. + * The ClassifyServicesClient object to access its operations. */ - private final ProblemClassificationsClient problemClassifications; + private final ClassifyServicesClient classifyServices; /** - * Gets the ProblemClassificationsClient object to access its operations. + * Gets the ClassifyServicesClient object to access its operations. * - * @return the ProblemClassificationsClient object. + * @return the ClassifyServicesClient object. */ - public ProblemClassificationsClient getProblemClassifications() { - return this.problemClassifications; + public ClassifyServicesClient getClassifyServices() { + return this.classifyServices; } /** - * The SupportTicketsClient object to access its operations. + * The ClassifyServicesNoSubscriptionsClient object to access its operations. */ - private final SupportTicketsClient supportTickets; + private final ClassifyServicesNoSubscriptionsClient classifyServicesNoSubscriptions; /** - * Gets the SupportTicketsClient object to access its operations. + * Gets the ClassifyServicesNoSubscriptionsClient object to access its operations. * - * @return the SupportTicketsClient object. + * @return the ClassifyServicesNoSubscriptionsClient object. */ - public SupportTicketsClient getSupportTickets() { - return this.supportTickets; + public ClassifyServicesNoSubscriptionsClient getClassifyServicesNoSubscriptions() { + return this.classifyServicesNoSubscriptions; } /** - * The SupportTicketsNoSubscriptionsClient object to access its operations. + * The ClassifyProblemsClient object to access its operations. */ - private final SupportTicketsNoSubscriptionsClient supportTicketsNoSubscriptions; + private final ClassifyProblemsClient classifyProblems; /** - * Gets the SupportTicketsNoSubscriptionsClient object to access its operations. + * Gets the ClassifyProblemsClient object to access its operations. * - * @return the SupportTicketsNoSubscriptionsClient object. + * @return the ClassifyProblemsClient object. */ - public SupportTicketsNoSubscriptionsClient getSupportTicketsNoSubscriptions() { - return this.supportTicketsNoSubscriptions; + public ClassifyProblemsClient getClassifyProblems() { + return this.classifyProblems; + } + + /** + * The ClassifyProblemsNoSubscriptionsClient object to access its operations. + */ + private final ClassifyProblemsNoSubscriptionsClient classifyProblemsNoSubscriptions; + + /** + * Gets the ClassifyProblemsNoSubscriptionsClient object to access its operations. + * + * @return the ClassifyProblemsNoSubscriptionsClient object. + */ + public ClassifyProblemsNoSubscriptionsClient getClassifyProblemsNoSubscriptions() { + return this.classifyProblemsNoSubscriptions; + } + + /** + * The ProblemClassificationsClient object to access its operations. + */ + private final ProblemClassificationsClient problemClassifications; + + /** + * Gets the ProblemClassificationsClient object to access its operations. + * + * @return the ProblemClassificationsClient object. + */ + public ProblemClassificationsClient getProblemClassifications() { + return this.problemClassifications; } /** @@ -219,6 +254,20 @@ public CommunicationsClient getCommunications() { return this.communications; } + /** + * The SupportTicketsClient object to access its operations. + */ + private final SupportTicketsClient supportTickets; + + /** + * Gets the SupportTicketsClient object to access its operations. + * + * @return the SupportTicketsClient object. + */ + public SupportTicketsClient getSupportTickets() { + return this.supportTickets; + } + /** * The CommunicationsNoSubscriptionsClient object to access its operations. */ @@ -233,6 +282,20 @@ public CommunicationsNoSubscriptionsClient getCommunicationsNoSubscriptions() { return this.communicationsNoSubscriptions; } + /** + * The SupportTicketsNoSubscriptionsClient object to access its operations. + */ + private final SupportTicketsNoSubscriptionsClient supportTicketsNoSubscriptions; + + /** + * Gets the SupportTicketsNoSubscriptionsClient object to access its operations. + * + * @return the SupportTicketsNoSubscriptionsClient object. + */ + public SupportTicketsNoSubscriptionsClient getSupportTicketsNoSubscriptions() { + return this.supportTicketsNoSubscriptions; + } + /** * The ChatTranscriptsClient object to access its operations. */ @@ -318,30 +381,34 @@ public FilesNoSubscriptionsClient getFilesNoSubscriptions() { } /** - * Initializes an instance of MicrosoftSupport client. + * Initializes an instance of SupportManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ - MicrosoftSupportImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + SupportManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-04-01"; + this.subscriptionId = subscriptionId; + this.apiVersion = "2026-07-01"; this.operations = new OperationsClientImpl(this); this.services = new ServicesClientImpl(this); + this.classifyServices = new ClassifyServicesClientImpl(this); + this.classifyServicesNoSubscriptions = new ClassifyServicesNoSubscriptionsClientImpl(this); + this.classifyProblems = new ClassifyProblemsClientImpl(this); + this.classifyProblemsNoSubscriptions = new ClassifyProblemsNoSubscriptionsClientImpl(this); this.problemClassifications = new ProblemClassificationsClientImpl(this); - this.supportTickets = new SupportTicketsClientImpl(this); - this.supportTicketsNoSubscriptions = new SupportTicketsNoSubscriptionsClientImpl(this); this.communications = new CommunicationsClientImpl(this); + this.supportTickets = new SupportTicketsClientImpl(this); this.communicationsNoSubscriptions = new CommunicationsNoSubscriptionsClientImpl(this); + this.supportTicketsNoSubscriptions = new SupportTicketsNoSubscriptionsClientImpl(this); this.chatTranscripts = new ChatTranscriptsClientImpl(this); this.chatTranscriptsNoSubscriptions = new ChatTranscriptsNoSubscriptionsClientImpl(this); this.fileWorkspaces = new FileWorkspacesClientImpl(this); @@ -387,6 +454,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -444,7 +528,7 @@ private static final class HttpResponseImpl extends HttpResponse { super(null); this.statusCode = statusCode; this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + this.responseBody = responseBody == null ? new byte[0] : responseBody.getBytes(StandardCharsets.UTF_8); } public int getStatusCode() { @@ -476,5 +560,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(MicrosoftSupportImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(SupportManagementClientImpl.class); } 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 b8b40b27d5a7..a605b5f19e31 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 @@ -1,19 +1,23 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; +import com.azure.resourcemanager.support.models.ChatConversationStatus; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; import com.azure.resourcemanager.support.models.IsTemporaryTicket; import com.azure.resourcemanager.support.models.QuotaTicketDetails; import com.azure.resourcemanager.support.models.SecondaryConsent; import com.azure.resourcemanager.support.models.ServiceLevelAgreement; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.Status; +import com.azure.resourcemanager.support.models.SupportChannel; import com.azure.resourcemanager.support.models.SupportEngineer; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.TechnicalTicketDetails; @@ -41,6 +45,10 @@ public String type() { return this.innerModel().type(); } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String supportTicketId() { return this.innerModel().supportTicketId(); } @@ -154,6 +162,22 @@ public List secondaryConsent() { } } + public DirectConnectEscalation directConnectEscalation() { + return this.innerModel().directConnectEscalation(); + } + + public String communityForumPost() { + return this.innerModel().communityForumPost(); + } + + public SupportChannel supportChannel() { + return this.innerModel().supportChannel(); + } + + public ChatConversationStatus chatConversationStatus() { + return this.innerModel().chatConversationStatus(); + } + public SupportTicketDetailsInner innerModel() { return this.innerObject; } @@ -337,6 +361,21 @@ public SupportTicketDetailsImpl withSecondaryConsent(List seco } } + public SupportTicketDetailsImpl withDirectConnectEscalation(DirectConnectEscalation directConnectEscalation) { + if (isInCreateMode()) { + this.innerModel().withDirectConnectEscalation(directConnectEscalation); + return this; + } else { + this.updateUpdateSupportTicket.withDirectConnectEscalation(directConnectEscalation); + return this; + } + } + + public SupportTicketDetailsImpl withCommunityForumPost(String communityForumPost) { + this.innerModel().withCommunityForumPost(communityForumPost); + return this; + } + public SupportTicketDetailsImpl withStatus(Status status) { this.updateUpdateSupportTicket.withStatus(status); return this; @@ -348,6 +387,6 @@ public SupportTicketDetailsImpl withContactDetails(UpdateContactProfile contactD } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsClientImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsClientImpl.java index 79ac1773d212..64498666881d 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsClientImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -28,15 +28,18 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.support.fluent.SupportTicketsClient; import com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; +import com.azure.resourcemanager.support.implementation.models.SupportTicketsListResult; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; -import com.azure.resourcemanager.support.models.SupportTicketsListResult; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; import com.azure.resourcemanager.support.models.UpdateSupportTicket; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -54,502 +57,527 @@ public final class SupportTicketsClientImpl implements SupportTicketsClient { /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of SupportTicketsClientImpl. * * @param client the instance of the service client containing this operation class. */ - SupportTicketsClientImpl(MicrosoftSupportImpl client) { + SupportTicketsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(SupportTicketsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for MicrosoftSupportSupportTickets to be used by the proxy service to - * perform REST calls. + * The interface defining all the services for SupportManagementClientSupportTickets to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportSupp") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientSupportTickets") public interface SupportTicketsService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, - @HeaderParam("Accept") String accept, Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SupportTicketDetailsInner createSupportTicketParameters, Context context); + + @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") SupportTicketDetailsInner createSupportTicketParameters, Context context); + + @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateSupportTicket updateSupportTicket, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateSupportTicket updateSupportTicket, - @HeaderParam("Accept") String accept, Context context); + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateSupportTicket updateSupportTicket, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SupportTicketDetailsInner createSupportTicketParameters, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, + Context context); + + @Post("/providers/Microsoft.Support/lookUpResourceId") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> lookUpResourceId(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LookUpResourceIdRequest lookUpResourceIdRequest, Context context); + + @Post("/providers/Microsoft.Support/lookUpResourceId") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response lookUpResourceIdSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") LookUpResourceIdRequest lookUpResourceIdRequest, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket + * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of + * @return ticket details for an Azure subscription along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } + private Mono> getWithResponseAsync(String supportTicketName) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), checkNameAvailabilityInput, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket + * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of - * {@link Mono}. + * @return ticket details for an Azure subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), checkNameAvailabilityInput, accept, context); + private Mono getAsync(String supportTicketName) { + return getWithResponseAsync(supportTicketName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket + * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API on successful completion of {@link Mono}. + * @return ticket details for an Azure subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Response getWithResponse(String supportTicketName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + supportTicketName, accept, context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket + * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return ticket details for an Azure subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput, context).block(); + public SupportTicketDetailsInner get(String supportTicketName) { + return getWithResponse(supportTicketName, Context.NONE).getValue(); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityOutputInner - checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); + private Mono>> createWithResponseAsync(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, contentType, accept, createSupportTicketParameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and - * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the - * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return object that represents SupportTicketDetails resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Response createWithResponse(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), top, filter, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, contentType, accept, createSupportTicketParameters, + Context.NONE); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and - * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the - * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return object that represents SupportTicketDetails resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private Response createWithResponse(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters, Context context) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), top, filter, this.client.getSubscriptionId(), this.client.getApiVersion(), - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, contentType, accept, createSupportTicketParameters, + context); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and - * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the - * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SupportTicketDetailsInner> + beginCreateAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + Mono>> mono + = createWithResponseAsync(supportTicketName, createSupportTicketParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, + this.client.getContext()); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final Integer top = null; - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and - * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the - * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(top, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer top = null; - final String filter = null; - return new PagedIterable<>(listAsync(top, filter)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SupportTicketDetailsInner> + beginCreate(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + Response response = createWithResponse(supportTicketName, createSupportTicketParameters); + return this.client.getLroResult(response, + SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, Context.NONE); } /** - * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, - * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged - * result with _nextLink_, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn - * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and - * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the - * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine - * them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer top, String filter, Context context) { - return new PagedIterable<>(listAsync(top, filter, context)); - } - - /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. - * - * @param supportTicketName Support ticket name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ticket details for an Azure subscription along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), supportTicketName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SupportTicketDetailsInner> beginCreate( + String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { + Response response = createWithResponse(supportTicketName, createSupportTicketParameters, context); + return this.client.getLroResult(response, + SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, context); } /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ticket details for an Azure subscription along with {@link Response} on successful completion of - * {@link Mono}. + * @return object that represents SupportTicketDetails resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), supportTicketName, this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); + private Mono createAsync(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + return beginCreateAsync(supportTicketName, createSupportTicketParameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ticket details for an Azure subscription on successful completion of {@link Mono}. + * @return object that represents SupportTicketDetails resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String supportTicketName) { - return getWithResponseAsync(supportTicketName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public SupportTicketDetailsInner create(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + return beginCreate(supportTicketName, createSupportTicketParameters).getFinalResult(); } /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription + * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required + * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get + * the most recent set of services and problem categories required for support ticket + * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an + * existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a + * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as + * per + * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). + * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, + * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider + * (CSP) partner tenant. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ticket details for an Azure subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String supportTicketName, Context context) { - return getWithResponseAsync(supportTicketName, context).block(); - } - - /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. - * - * @param supportTicketName Support ticket name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ticket details for an Azure subscription. + * @return object that represents SupportTicketDetails resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SupportTicketDetailsInner get(String supportTicketName) { - return getWithResponse(supportTicketName, Context.NONE).getValue(); + public SupportTicketDetailsInner create(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters, Context context) { + return beginCreate(supportTicketName, createSupportTicketParameters, context).getFinalResult(); } /** @@ -558,7 +586,7 @@ public SupportTicketDetailsInner get(String supportTicketName) { * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer * to request severity update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -569,28 +597,11 @@ public SupportTicketDetailsInner get(String supportTicketName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String supportTicketName, UpdateSupportTicket updateSupportTicket) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (updateSupportTicket == null) { - return Mono - .error(new IllegalArgumentException("Parameter updateSupportTicket is required and cannot be null.")); - } else { - updateSupportTicket.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), supportTicketName, - this.client.getSubscriptionId(), this.client.getApiVersion(), updateSupportTicket, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, contentType, accept, updateSupportTicket, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -600,49 +611,7 @@ private Mono> updateWithResponseAsync(String * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer * to request severity update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String supportTicketName, - UpdateSupportTicket updateSupportTicket, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (updateSupportTicket == null) { - return Mono - .error(new IllegalArgumentException("Parameter updateSupportTicket is required and cannot be null.")); - } else { - updateSupportTicket.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), supportTicketName, this.client.getSubscriptionId(), - this.client.getApiVersion(), updateSupportTicket, accept, context); - } - - /** - * This API allows you to update the severity level, ticket status, advanced diagnostic consent and your contact - * information in the support ticket.<br/><br/>Note: The severity levels cannot be changed if a support - * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer - * to request severity update by adding a new communication using the Communications API. - * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -662,7 +631,7 @@ private Mono updateAsync(String supportTicketName, * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer * to request severity update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -673,7 +642,10 @@ private Mono updateAsync(String supportTicketName, @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String supportTicketName, UpdateSupportTicket updateSupportTicket, Context context) { - return updateWithResponseAsync(supportTicketName, updateSupportTicket, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), supportTicketName, contentType, accept, updateSupportTicket, context); } /** @@ -682,7 +654,7 @@ public Response updateWithResponse(String supportTick * ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer * to request severity update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -695,384 +667,316 @@ public SupportTicketDetailsInner update(String supportTicketName, UpdateSupportT } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn + * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and + * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the + * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine + * them using the logical 'AND'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (createSupportTicketParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createSupportTicketParameters is required and cannot be null.")); - } else { - createSupportTicketParameters.validate(); - } + private Mono> listSinglePageAsync(Integer top, String filter) { final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), supportTicketName, this.client.getSubscriptionId(), - this.client.getApiVersion(), createSupportTicketParameters, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), top, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. - * @param context The context to associate with this operation. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn + * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and + * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the + * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine + * them using the logical 'AND'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn + * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and + * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the + * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine + * them using the logical 'AND'. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (createSupportTicketParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createSupportTicketParameters is required and cannot be null.")); - } else { - createSupportTicketParameters.validate(); - } + private PagedResponse listSinglePage(Integer top, String filter) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), supportTicketName, this.client.getSubscriptionId(), - this.client.getApiVersion(), createSupportTicketParameters, accept, context); + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), top, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn + * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and + * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the + * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine + * them using the logical 'AND'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SupportTicketDetailsInner> - beginCreateAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { - Mono>> mono - = createWithResponseAsync(supportTicketName, createSupportTicketParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer top, String filter, Context context) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), top, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(top, filter), nextLink -> listNextSinglePage(nextLink)); + } + + /** + * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, + * _CreatedDate_, _ServiceId_, and _ProblemClassificationId_ using the $filter parameter. Output will be a paged + * result with _nextLink_, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. [Learn + * more](https://docs.microsoft.com/odata/concepts/queryoptions-overview). _Status_, _ServiceId_, and + * _ProblemClassificationId_ filters can only be used with Equals ('eq') operator. For _CreatedDate_ filter, the + * supported operators are Greater Than ('gt') and Greater Than or Equals ('ge'). When using both filters, combine + * them using the logical 'AND'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SupportTicketDetailsInner> beginCreateAsync( - String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(supportTicketName, createSupportTicketParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(top, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * This operation fetches ARM resource id of support resource type. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @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 {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. + * @return the look up resource id response along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SupportTicketDetailsInner> - beginCreate(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { - return this.beginCreateAsync(supportTicketName, createSupportTicketParameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + lookUpResourceIdWithResponseAsync(LookUpResourceIdRequest lookUpResourceIdRequest) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.lookUpResourceId(this.client.getEndpoint(), this.client.getApiVersion(), + contentType, accept, lookUpResourceIdRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * This operation fetches ARM resource id of support resource type. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @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 lookUpResourceIdAsync(LookUpResourceIdRequest lookUpResourceIdRequest) { + return lookUpResourceIdWithResponseAsync(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 {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. + * @return the look up resource id response along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SupportTicketDetailsInner> beginCreate( - String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { - return this.beginCreateAsync(supportTicketName, createSupportTicketParameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + lookUpResourceIdWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.lookUpResourceIdSync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, accept, + lookUpResourceIdRequest, context); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * This operation fetches ARM resource id of support resource type. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. + * @return the look up resource id response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - return beginCreateAsync(supportTicketName, createSupportTicketParameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public LookUpResourceIdResponseInner lookUpResourceId(LookUpResourceIdRequest lookUpResourceIdRequest) { + return lookUpResourceIdWithResponse(lookUpResourceIdRequest, Context.NONE).getValue(); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. - * @param context The context to associate with this operation. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - return beginCreateAsync(supportTicketName, createSupportTicketParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, checkNameAvailabilityInput, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource. + * @return output of check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SupportTicketDetailsInner create(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - return createAsync(supportTicketName, createSupportTicketParameters).block(); + private Mono + checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates a new support ticket for Subscription and Service limits (Quota), Technical, Billing, and Subscription - * Management issues for the specified subscription. Learn the [prerequisites](https://aka.ms/supportAPI) required - * to create a support ticket.<br/><br/>Always call the Services and ProblemClassifications API to get - * the most recent set of services and problem categories required for support ticket - * creation.<br/><br/>Adding attachments is not currently supported via the API. To add a file to an - * existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>**Creating a - * support ticket for on-behalf-of**: Include _x-ms-authorization-auxiliary_ header to provide an auxiliary token as - * per - * [documentation](https://docs.microsoft.com/azure/azure-resource-manager/management/authenticate-multi-tenant). - * The primary token will be from the tenant for whom a support ticket is being raised against the subscription, - * i.e. Cloud solution provider (CSP) customer tenant. The auxiliary token will be from the Cloud solution provider - * (CSP) partner tenant. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource. + * @return output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SupportTicketDetailsInner create(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - return createAsync(supportTicketName, createSupportTicketParameters, context).block(); + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), contentType, accept, checkNameAvailabilityInput, context); + } + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityOutputInner + checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); } /** @@ -1082,18 +986,11 @@ public SupportTicketDetailsInner create(String supportTicketName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -1101,6 +998,24 @@ private Mono> listNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1109,22 +1024,14 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsImpl.java index de441a99ee47..0d00c65f064a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -11,9 +11,12 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.SupportTicketsClient; import com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner; +import com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; +import com.azure.resourcemanager.support.models.LookUpResourceIdResponse; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.SupportTickets; @@ -30,22 +33,16 @@ public SupportTicketsImpl(SupportTicketsClient innerClient, this.serviceManager = serviceManager; } - public Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - Response inner - = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getWithResponse(String supportTicketName, Context context) { + Response inner = this.serviceClient().getWithResponse(supportTicketName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SupportTicketDetailsImpl(inner.getValue(), this.manager())); } - public CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { - CheckNameAvailabilityOutputInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityInput); + public SupportTicketDetails get(String supportTicketName) { + SupportTicketDetailsInner inner = this.serviceClient().get(supportTicketName); if (inner != null) { - return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + return new SupportTicketDetailsImpl(inner, this.manager()); } else { return null; } @@ -61,20 +58,35 @@ public PagedIterable list(Integer top, String filter, Cont return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportTicketDetailsImpl(inner1, this.manager())); } - public Response getWithResponse(String supportTicketName, Context context) { - Response inner = this.serviceClient().getWithResponse(supportTicketName, context); + public Response + lookUpResourceIdWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, Context context) { + Response inner + = this.serviceClient().lookUpResourceIdWithResponse(lookUpResourceIdRequest, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new LookUpResourceIdResponseImpl(inner.getValue(), this.manager())); + } + + public LookUpResourceIdResponse lookUpResourceId(LookUpResourceIdRequest lookUpResourceIdRequest) { + LookUpResourceIdResponseInner inner = this.serviceClient().lookUpResourceId(lookUpResourceIdRequest); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SupportTicketDetailsImpl(inner.getValue(), this.manager())); + return new LookUpResourceIdResponseImpl(inner, this.manager()); } else { return null; } } - public SupportTicketDetails get(String supportTicketName) { - SupportTicketDetailsInner inner = this.serviceClient().get(supportTicketName); + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityInput, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } + + public CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityInput); if (inner != null) { - return new SupportTicketDetailsImpl(inner, this.manager()); + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); } else { return null; } 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 ff3e78284398..8ada106c61ca 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -28,6 +28,7 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; @@ -35,8 +36,8 @@ import com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient; import com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; +import com.azure.resourcemanager.support.implementation.models.SupportTicketsListResult; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; -import com.azure.resourcemanager.support.models.SupportTicketsListResult; import com.azure.resourcemanager.support.models.UpdateSupportTicket; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -54,482 +55,437 @@ public final class SupportTicketsNoSubscriptionsClientImpl implements SupportTic /** * The service client containing this operation class. */ - private final MicrosoftSupportImpl client; + private final SupportManagementClientImpl client; /** * Initializes an instance of SupportTicketsNoSubscriptionsClientImpl. * * @param client the instance of the service client containing this operation class. */ - SupportTicketsNoSubscriptionsClientImpl(MicrosoftSupportImpl client) { + SupportTicketsNoSubscriptionsClientImpl(SupportManagementClientImpl client) { this.service = RestProxy.create(SupportTicketsNoSubscriptionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * 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 SupportManagementClientSupportTicketsNoSubscriptions to be used by + * the proxy service to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "MicrosoftSupportSupp") + @Host("{endpoint}") + @ServiceInterface(name = "SupportManagementClientSupportTicketsNoSubscriptions") public interface SupportTicketsNoSubscriptionsService { @Headers({ "Content-Type: application/json" }) - @Post("/providers/Microsoft.Support/checkNameAvailability") + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameAvailability(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/supportTickets") + @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("$top") Integer top, @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response getSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/providers/Microsoft.Support/supportTickets/{supportTicketName}") + @Put("/providers/Microsoft.Support/supportTickets/{supportTicketName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SupportTicketDetailsInner createSupportTicketParameters, Context context); + + @Put("/providers/Microsoft.Support/supportTickets/{supportTicketName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SupportTicketDetailsInner createSupportTicketParameters, Context context); + + @Patch("/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateSupportTicket updateSupportTicket, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/providers/Microsoft.Support/supportTickets/{supportTicketName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") UpdateSupportTicket updateSupportTicket, - @HeaderParam("Accept") String accept, Context context); + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("supportTicketName") String supportTicketName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") UpdateSupportTicket updateSupportTicket, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/providers/Microsoft.Support/supportTickets/{supportTicketName}") - @ExpectedResponses({ 200, 202 }) + @Get("/providers/Microsoft.Support/supportTickets") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("supportTicketName") String supportTicketName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SupportTicketDetailsInner createSupportTicketParameters, - @HeaderParam("Accept") String accept, Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Support/supportTickets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Integer top, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Post("/providers/Microsoft.Support/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + @Post("/providers/Microsoft.Support/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response checkNameAvailabilitySync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. + * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of + * @return details for a specific support ticket along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } + private Mono> getWithResponseAsync(String supportTicketName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), - this.client.getApiVersion(), checkNameAvailabilityInput, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. - * - * @param checkNameAvailabilityInput Input to check. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (checkNameAvailabilityInput == null) { - return Mono.error( - new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null.")); - } else { - checkNameAvailabilityInput.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), - checkNameAvailabilityInput, accept, context); - } - - /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. + * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API on successful completion of {@link Mono}. + * @return details for a specific support ticket on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono - checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String supportTicketName) { + return getWithResponseAsync(supportTicketName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. + * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return details for a specific support ticket along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput, context).block(); + public Response getWithResponse(String supportTicketName, Context context) { + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, accept, + context); } /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. + * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return details for a specific support ticket. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CheckNameAvailabilityOutputInner - checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { - return checkNameAvailabilityWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); + public SupportTicketDetailsInner get(String supportTicketName) { + return getWithResponse(supportTicketName, Context.NONE).getValue(); } /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Mono>> createWithResponseAsync(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), top, filter, this.client.getApiVersion(), - accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, contentType, accept, createSupportTicketParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return object that represents SupportTicketDetails resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Integer top, String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private Response createWithResponse(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), top, filter, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + contentType, accept, createSupportTicketParameters, Context.NONE); } /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedFlux}. + * @return object that represents SupportTicketDetails resource along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + contentType, accept, createSupportTicketParameters, context); } /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final Integer top = null; - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SupportTicketDetailsInner> + beginCreateAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + Mono>> mono + = createWithResponseAsync(supportTicketName, createSupportTicketParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, + this.client.getContext()); } /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Integer top, String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(top, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SupportTicketDetailsInner> + beginCreate(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + Response response = createWithResponse(supportTicketName, createSupportTicketParameters); + return this.client.getLroResult(response, + SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, Context.NONE); } /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Integer top = null; - final String filter = null; - return new PagedIterable<>(listAsync(top, filter)); - } - - /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Integer top, String filter, Context context) { - return new PagedIterable<>(listAsync(top, filter, context)); - } - - /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. - * - * @param supportTicketName Support ticket name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), supportTicketName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SupportTicketDetailsInner> beginCreate( + String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { + Response response = createWithResponse(supportTicketName, createSupportTicketParameters, context); + return this.client.getLroResult(response, + SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, context); } /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket along with {@link Response} on successful completion of - * {@link Mono}. + * @return object that represents SupportTicketDetails resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String supportTicketName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), supportTicketName, this.client.getApiVersion(), accept, context); + private Mono createAsync(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + return beginCreateAsync(supportTicketName, createSupportTicketParameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket on successful completion of {@link Mono}. + * @return object that represents SupportTicketDetails resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String supportTicketName) { - return getWithResponseAsync(supportTicketName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + public SupportTicketDetailsInner create(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + return beginCreate(supportTicketName, createSupportTicketParameters).getFinalResult(); } /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String supportTicketName, Context context) { - return getWithResponseAsync(supportTicketName, context).block(); - } - - /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. - * - * @param supportTicketName Support ticket name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket. + * @return object that represents SupportTicketDetails resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SupportTicketDetailsInner get(String supportTicketName) { - return getWithResponse(supportTicketName, Context.NONE).getValue(); + public SupportTicketDetailsInner create(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters, Context context) { + return beginCreate(supportTicketName, createSupportTicketParameters, context).getFinalResult(); } /** @@ -538,7 +494,7 @@ public SupportTicketDetailsInner get(String supportTicketName) { * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity * update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -549,24 +505,11 @@ public SupportTicketDetailsInner get(String supportTicketName) { @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync(String supportTicketName, UpdateSupportTicket updateSupportTicket) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (updateSupportTicket == null) { - return Mono - .error(new IllegalArgumentException("Parameter updateSupportTicket is required and cannot be null.")); - } else { - updateSupportTicket.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), supportTicketName, - this.client.getApiVersion(), updateSupportTicket, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + supportTicketName, contentType, accept, updateSupportTicket, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -576,45 +519,7 @@ private Mono> updateWithResponseAsync(String * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity * update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. - * @param updateSupportTicket UpdateSupportTicket object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String supportTicketName, - UpdateSupportTicket updateSupportTicket, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (updateSupportTicket == null) { - return Mono - .error(new IllegalArgumentException("Parameter updateSupportTicket is required and cannot be null.")); - } else { - updateSupportTicket.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), supportTicketName, this.client.getApiVersion(), - updateSupportTicket, accept, context); - } - - /** - * This API allows you to update the severity level, ticket status, and your contact information in the support - * ticket.<br/><br/>Note: The severity levels cannot be changed if a support ticket is actively being - * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity - * update by adding a new communication using the Communications API. - * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -634,7 +539,7 @@ private Mono updateAsync(String supportTicketName, * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity * update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -645,7 +550,10 @@ private Mono updateAsync(String supportTicketName, @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String supportTicketName, UpdateSupportTicket updateSupportTicket, Context context) { - return updateWithResponseAsync(supportTicketName, updateSupportTicket, context).block(); + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), supportTicketName, + contentType, accept, updateSupportTicket, context); } /** @@ -654,7 +562,7 @@ public Response updateWithResponse(String supportTick * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity * update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -667,305 +575,259 @@ public SupportTicketDetailsInner update(String supportTicketName, UpdateSupportT } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (createSupportTicketParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createSupportTicketParameters is required and cannot be null.")); - } else { - createSupportTicketParameters.validate(); - } + private Mono> listSinglePageAsync(Integer top, String filter) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), supportTicketName, - this.client.getApiVersion(), createSupportTicketParameters, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), top, filter, + accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. - * @param context The context to associate with this operation. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource along with {@link Response} on successful completion - * of {@link Mono}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (supportTicketName == null) { - return Mono - .error(new IllegalArgumentException("Parameter supportTicketName is required and cannot be null.")); - } - if (createSupportTicketParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createSupportTicketParameters is required and cannot be null.")); - } else { - createSupportTicketParameters.validate(); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), supportTicketName, this.client.getApiVersion(), - createSupportTicketParameters, accept, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Integer top, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + final Integer top = null; + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(top, filter), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SupportTicketDetailsInner> - beginCreateAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { - Mono>> mono - = createWithResponseAsync(supportTicketName, createSupportTicketParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer top, String filter) { + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), + this.client.getApiVersion(), top, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SupportTicketDetailsInner> beginCreateAsync( - String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(supportTicketName, createSupportTicketParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, context); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Integer top, String filter, Context context) { + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), top, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SupportTicketDetailsInner> - beginCreate(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { - return this.beginCreateAsync(supportTicketName, createSupportTicketParameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + final Integer top = null; + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(top, filter), nextLink -> listNextSinglePage(nextLink)); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SupportTicketDetailsInner> beginCreate( - String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { - return this.beginCreateAsync(supportTicketName, createSupportTicketParameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Integer top, String filter, Context context) { + return new PagedIterable<>(() -> listSinglePage(top, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. + * @return output of check name availability API along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - return beginCreateAsync(supportTicketName, createSupportTicketParameters).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), contentType, accept, checkNameAvailabilityInput, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. - * @param context The context to associate with this operation. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. + * @return output of check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - return beginCreateAsync(supportTicketName, createSupportTicketParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono + checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponseAsync(checkNameAvailabilityInput) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource. + * @return output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SupportTicketDetailsInner create(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - return createAsync(supportTicketName, createSupportTicketParameters).block(); + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.checkNameAvailabilitySync(this.client.getEndpoint(), this.client.getApiVersion(), contentType, + accept, checkNameAvailabilityInput, context); } /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. - * @param context The context to associate with this operation. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource. + * @return output of check name availability API. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SupportTicketDetailsInner create(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - return createAsync(supportTicketName, createSupportTicketParameters, context).block(); + public CheckNameAvailabilityOutputInner + checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithResponse(checkNameAvailabilityInput, Context.NONE).getValue(); } /** @@ -975,18 +837,11 @@ public SupportTicketDetailsInner create(String supportTicketName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -994,6 +849,24 @@ private Mono> listNextSinglePageAsync(S .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1002,22 +875,14 @@ private Mono> listNextSinglePageAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return [Placeholder] Description for page model along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } + private PagedResponse listNextSinglePage(String nextLink, Context context) { final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsImpl.java index 4e2aa9e817c2..b6e9ef237e1a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.implementation; @@ -31,49 +31,35 @@ public SupportTicketsNoSubscriptionsImpl(SupportTicketsNoSubscriptionsClient inn this.serviceManager = serviceManager; } - public Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { - Response inner - = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityInput, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public Response getWithResponse(String supportTicketName, Context context) { + Response inner = this.serviceClient().getWithResponse(supportTicketName, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SupportTicketDetailsImpl(inner.getValue(), this.manager())); } - public CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { - CheckNameAvailabilityOutputInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityInput); + public SupportTicketDetails get(String supportTicketName) { + SupportTicketDetailsInner inner = this.serviceClient().get(supportTicketName); if (inner != null) { - return new CheckNameAvailabilityOutputImpl(inner, this.manager()); + return new SupportTicketDetailsImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportTicketDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(Integer top, String filter, Context context) { - PagedIterable inner = this.serviceClient().list(top, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportTicketDetailsImpl(inner1, this.manager())); - } - - public Response getWithResponse(String supportTicketName, Context context) { - Response inner = this.serviceClient().getWithResponse(supportTicketName, context); + public SupportTicketDetails create(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters) { + SupportTicketDetailsInner inner = this.serviceClient().create(supportTicketName, createSupportTicketParameters); if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SupportTicketDetailsImpl(inner.getValue(), this.manager())); + return new SupportTicketDetailsImpl(inner, this.manager()); } else { return null; } } - public SupportTicketDetails get(String supportTicketName) { - SupportTicketDetailsInner inner = this.serviceClient().get(supportTicketName); + public SupportTicketDetails create(String supportTicketName, + SupportTicketDetailsInner createSupportTicketParameters, Context context) { + SupportTicketDetailsInner inner + = this.serviceClient().create(supportTicketName, createSupportTicketParameters, context); if (inner != null) { return new SupportTicketDetailsImpl(inner, this.manager()); } else { @@ -85,12 +71,8 @@ public Response updateWithResponse(String supportTicketNam UpdateSupportTicket updateSupportTicket, Context context) { Response inner = this.serviceClient().updateWithResponse(supportTicketName, updateSupportTicket, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SupportTicketDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SupportTicketDetailsImpl(inner.getValue(), this.manager())); } public SupportTicketDetails update(String supportTicketName, UpdateSupportTicket updateSupportTicket) { @@ -102,22 +84,28 @@ public SupportTicketDetails update(String supportTicketName, UpdateSupportTicket } } - public SupportTicketDetails create(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters) { - SupportTicketDetailsInner inner = this.serviceClient().create(supportTicketName, createSupportTicketParameters); - if (inner != null) { - return new SupportTicketDetailsImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportTicketDetailsImpl(inner1, this.manager())); } - public SupportTicketDetails create(String supportTicketName, - SupportTicketDetailsInner createSupportTicketParameters, Context context) { - SupportTicketDetailsInner inner - = this.serviceClient().create(supportTicketName, createSupportTicketParameters, context); + public PagedIterable list(Integer top, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(top, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SupportTicketDetailsImpl(inner1, this.manager())); + } + + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(checkNameAvailabilityInput, context); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityOutputImpl(inner.getValue(), this.manager())); + } + + public CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + CheckNameAvailabilityOutputInner inner = this.serviceClient().checkNameAvailability(checkNameAvailabilityInput); if (inner != null) { - return new SupportTicketDetailsImpl(inner, this.manager()); + return new CheckNameAvailabilityOutputImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ChatTranscriptsListResult.java similarity index 62% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsListResult.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ChatTranscriptsListResult.java index b50ba2e90369..af5db996c8da 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsListResult.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ChatTranscriptsListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.support.models; +package com.azure.resourcemanager.support.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,48 +14,28 @@ import java.util.List; /** - * Collection of Chat Transcripts resources. + * [Placeholder] Description for page model. */ -@Fluent +@Immutable public final class ChatTranscriptsListResult implements JsonSerializable { /* - * List of Chat Transcripts resources. + * [Placeholder] Description for nextLink property */ - private List value; + private String nextLink; /* - * The URI to fetch the next page of Chat Transcripts resources. + * [Placeholder] Description for value property */ - private String nextLink; + private List value; /** * Creates an instance of ChatTranscriptsListResult class. */ - public ChatTranscriptsListResult() { + private ChatTranscriptsListResult() { } /** - * Get the value property: List of Chat Transcripts resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Chat Transcripts resources. - * - * @param value the value value to set. - * @return the ChatTranscriptsListResult object itself. - */ - public ChatTranscriptsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of Chat Transcripts resources. + * Get the nextLink property: [Placeholder] Description for nextLink property. * * @return the nextLink value. */ @@ -64,25 +44,12 @@ public String nextLink() { } /** - * Set the nextLink property: The URI to fetch the next page of Chat Transcripts resources. - * - * @param nextLink the nextLink value to set. - * @return the ChatTranscriptsListResult object itself. - */ - public ChatTranscriptsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. + * Get the value property: [Placeholder] Description for value property. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the value value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public List value() { + return this.value; } /** @@ -91,8 +58,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -111,12 +78,12 @@ public static ChatTranscriptsListResult fromJson(JsonReader jsonReader) throws I String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedChatTranscriptsListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> ChatTranscriptDetailsInner.fromJson(reader1)); deserializedChatTranscriptsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedChatTranscriptsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/CommunicationsListResult.java similarity index 62% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsListResult.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/CommunicationsListResult.java index 0519433f657e..0b698680189a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsListResult.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/CommunicationsListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.support.models; +package com.azure.resourcemanager.support.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,48 +14,28 @@ import java.util.List; /** - * Collection of Communication resources. + * [Placeholder] Description for page model. */ -@Fluent +@Immutable public final class CommunicationsListResult implements JsonSerializable { /* - * List of Communication resources. + * [Placeholder] Description for nextLink property */ - private List value; + private String nextLink; /* - * The URI to fetch the next page of Communication resources. + * [Placeholder] Description for value property */ - private String nextLink; + private List value; /** * Creates an instance of CommunicationsListResult class. */ - public CommunicationsListResult() { + private CommunicationsListResult() { } /** - * Get the value property: List of Communication resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Communication resources. - * - * @param value the value value to set. - * @return the CommunicationsListResult object itself. - */ - public CommunicationsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of Communication resources. + * Get the nextLink property: [Placeholder] Description for nextLink property. * * @return the nextLink value. */ @@ -64,25 +44,12 @@ public String nextLink() { } /** - * Set the nextLink property: The URI to fetch the next page of Communication resources. - * - * @param nextLink the nextLink value to set. - * @return the CommunicationsListResult object itself. - */ - public CommunicationsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. + * Get the value property: [Placeholder] Description for value property. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the value value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public List value() { + return this.value; } /** @@ -91,8 +58,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -111,12 +78,12 @@ public static CommunicationsListResult fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedCommunicationsListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> CommunicationDetailsInner.fromJson(reader1)); deserializedCommunicationsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedCommunicationsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FilesListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/FilesListResult.java similarity index 62% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FilesListResult.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/FilesListResult.java index 3826d1633c6c..ee43b25e669e 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FilesListResult.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/FilesListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.support.models; +package com.azure.resourcemanager.support.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,48 +14,28 @@ import java.util.List; /** - * Object that represents a collection of File resources. + * [Placeholder] Description for page model. */ -@Fluent +@Immutable public final class FilesListResult implements JsonSerializable { /* - * List of File resources. + * [Placeholder] Description for nextLink property */ - private List value; + private String nextLink; /* - * The URI to fetch the next page of File resources. + * [Placeholder] Description for value property */ - private String nextLink; + private List value; /** * Creates an instance of FilesListResult class. */ - public FilesListResult() { + private FilesListResult() { } /** - * Get the value property: List of File resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of File resources. - * - * @param value the value value to set. - * @return the FilesListResult object itself. - */ - public FilesListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of File resources. + * Get the nextLink property: [Placeholder] Description for nextLink property. * * @return the nextLink value. */ @@ -64,25 +44,12 @@ public String nextLink() { } /** - * Set the nextLink property: The URI to fetch the next page of File resources. - * - * @param nextLink the nextLink value to set. - * @return the FilesListResult object itself. - */ - public FilesListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. + * Get the value property: [Placeholder] Description for value property. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the value value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public List value() { + return this.value; } /** @@ -91,8 +58,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -111,11 +78,11 @@ public static FilesListResult fromJson(JsonReader jsonReader) throws IOException String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedFilesListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> FileDetailsInner.fromJson(reader1)); deserializedFilesListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedFilesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/OperationListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/OperationListResult.java new file mode 100644 index 000000000000..31b59bfc2148 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/OperationListResult.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.support.fluent.models.OperationInner; +import java.io.IOException; +import java.util.List; + +/** + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. + */ +@Immutable +public final class OperationListResult implements JsonSerializable { + /* + * The Operation items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + private OperationListResult() { + } + + /** + * Get the value property: The Operation items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ProblemClassificationsListResult.java similarity index 76% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsListResult.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ProblemClassificationsListResult.java index 6c45414456e8..b44dd5ada430 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsListResult.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ProblemClassificationsListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.support.models; +package com.azure.resourcemanager.support.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,8 +16,13 @@ /** * Collection of ProblemClassification resources. */ -@Fluent +@Immutable public final class ProblemClassificationsListResult implements JsonSerializable { + /* + * The link to the next page of items + */ + private String nextLink; + /* * List of ProblemClassification resources. */ @@ -26,38 +31,25 @@ public final class ProblemClassificationsListResult implements JsonSerializable< /** * Creates an instance of ProblemClassificationsListResult class. */ - public ProblemClassificationsListResult() { - } - - /** - * Get the value property: List of ProblemClassification resources. - * - * @return the value value. - */ - public List value() { - return this.value; + private ProblemClassificationsListResult() { } /** - * Set the value property: List of ProblemClassification resources. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the ProblemClassificationsListResult object itself. + * @return the nextLink value. */ - public ProblemClassificationsListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** - * Validates the instance. + * Get the value property: List of ProblemClassification resources. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the value value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public List value() { + return this.value; } /** @@ -66,6 +58,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -86,7 +79,9 @@ public static ProblemClassificationsListResult fromJson(JsonReader jsonReader) t String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedProblemClassificationsListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> ProblemClassificationInner.fromJson(reader1)); deserializedProblemClassificationsListResult.value = value; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServicesListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ServicesListResult.java similarity index 75% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServicesListResult.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ServicesListResult.java index ac706591430e..c0bd83fc20d2 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServicesListResult.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/ServicesListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.support.models; +package com.azure.resourcemanager.support.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,8 +16,13 @@ /** * Collection of Service resources. */ -@Fluent +@Immutable public final class ServicesListResult implements JsonSerializable { + /* + * The link to the next page of items + */ + private String nextLink; + /* * List of Service resources. */ @@ -26,38 +31,25 @@ public final class ServicesListResult implements JsonSerializable value() { - return this.value; + private ServicesListResult() { } /** - * Set the value property: List of Service resources. + * Get the nextLink property: The link to the next page of items. * - * @param value the value value to set. - * @return the ServicesListResult object itself. + * @return the nextLink value. */ - public ServicesListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** - * Validates the instance. + * Get the value property: List of Service resources. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the value value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public List value() { + return this.value; } /** @@ -66,6 +58,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,7 +78,9 @@ public static ServicesListResult fromJson(JsonReader jsonReader) throws IOExcept String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedServicesListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> ServiceInner.fromJson(reader1)); deserializedServicesListResult.value = value; } else { diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/SupportTicketsListResult.java similarity index 62% rename from sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsListResult.java rename to sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/SupportTicketsListResult.java index 9e063d4a6e86..cd3025913d8a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsListResult.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/models/SupportTicketsListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.support.models; +package com.azure.resourcemanager.support.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,48 +14,28 @@ import java.util.List; /** - * Object that represents a collection of SupportTicket resources. + * [Placeholder] Description for page model. */ -@Fluent +@Immutable public final class SupportTicketsListResult implements JsonSerializable { /* - * List of SupportTicket resources. + * [Placeholder] Description for nextLink property */ - private List value; + private String nextLink; /* - * The URI to fetch the next page of SupportTicket resources. + * [Placeholder] Description for value property */ - private String nextLink; + private List value; /** * Creates an instance of SupportTicketsListResult class. */ - public SupportTicketsListResult() { + private SupportTicketsListResult() { } /** - * Get the value property: List of SupportTicket resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of SupportTicket resources. - * - * @param value the value value to set. - * @return the SupportTicketsListResult object itself. - */ - public SupportTicketsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page of SupportTicket resources. + * Get the nextLink property: [Placeholder] Description for nextLink property. * * @return the nextLink value. */ @@ -64,25 +44,12 @@ public String nextLink() { } /** - * Set the nextLink property: The URI to fetch the next page of SupportTicket resources. - * - * @param nextLink the nextLink value to set. - * @return the SupportTicketsListResult object itself. - */ - public SupportTicketsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. + * Get the value property: [Placeholder] Description for value property. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the value value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public List value() { + return this.value; } /** @@ -91,8 +58,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("nextLink", this.nextLink); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -111,12 +78,12 @@ public static SupportTicketsListResult fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("value".equals(fieldName)) { + if ("nextLink".equals(fieldName)) { + deserializedSupportTicketsListResult.nextLink = reader.getString(); + } else if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> SupportTicketDetailsInner.fromJson(reader1)); deserializedSupportTicketsListResult.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedSupportTicketsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/package-info.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/package-info.java index 5eefc7c7390f..ab9e70ce5c10 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/package-info.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for MicrosoftSupport. + * Package containing the implementations for Support. * Microsoft Azure Support Resource Provider. */ package com.azure.resourcemanager.support.implementation; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ActionType.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ActionType.java new file mode 100644 index 000000000000..c9e506d5ddd8 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ActionType.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ +public final class ActionType extends ExpandableStringEnum { + /** + * Actions are for internal-only APIs. + */ + public static final ActionType INTERNAL = fromString("Internal"); + + /** + * Creates a new instance of ActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ActionType() { + } + + /** + * Creates or finds a ActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActionType. + */ + public static ActionType fromString(String name) { + return fromString(name, ActionType.class); + } + + /** + * Gets known ActionType values. + * + * @return known ActionType values. + */ + public static Collection values() { + return values(ActionType.class); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatConversationStatus.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatConversationStatus.java new file mode 100644 index 000000000000..f86842dcb88d --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatConversationStatus.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the chat conversation associated with the support ticket. + */ +public final class ChatConversationStatus extends ExpandableStringEnum { + /** + * Chat conversation is currently active. + */ + public static final ChatConversationStatus ACTIVE = fromString("Active"); + + /** + * Chat conversation has been closed. + */ + public static final ChatConversationStatus CLOSED = fromString("Closed"); + + /** + * Creates a new instance of ChatConversationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ChatConversationStatus() { + } + + /** + * Creates or finds a ChatConversationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding ChatConversationStatus. + */ + public static ChatConversationStatus fromString(String name) { + return fromString(name, ChatConversationStatus.class); + } + + /** + * Gets known ChatConversationStatus values. + * + * @return known ChatConversationStatus values. + */ + public static Collection values() { + return values(ChatConversationStatus.class); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptDetails.java index 08b5037765ad..4634e4337047 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscripts.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscripts.java index 0d4ca2eeacf4..a684d4efc369 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscripts.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscripts.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,51 +13,51 @@ */ public interface ChatTranscripts { /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource along with {@link Response}. */ - PagedIterable list(String supportTicketName); + Response getWithResponse(String supportTicketName, String chatTranscriptName, + Context context); /** - * Lists all chat transcripts for a support ticket under subscription. + * Returns chatTranscript details for a support ticket under a subscription. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource. */ - PagedIterable list(String supportTicketName, Context context); + ChatTranscriptDetails get(String supportTicketName, String chatTranscriptName); /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String supportTicketName, String chatTranscriptName, - Context context); + PagedIterable list(String supportTicketName); /** - * Returns chatTranscript details for a support ticket under a subscription. + * Lists all chat transcripts for a support ticket under subscription. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - ChatTranscriptDetails get(String supportTicketName, String chatTranscriptName); + PagedIterable list(String supportTicketName, Context context); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsNoSubscriptions.java index ae6b5dc430ed..c81a23795087 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsNoSubscriptions.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsNoSubscriptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,51 +13,51 @@ */ public interface ChatTranscriptsNoSubscriptions { /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource along with {@link Response}. */ - PagedIterable list(String supportTicketName); + Response getWithResponse(String supportTicketName, String chatTranscriptName, + Context context); /** - * Lists all chat transcripts for a support ticket. + * Returns chatTranscript details for a no subscription support ticket. * - * @param supportTicketName Support ticket name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param chatTranscriptName The name of the ChatTranscriptDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Chat Transcripts resources as paginated response with {@link PagedIterable}. + * @return object that represents a Chat Transcript resource. */ - PagedIterable list(String supportTicketName, Context context); + ChatTranscriptDetails get(String supportTicketName, String chatTranscriptName); /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String supportTicketName, String chatTranscriptName, - Context context); + PagedIterable list(String supportTicketName); /** - * Returns chatTranscript details for a no subscription support ticket. + * Lists all chat transcripts for a support ticket. * - * @param supportTicketName Support ticket name. - * @param chatTranscriptName ChatTranscript name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Chat Transcript resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - ChatTranscriptDetails get(String supportTicketName, String chatTranscriptName); + PagedIterable list(String supportTicketName, Context context); } 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 6c85c3e20272..c19f7ef87a0b 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -73,26 +72,6 @@ public CheckNameAvailabilityInput withType(Type type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); - } - if (type() == null) { - throw LOGGER.atError() - .log( - new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityInput.class); - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityOutput.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityOutput.java index f5c32ee916d7..2a2eadc19490 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityOutput.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityOutput.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassificationService.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassificationService.java new file mode 100644 index 000000000000..f2a0c9ce3747 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassificationService.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Service Classification result object. + */ +@Immutable +public class ClassificationService implements JsonSerializable { + /* + * Azure resource Id of the service. + */ + private String serviceId; + + /* + * Localized name of the azure service. + */ + private String displayName; + + /* + * List of applicable ARM resource types for this service. + */ + private List resourceTypes; + + /** + * Creates an instance of ClassificationService class. + */ + protected ClassificationService() { + } + + /** + * Get the serviceId property: Azure resource Id of the service. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: Azure resource Id of the service. + * + * @param serviceId the serviceId value to set. + * @return the ClassificationService object itself. + */ + ClassificationService withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Get the displayName property: Localized name of the azure service. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized name of the azure service. + * + * @param displayName the displayName value to set. + * @return the ClassificationService object itself. + */ + ClassificationService withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * 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. + */ + ClassificationService withResourceTypes(List resourceTypes) { + this.resourceTypes = resourceTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceTypes", this.resourceTypes, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClassificationService from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClassificationService if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ClassificationService. + */ + public static ClassificationService fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClassificationService deserializedClassificationService = new ClassificationService(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceId".equals(fieldName)) { + deserializedClassificationService.serviceId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedClassificationService.displayName = reader.getString(); + } else if ("resourceTypes".equals(fieldName)) { + List resourceTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedClassificationService.resourceTypes = resourceTypes; + } else { + reader.skipChildren(); + } + } + + return deserializedClassificationService; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyProblems.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyProblems.java new file mode 100644 index 000000000000..4a9af1ca56b6 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyProblems.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyProblems. + */ +public interface ClassifyProblems { + /** + * 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/ClassifyProblemsNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyProblemsNoSubscriptions.java new file mode 100644 index 000000000000..4fdaa73be65d --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyProblemsNoSubscriptions.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyProblemsNoSubscriptions. + */ +public interface ClassifyProblemsNoSubscriptions { + /** + * 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/ClassifyServices.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyServices.java new file mode 100644 index 000000000000..c77fab1b9d65 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyServices.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyServices. + */ +public interface ClassifyServices { + /** + * 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/ClassifyServicesNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyServicesNoSubscriptions.java new file mode 100644 index 000000000000..7482f1d69f5e --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ClassifyServicesNoSubscriptions.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 ClassifyServicesNoSubscriptions. + */ +public interface ClassifyServicesNoSubscriptions { + /** + * 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/CommunicationDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDetails.java index 7964dd4bcf49..253267402713 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; import java.time.OffsetDateTime; @@ -33,6 +34,13 @@ public interface CommunicationDetails { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the communicationType property: Communication type. * @@ -107,7 +115,7 @@ interface WithParentResource { /** * Specifies supportTicketName. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @return the next definition stage. */ WithSubject withExistingSupportTicket(String supportTicketName); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDirection.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDirection.java index c4d39a6fd72f..46c0b77725cf 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDirection.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationDirection.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationType.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationType.java index 91eaf8006ef1..fa17de1ac6a1 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationType.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Communications.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Communications.java index a7c727e56406..00b3eaf20c8a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Communications.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Communications.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,33 +13,29 @@ */ public interface Communications { /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return object that represents a Communication resource along with {@link Response}. */ - Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + Response getWithResponse(String supportTicketName, String communicationName, Context context); /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return object that represents a Communication resource. */ - CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput); + CommunicationDetails get(String supportTicketName, String communicationName); /** * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also @@ -49,11 +45,11 @@ CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ PagedIterable list(String supportTicketName); @@ -65,7 +61,7 @@ CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -75,34 +71,38 @@ CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ PagedIterable list(String supportTicketName, Integer top, String filter, Context context); /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response}. + * @return output of check name availability API along with {@link Response}. */ - Response getWithResponse(String supportTicketName, String communicationName, Context context); + Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API. */ - CommunicationDetails get(String supportTicketName, String communicationName); + CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput); /** * Returns communication details for a support ticket. diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsNoSubscriptions.java index 742edc05e03c..0e69a7fcb5e4 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsNoSubscriptions.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/CommunicationsNoSubscriptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -14,33 +14,58 @@ */ public interface CommunicationsNoSubscriptions { /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return object that represents a Communication resource along with {@link Response}. */ - Response checkNameAvailabilityWithResponse(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + Response getWithResponse(String supportTicketName, String communicationName, Context context); /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding - * a new communication to the support ticket. + * Returns communication details for a support ticket. * - * @param supportTicketName Support ticket name. - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return object that represents a Communication resource. */ - CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, - CheckNameAvailabilityInput checkNameAvailabilityInput); + CommunicationDetails get(String supportTicketName, String communicationName); + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + CommunicationDetails create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters); + + /** + * Adds a new customer communication to an Azure support ticket. + * + * @param supportTicketName The name of the SupportTicketDetails. + * @param communicationName The name of the CommunicationDetails. + * @param createCommunicationParameters Communication object. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return object that represents a Communication resource. + */ + CommunicationDetails create(String supportTicketName, String communicationName, + CommunicationDetailsInner createCommunicationParameters, Context context); /** * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also @@ -50,11 +75,11 @@ CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ PagedIterable list(String supportTicketName); @@ -66,7 +91,7 @@ CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, * for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might * cause an error. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param top The number of values to return in the collection. Default is 10 and max is 10. * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate * properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and @@ -76,61 +101,36 @@ CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of Communication resources as paginated response with {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ PagedIterable list(String supportTicketName, Integer top, String filter, Context context); /** - * Returns communication details for a support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource along with {@link Response}. - */ - Response getWithResponse(String supportTicketName, String communicationName, Context context); - - /** - * Returns communication details for a support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. - */ - CommunicationDetails get(String supportTicketName, String communicationName); - - /** - * Adds a new customer communication to an Azure support ticket. - * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API along with {@link Response}. */ - CommunicationDetails create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters); + Response checkNameAvailabilityWithResponse(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); /** - * Adds a new customer communication to an Azure support ticket. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for adding + * a new communication to the support ticket. * - * @param supportTicketName Support ticket name. - * @param communicationName Communication name. - * @param createCommunicationParameters Communication object. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param checkNameAvailabilityInput Input to check. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a Communication resource. + * @return output of check name availability API. */ - CommunicationDetails create(String supportTicketName, String communicationName, - CommunicationDetailsInner createCommunicationParameters, Context context); + CheckNameAvailabilityOutput checkNameAvailability(String supportTicketName, + CheckNameAvailabilityInput checkNameAvailabilityInput); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Consent.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Consent.java index 7fa414599766..f9d344d4b2d5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Consent.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Consent.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; 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 b77e12a67a35..e82c731c4e49 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 @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -44,7 +43,8 @@ public final class ContactProfile implements JsonSerializable { private List additionalEmailAddresses; /* - * Phone number. This is required if preferred contact method is phone. + * Phone number. This is required if preferred contact method is phone. It is also required when submitting + * 'critical' or 'highestcriticalimpact' severity cases. */ private String phoneNumber; @@ -178,7 +178,8 @@ public ContactProfile withAdditionalEmailAddresses(List additionalEmailA } /** - * Get the phoneNumber property: Phone number. This is required if preferred contact method is phone. + * Get the phoneNumber property: Phone number. This is required if preferred contact method is phone. It is also + * required when submitting 'critical' or 'highestcriticalimpact' severity cases. * * @return the phoneNumber value. */ @@ -187,7 +188,8 @@ public String phoneNumber() { } /** - * Set the phoneNumber property: Phone number. This is required if preferred contact method is phone. + * Set the phoneNumber property: Phone number. This is required if preferred contact method is phone. It is also + * required when submitting 'critical' or 'highestcriticalimpact' severity cases. * * @param phoneNumber the phoneNumber value to set. * @return the ContactProfile object itself. @@ -269,48 +271,6 @@ public ContactProfile withPreferredSupportLanguage(String preferredSupportLangua return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (firstName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property firstName in model ContactProfile")); - } - if (lastName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property lastName in model ContactProfile")); - } - if (preferredContactMethod() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property preferredContactMethod in model ContactProfile")); - } - if (primaryEmailAddress() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property primaryEmailAddress in model ContactProfile")); - } - if (preferredTimeZone() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property preferredTimeZone in model ContactProfile")); - } - if (country() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property country in model ContactProfile")); - } - if (preferredSupportLanguage() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property preferredSupportLanguage in model ContactProfile")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContactProfile.class); - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/DirectConnectEscalation.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/DirectConnectEscalation.java new file mode 100644 index 000000000000..f6e561ca7c50 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/DirectConnectEscalation.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Direct Connect Escalation details for a support ticket. + */ +@Fluent +public final class DirectConnectEscalation implements JsonSerializable { + /* + * Status of Direct Connect Escalation. + */ + private EscalationStatus azureEEStatus; + + /* + * An array containing the allowed severities for direct connect escalation. + */ + private List allowedSeverities; + + /* + * Reason for escalation / business impact. + */ + private String reasonForEscalation; + + /** + * Creates an instance of DirectConnectEscalation class. + */ + public DirectConnectEscalation() { + } + + /** + * Get the azureEEStatus property: Status of Direct Connect Escalation. + * + * @return the azureEEStatus value. + */ + public EscalationStatus azureEEStatus() { + return this.azureEEStatus; + } + + /** + * Set the azureEEStatus property: Status of Direct Connect Escalation. + * + * @param azureEEStatus the azureEEStatus value to set. + * @return the DirectConnectEscalation object itself. + */ + public DirectConnectEscalation withAzureEEStatus(EscalationStatus azureEEStatus) { + this.azureEEStatus = azureEEStatus; + return this; + } + + /** + * Get the allowedSeverities property: An array containing the allowed severities for direct connect escalation. + * + * @return the allowedSeverities value. + */ + public List allowedSeverities() { + return this.allowedSeverities; + } + + /** + * Set the allowedSeverities property: An array containing the allowed severities for direct connect escalation. + * + * @param allowedSeverities the allowedSeverities value to set. + * @return the DirectConnectEscalation object itself. + */ + public DirectConnectEscalation withAllowedSeverities(List allowedSeverities) { + this.allowedSeverities = allowedSeverities; + return this; + } + + /** + * Get the reasonForEscalation property: Reason for escalation / business impact. + * + * @return the reasonForEscalation value. + */ + public String reasonForEscalation() { + return this.reasonForEscalation; + } + + /** + * Set the reasonForEscalation property: Reason for escalation / business impact. + * + * @param reasonForEscalation the reasonForEscalation value to set. + * @return the DirectConnectEscalation object itself. + */ + public DirectConnectEscalation withReasonForEscalation(String reasonForEscalation) { + this.reasonForEscalation = reasonForEscalation; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("azureEEStatus", this.azureEEStatus == null ? null : this.azureEEStatus.toString()); + jsonWriter.writeArrayField("allowedSeverities", this.allowedSeverities, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("reasonForEscalation", this.reasonForEscalation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DirectConnectEscalation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DirectConnectEscalation if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DirectConnectEscalation. + */ + public static DirectConnectEscalation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DirectConnectEscalation deserializedDirectConnectEscalation = new DirectConnectEscalation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("azureEEStatus".equals(fieldName)) { + deserializedDirectConnectEscalation.azureEEStatus = EscalationStatus.fromString(reader.getString()); + } else if ("allowedSeverities".equals(fieldName)) { + List allowedSeverities + = reader.readArray(reader1 -> SeverityLevel.fromString(reader1.getString())); + deserializedDirectConnectEscalation.allowedSeverities = allowedSeverities; + } else if ("reasonForEscalation".equals(fieldName)) { + deserializedDirectConnectEscalation.reasonForEscalation = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDirectConnectEscalation; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/EscalationStatus.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/EscalationStatus.java new file mode 100644 index 000000000000..e8575b8015f9 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/EscalationStatus.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of Direct Connect Escalation. + */ +public final class EscalationStatus extends ExpandableStringEnum { + /** + * Escalation is available and uninitiated. + */ + public static final EscalationStatus ESCALATION_AVAILABLE = fromString("EscalationAvailable"); + + /** + * Escalation is unavailable and has been initiated. + */ + public static final EscalationStatus ESCALATION_INITIATED = fromString("EscalationInitiated"); + + /** + * Escalation is unavailable and has finished processing after being initiated. + */ + public static final EscalationStatus ESCALATION_PROCESSED = fromString("EscalationProcessed"); + + /** + * Escalation is unavailable and cannot be initiated due to direct escalation being unsupported on this product or + * topic. + */ + public static final EscalationStatus ESCALATION_UNSUPPORTED = fromString("EscalationUnsupported"); + + /** + * Escalation is unavailable and cannot be initiated due to customer not being enrolled to direct escalation. + */ + public static final EscalationStatus ESCALATION_UNAVAILABLE = fromString("EscalationUnavailable"); + + /** + * Creates a new instance of EscalationStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EscalationStatus() { + } + + /** + * Creates or finds a EscalationStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding EscalationStatus. + */ + public static EscalationStatus fromString(String name) { + return fromString(name, EscalationStatus.class); + } + + /** + * Gets known EscalationStatus values. + * + * @return known EscalationStatus values. + */ + public static Collection values() { + return values(EscalationStatus.class); + } +} 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 ecb0f5034aeb..bfaec0ab156a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -103,7 +103,7 @@ interface WithParentResource { /** * Specifies fileWorkspaceName. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @return the next definition stage. */ WithCreate withExistingFileWorkspace(String fileWorkspaceName); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaceDetails.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaceDetails.java index 33c3f744d6bb..534e797b06b5 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaceDetails.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaceDetails.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaces.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaces.java index 272b19e155ab..369438a3356e 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaces.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspaces.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -14,7 +14,7 @@ public interface FileWorkspaces { /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -26,7 +26,7 @@ public interface FileWorkspaces { /** * Gets details for a specific file workspace in an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -37,7 +37,7 @@ public interface FileWorkspaces { /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -49,7 +49,7 @@ public interface FileWorkspaces { /** * Creates a new file workspace for the specified subscription. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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/FileWorkspacesNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspacesNoSubscriptions.java index 1b78467093a6..8fc655ffcd35 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspacesNoSubscriptions.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FileWorkspacesNoSubscriptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -14,7 +14,7 @@ public interface FileWorkspacesNoSubscriptions { /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -26,7 +26,7 @@ public interface FileWorkspacesNoSubscriptions { /** * Gets details for a specific file workspace. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -37,7 +37,7 @@ public interface FileWorkspacesNoSubscriptions { /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -49,7 +49,7 @@ public interface FileWorkspacesNoSubscriptions { /** * Creates a new file workspace. * - * @param fileWorkspaceName File workspace name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.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/Files.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Files.java index 0b35a2c2a192..75ba186f35f9 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Files.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Files.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,58 +13,58 @@ */ public interface Files { /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. + * @return object that represents File Details resource along with {@link Response}. */ - PagedIterable list(String fileWorkspaceName); + Response getWithResponse(String fileWorkspaceName, String fileName, Context context); /** - * Lists all the Files information under a workspace for an Azure subscription. + * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. + * @return object that represents File Details resource. */ - PagedIterable list(String fileWorkspaceName, Context context); + FileDetails get(String fileWorkspaceName, String fileName); /** - * Returns details of a specific file in a work space. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. - * @param context The context to associate with this operation. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource along with {@link Response}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String fileWorkspaceName, String fileName, Context context); + PagedIterable list(String fileWorkspaceName); /** - * Returns details of a specific file in a work space. + * Lists all the Files information under a workspace for an Azure subscription. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents File Details resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - FileDetails get(String fileWorkspaceName, String fileName); + PagedIterable list(String fileWorkspaceName, Context context); /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -78,8 +78,8 @@ Response uploadWithResponse(String fileWorkspaceName, String fileName, Upl /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @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/FilesNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FilesNoSubscriptions.java index 849095a938a3..432eb0bf21de 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FilesNoSubscriptions.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/FilesNoSubscriptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,34 +13,11 @@ * Resource collection API of FilesNoSubscriptions. */ public interface FilesNoSubscriptions { - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String fileWorkspaceName); - - /** - * Lists all the Files information under a workspace for an Azure subscription. - * - * @param fileWorkspaceName File Workspace Name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of File resources as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String fileWorkspaceName, Context context); - /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -52,8 +29,8 @@ public interface FilesNoSubscriptions { /** * Returns details of a specific file in a work space. * - * @param fileWorkspaceName File Workspace Name. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -64,8 +41,8 @@ public interface FilesNoSubscriptions { /** * Creates a new file under a workspace. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param createFileParameters Create file object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -79,8 +56,8 @@ Response createWithResponse(String fileWorkspaceName, String fileNa /** * Creates a new file under a workspace. * - * @param fileWorkspaceName File workspace name. - * @param fileName File name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param createFileParameters Create file object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -89,11 +66,34 @@ Response createWithResponse(String fileWorkspaceName, String fileNa */ FileDetails create(String fileWorkspaceName, String fileName, FileDetailsInner createFileParameters); + /** + * Lists all the Files information under a workspace for an Azure subscription. + * + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String fileWorkspaceName); + + /** + * Lists all the Files information under a workspace for an Azure subscription. + * + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + PagedIterable list(String fileWorkspaceName, Context context); + /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -107,8 +107,8 @@ Response uploadWithResponse(String fileWorkspaceName, String fileName, Upl /** * This API allows you to upload content to a file. * - * @param fileWorkspaceName File WorkspaceName. - * @param fileName File Name. + * @param fileWorkspaceName The name of the FileWorkspaceDetails. + * @param fileName The name of the FileDetails. * @param uploadFile UploadFile object. * @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/IsTemporaryTicket.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/IsTemporaryTicket.java index 1685c9f8cffc..5b75a1249340 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/IsTemporaryTicket.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/IsTemporaryTicket.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; 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 new file mode 100644 index 000000000000..d762b6b1eff3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequest.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The look up resource Id request body. + */ +@Fluent +public final class LookUpResourceIdRequest implements JsonSerializable { + /* + * The System generated Id that is unique. Use supportTicketId property for Microsoft.Support/supportTickets + * resource type. + */ + private String identifier; + + /* + * The type of resource. + */ + private LookUpResourceIdRequestType 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 LookUpResourceIdRequestType 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(LookUpResourceIdRequestType type) { + this.type = type; + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("identifier", this.identifier); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LookUpResourceIdRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LookUpResourceIdRequest if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the LookUpResourceIdRequest. + */ + public static LookUpResourceIdRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LookUpResourceIdRequest deserializedLookUpResourceIdRequest = new LookUpResourceIdRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("identifier".equals(fieldName)) { + deserializedLookUpResourceIdRequest.identifier = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedLookUpResourceIdRequest.type + = LookUpResourceIdRequestType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedLookUpResourceIdRequest; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequestType.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequestType.java new file mode 100644 index 000000000000..cdba71edc837 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequestType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +/** + * Defines values for LookUpResourceIdRequestType. + */ +public enum LookUpResourceIdRequestType { + /** + * Enum value Microsoft.Support/supportTickets. + */ + MICROSOFT_SUPPORT_SUPPORT_TICKETS("Microsoft.Support/supportTickets"); + + /** + * The actual serialized value for a LookUpResourceIdRequestType instance. + */ + private final String value; + + LookUpResourceIdRequestType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a LookUpResourceIdRequestType instance. + * + * @param value the serialized value to parse. + * @return the parsed LookUpResourceIdRequestType object, or null if unable to parse. + */ + public static LookUpResourceIdRequestType fromString(String value) { + if (value == null) { + return null; + } + LookUpResourceIdRequestType[] items = LookUpResourceIdRequestType.values(); + for (LookUpResourceIdRequestType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} 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 new file mode 100644 index 000000000000..cde426a1fe85 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdResponse.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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/MessageProperties.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/MessageProperties.java index 0ad63a6b46c0..82b6acc5b601 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -16,12 +16,12 @@ /** * Describes the properties of a Message Details resource. */ -@Fluent +@Immutable public final class MessageProperties implements JsonSerializable { /* * Content type. */ - private TranscriptContentType contentType; + private String contentType; /* * Direction of communication. @@ -46,7 +46,7 @@ public final class MessageProperties implements JsonSerializable { /* - * The description of the operation. + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - private String description; + private String provider; /* - * The action that users can perform, based on their permission level. + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - private String operation; + private String resource; /* - * Service provider: Microsoft Support. + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - private String provider; + private String operation; /* - * Resource on which the operation is performed. + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - private String resource; + private String description; /** * Creates an instance of OperationDisplay class. */ - public OperationDisplay() { + private OperationDisplay() { } /** - * Get the description property: The description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the operation property: The action that users can perform, based on their permission level. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the provider property: Service provider: Microsoft Support. + * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring + * Insights" or "Microsoft Compute". * * @return the provider value. */ @@ -70,7 +56,8 @@ public String provider() { } /** - * Get the resource property: Resource on which the operation is performed. + * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. + * "Virtual Machines" or "Job Schedule Collections". * * @return the resource value. */ @@ -79,11 +66,23 @@ public String resource() { } /** - * Validates the instance. + * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Get the description property: The short, localized friendly description of the operation; suitable for tool tips + * and detailed views. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the description value. */ - public void validate() { + public String description() { + return this.description; } /** @@ -110,14 +109,14 @@ public static OperationDisplay fromJson(JsonReader jsonReader) throws IOExceptio String fieldName = reader.getFieldName(); reader.nextToken(); - if ("description".equals(fieldName)) { - deserializedOperationDisplay.description = reader.getString(); - } else if ("operation".equals(fieldName)) { - deserializedOperationDisplay.operation = reader.getString(); - } else if ("provider".equals(fieldName)) { + if ("provider".equals(fieldName)) { deserializedOperationDisplay.provider = reader.getString(); } else if ("resource".equals(fieldName)) { deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Operations.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Operations.java index fab5f2944d33..d2c34ce16dd2 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Operations.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Operations.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -12,23 +12,23 @@ */ public interface Operations { /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ PagedIterable list(); /** - * This lists all the available Microsoft Support REST API operations. + * List the operations for the provider. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of operations supported by Microsoft Support resource provider as paginated response with + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with * {@link PagedIterable}. */ PagedIterable list(Context context); diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationsListResult.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationsListResult.java deleted file mode 100644 index 33324b96ee8b..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationsListResult.java +++ /dev/null @@ -1,99 +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.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.support.fluent.models.OperationInner; -import java.io.IOException; -import java.util.List; - -/** - * The list of operations supported by Microsoft Support resource provider. - */ -@Fluent -public final class OperationsListResult implements JsonSerializable { - /* - * The list of operations supported by Microsoft Support resource provider. - */ - private List value; - - /** - * Creates an instance of OperationsListResult class. - */ - public OperationsListResult() { - } - - /** - * Get the value property: The list of operations supported by Microsoft Support resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of operations supported by Microsoft Support resource provider. - * - * @param value the value value to set. - * @return the OperationsListResult object itself. - */ - public OperationsListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationsListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationsListResult if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IOException If an error occurs while reading the OperationsListResult. - */ - public static OperationsListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationsListResult deserializedOperationsListResult = new OperationsListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); - deserializedOperationsListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedOperationsListResult; - }); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Origin.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Origin.java new file mode 100644 index 000000000000..7f02e6e52d92 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Origin.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value + * is "user,system". + */ +public final class Origin extends ExpandableStringEnum { + /** + * Indicates the operation is initiated by a user. + */ + public static final Origin USER = fromString("user"); + + /** + * Indicates the operation is initiated by a system. + */ + public static final Origin SYSTEM = fromString("system"); + + /** + * Indicates the operation is initiated by a user or system. + */ + public static final Origin USER_SYSTEM = fromString("user,system"); + + /** + * Creates a new instance of Origin value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Origin() { + } + + /** + * Creates or finds a Origin from its string representation. + * + * @param name a name to look for. + * @return the corresponding Origin. + */ + public static Origin fromString(String name) { + return fromString(name, Origin.class); + } + + /** + * Gets known Origin values. + * + * @return known Origin values. + */ + public static Collection values() { + return values(Origin.class); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/PreferredContactMethod.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/PreferredContactMethod.java index 3cbc4f063f6d..c5b8a69def7c 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/PreferredContactMethod.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/PreferredContactMethod.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; 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 7a7440a6b908..cf1d5a661eb6 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; import java.util.List; @@ -12,26 +13,33 @@ */ public interface ProblemClassification { /** - * Gets the id property: Id of the resource. + * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** - * Gets the name property: Name of the resource. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: Type of the resource 'Microsoft.Support/problemClassification'. + * Gets the type property: The type of the resource. * * @return the type value. */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the displayName property: Localized name of problem classification. * 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 960a9159ccc9..6e5278538ee6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,55 +13,55 @@ */ public interface ProblemClassifications { /** - * 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 - * set of service and problem classification Ids. + * 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. + * @param problemClassificationName Name of problem classification. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. + * @return problem classification details for a specific Azure service along with {@link Response}. */ - PagedIterable list(String serviceName); + Response getWithResponse(String serviceName, String problemClassificationName, + Context context); /** - * 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 - * set of service and problem classification Ids. + * 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 context The context to associate with this operation. + * @param serviceName Name of the Azure service. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. + * @return problem classification details for a specific Azure service. */ - PagedIterable list(String serviceName, Context context); + ProblemClassification get(String serviceName, String problemClassificationName); /** - * Get problem classification details for a specific Azure service. + * 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 + * set of service and problem classification Ids. * - * @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. + * @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. - * @return problem classification details for a specific Azure service along with {@link Response}. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ - Response getWithResponse(String serviceName, String problemClassificationName, - Context context); + PagedIterable list(String serviceName); /** - * Get problem classification details for a specific Azure service. + * 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 + * set of service and problem classification Ids. * - * @param serviceName Name of the Azure service available for support. - * @param problemClassificationName Name of problem classification. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return problem classification details for a specific Azure service. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ - ProblemClassification get(String serviceName, String problemClassificationName); + PagedIterable list(String serviceName, Context context); } 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 new file mode 100644 index 000000000000..a96828c42b9f --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationInput.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input to problem classification Classification API. + */ +@Fluent +public final class ProblemClassificationsClassificationInput + implements JsonSerializable { + /* + * Natural language description of the customer’s issue. + */ + private String issueSummary; + + /* + * ARM resource Id of the resource that is having the issue. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issueSummary", this.issueSummary); + jsonWriter.writeStringField("resourceId", this.resourceId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProblemClassificationsClassificationInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProblemClassificationsClassificationInput if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProblemClassificationsClassificationInput. + */ + public static ProblemClassificationsClassificationInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProblemClassificationsClassificationInput deserializedProblemClassificationsClassificationInput + = new ProblemClassificationsClassificationInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueSummary".equals(fieldName)) { + deserializedProblemClassificationsClassificationInput.issueSummary = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedProblemClassificationsClassificationInput.resourceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProblemClassificationsClassificationInput; + }); + } +} 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 new file mode 100644 index 000000000000..fd257314aea2 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationOutput.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 new file mode 100644 index 000000000000..16815aafa009 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationResult.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * ProblemClassification Classification result object. + */ +@Immutable +public final class ProblemClassificationsClassificationResult + implements JsonSerializable { + /* + * Identifier that may be used for solution discovery or some other purposes. + */ + private String problemId; + + /* + * Title of the problem classification result. + */ + private String title; + + /* + * Description of the problem classification result. + */ + private String description; + + /* + * Identifier of the service associated with this problem classification result. + */ + private String serviceId; + + /* + * Identifier that may be used for support ticket creation. + */ + private String problemClassificationId; + + /* + * Related service. + */ + private ClassificationService relatedService; + + /* + * Identifier of the article associated with this problem classification result. This value is populated only when a + * related article is available; otherwise it is omitted. + */ + private String articleId; + + /** + * Creates an instance of ProblemClassificationsClassificationResult class. + */ + private 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 relatedService property: Related service. + * + * @return the relatedService value. + */ + public ClassificationService relatedService() { + return this.relatedService; + } + + /** + * Get the articleId property: Identifier of the article associated with this problem classification result. This + * value is populated only when a related article is available; otherwise it is omitted. + * + * @return the articleId value. + */ + public String articleId() { + return this.articleId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("relatedService", this.relatedService); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProblemClassificationsClassificationResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProblemClassificationsClassificationResult if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProblemClassificationsClassificationResult. + */ + public static ProblemClassificationsClassificationResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProblemClassificationsClassificationResult deserializedProblemClassificationsClassificationResult + = new ProblemClassificationsClassificationResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("problemId".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.problemId = reader.getString(); + } else if ("title".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.title = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.description = reader.getString(); + } else if ("serviceId".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.serviceId = reader.getString(); + } else if ("problemClassificationId".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.problemClassificationId = reader.getString(); + } else if ("relatedService".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.relatedService + = ClassificationService.fromJson(reader); + } else if ("articleId".equals(fieldName)) { + deserializedProblemClassificationsClassificationResult.articleId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedProblemClassificationsClassificationResult; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaChangeRequest.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaChangeRequest.java index b151b0436657..c2894ae36cf6 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaChangeRequest.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/QuotaChangeRequest.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -72,14 +72,6 @@ public QuotaChangeRequest withPayload(String payload) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 c0987e908850..30c41163bb37 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -103,17 +103,6 @@ public QuotaTicketDetails withQuotaChangeRequests(List quota return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (quotaChangeRequests() != null) { - quotaChangeRequests().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ 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 90dd52d6f271..799edb549a0f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -75,14 +75,6 @@ public SecondaryConsent withType(String type) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsentEnabled.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsentEnabled.java index 7d888052032f..72c6a9704f9f 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsentEnabled.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SecondaryConsentEnabled.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * This property indicates whether secondary consent is present for problem classification. */ -@Fluent +@Immutable public final class SecondaryConsentEnabled implements JsonSerializable { /* * User consent description. @@ -29,7 +29,7 @@ public final class SecondaryConsentEnabled implements JsonSerializable resourceTypes; + + /* + * Localized name of the azure service. + */ + private String displayName; + + /* + * Azure resource Id of the service. + */ + private String serviceId; + + /** + * Creates an instance of ServiceClassificationAnswer class. + */ + private ServiceClassificationAnswer() { + } + + /** + * Get the childService property: Child service. + * + * @return the childService value. + */ + public ClassificationService childService() { + return this.childService; + } + + /** + * Get the resourceTypes property: List of applicable ARM resource types for this service. + * + * @return the resourceTypes value. + */ + @Override + public List resourceTypes() { + return this.resourceTypes; + } + + /** + * Get the displayName property: Localized name of the azure service. + * + * @return the displayName value. + */ + @Override + public String displayName() { + return this.displayName; + } + + /** + * Get the serviceId property: Azure resource Id of the service. + * + * @return the serviceId value. + */ + @Override + public String serviceId() { + return this.serviceId; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("resourceTypes", resourceTypes(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("childService", this.childService); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceClassificationAnswer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceClassificationAnswer if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceClassificationAnswer. + */ + public static ServiceClassificationAnswer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceClassificationAnswer deserializedServiceClassificationAnswer = new ServiceClassificationAnswer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceId".equals(fieldName)) { + deserializedServiceClassificationAnswer.serviceId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedServiceClassificationAnswer.displayName = reader.getString(); + } else if ("resourceTypes".equals(fieldName)) { + List resourceTypes = reader.readArray(reader1 -> reader1.getString()); + deserializedServiceClassificationAnswer.resourceTypes = resourceTypes; + } else if ("childService".equals(fieldName)) { + deserializedServiceClassificationAnswer.childService = ClassificationService.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceClassificationAnswer; + }); + } +} 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 new file mode 100644 index 000000000000..f9e423fa44fb --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationOutput.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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 new file mode 100644 index 000000000000..46a6895b7ac2 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationRequest.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Input to problem classification Classification API. + */ +@Fluent +public final class ServiceClassificationRequest implements JsonSerializable { + /* + * Natural language description of the customer’s issue. + */ + private String issueSummary; + + /* + * ARM resource Id of the resource that is having the issue. + */ + private String resourceId; + + /* + * Additional information in the form of a string. + */ + 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; + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("issueSummary", this.issueSummary); + jsonWriter.writeStringField("resourceId", this.resourceId); + jsonWriter.writeStringField("additionalContext", this.additionalContext); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceClassificationRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceClassificationRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ServiceClassificationRequest. + */ + public static ServiceClassificationRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceClassificationRequest deserializedServiceClassificationRequest = new ServiceClassificationRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueSummary".equals(fieldName)) { + deserializedServiceClassificationRequest.issueSummary = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedServiceClassificationRequest.resourceId = reader.getString(); + } else if ("additionalContext".equals(fieldName)) { + deserializedServiceClassificationRequest.additionalContext = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceClassificationRequest; + }); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceLevelAgreement.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceLevelAgreement.java index e389409328cb..ed039e2c5ee0 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceLevelAgreement.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/ServiceLevelAgreement.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -66,14 +66,6 @@ public Integer slaMinutes() { return this.slaMinutes; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 efb6616dc3b5..23c3a2f272fa 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -12,6 +12,29 @@ * Resource collection API of Services. */ public interface Services { + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific Azure service for support ticket creation along with {@link Response}. + */ + Response getWithResponse(String serviceName, Context context); + + /** + * Gets a specific Azure service for support ticket creation. + * + * @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. + * @return a specific Azure service for support ticket creation. + */ + Service get(String serviceName); + /** * Lists all the Azure services available for support ticket creation. For **Technical** issues, select the Service * Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's @@ -41,27 +64,4 @@ public interface Services { * @return collection of Service resources as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); - - /** - * Gets a specific Azure service for support ticket creation. - * - * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Azure service for support ticket creation along with {@link Response}. - */ - Response getWithResponse(String serviceName, Context context); - - /** - * Gets a specific Azure service for support ticket creation. - * - * @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. - * @return a specific Azure service for support ticket creation. - */ - Service get(String serviceName); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SeverityLevel.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SeverityLevel.java index e1770dc77a6e..18afcbf3ffbb 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SeverityLevel.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SeverityLevel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Status.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Status.java index deb49b9f0829..43956bc40f61 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Status.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Status.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportChannel.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportChannel.java new file mode 100644 index 000000000000..a220afe69068 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportChannel.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Support channel type for the support ticket. + */ +public final class SupportChannel extends ExpandableStringEnum { + /** + * Chat support channel. + */ + public static final SupportChannel CHAT = fromString("Chat"); + + /** + * Web support channel. + */ + public static final SupportChannel WEB = fromString("Web"); + + /** + * Creates a new instance of SupportChannel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public SupportChannel() { + } + + /** + * Creates or finds a SupportChannel from its string representation. + * + * @param name a name to look for. + * @return the corresponding SupportChannel. + */ + public static SupportChannel fromString(String name) { + return fromString(name, SupportChannel.class); + } + + /** + * Gets known SupportChannel values. + * + * @return known SupportChannel values. + */ + public static Collection values() { + return values(SupportChannel.class); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportEngineer.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportEngineer.java index ace1a582585b..ce33cfc847cf 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportEngineer.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportEngineer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -36,14 +36,6 @@ public String emailAddress() { return this.emailAddress; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 a6a51f34692f..51c6acb8ad3d 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 @@ -1,9 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; import java.time.OffsetDateTime; @@ -34,6 +35,13 @@ public interface SupportTicketDetails { */ String type(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the supportTicketId property: System generated support ticket Id that is unique. * @@ -229,6 +237,34 @@ public interface SupportTicketDetails { */ List secondaryConsent(); + /** + * Gets the directConnectEscalation property: Direct Connect Escalation details for a support ticket. + * + * @return the directConnectEscalation value. + */ + DirectConnectEscalation directConnectEscalation(); + + /** + * Gets the communityForumPost property: Contains a link to the post on the community forum. + * + * @return the communityForumPost value. + */ + String communityForumPost(); + + /** + * Gets the supportChannel property: Support channel type for the support ticket. + * + * @return the supportChannel value. + */ + SupportChannel supportChannel(); + + /** + * Gets the chatConversationStatus property: Status of the chat conversation associated with the support ticket. + * + * @return the chatConversationStatus value. + */ + ChatConversationStatus chatConversationStatus(); + /** * Gets the inner com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner object. * @@ -368,7 +404,8 @@ interface WithCreate extends DefinitionStages.WithSupportTicketId, DefinitionSta DefinitionStages.WithSupportPlanId, DefinitionStages.WithServiceLevelAgreement, DefinitionStages.WithSupportEngineer, DefinitionStages.WithProblemStartTime, DefinitionStages.WithFileWorkspaceName, DefinitionStages.WithTechnicalTicketDetails, - DefinitionStages.WithQuotaTicketDetails, DefinitionStages.WithSecondaryConsent { + DefinitionStages.WithQuotaTicketDetails, DefinitionStages.WithSecondaryConsent, + DefinitionStages.WithDirectConnectEscalation, DefinitionStages.WithCommunityForumPost { /** * Executes the create request. * @@ -547,6 +584,32 @@ interface WithSecondaryConsent { */ WithCreate withSecondaryConsent(List secondaryConsent); } + + /** + * The stage of the SupportTicketDetails definition allowing to specify directConnectEscalation. + */ + interface WithDirectConnectEscalation { + /** + * Specifies the directConnectEscalation property: Direct Connect Escalation details for a support ticket.. + * + * @param directConnectEscalation Direct Connect Escalation details for a support ticket. + * @return the next definition stage. + */ + WithCreate withDirectConnectEscalation(DirectConnectEscalation directConnectEscalation); + } + + /** + * The stage of the SupportTicketDetails definition allowing to specify communityForumPost. + */ + interface WithCommunityForumPost { + /** + * Specifies the communityForumPost property: Contains a link to the post on the community forum.. + * + * @param communityForumPost Contains a link to the post on the community forum. + * @return the next definition stage. + */ + WithCreate withCommunityForumPost(String communityForumPost); + } } /** @@ -560,7 +623,8 @@ interface WithSecondaryConsent { * The template for SupportTicketDetails update. */ interface Update extends UpdateStages.WithSeverity, UpdateStages.WithStatus, UpdateStages.WithContactDetails, - UpdateStages.WithAdvancedDiagnosticConsent, UpdateStages.WithSecondaryConsent { + UpdateStages.WithAdvancedDiagnosticConsent, UpdateStages.WithSecondaryConsent, + UpdateStages.WithDirectConnectEscalation { /** * Executes the update request. * @@ -647,6 +711,19 @@ interface WithSecondaryConsent { */ Update withSecondaryConsent(List secondaryConsent); } + + /** + * The stage of the SupportTicketDetails update allowing to specify directConnectEscalation. + */ + interface WithDirectConnectEscalation { + /** + * Specifies the directConnectEscalation property: Direct Connect Escalation details for a support ticket.. + * + * @param directConnectEscalation Direct Connect Escalation details for a support ticket. + * @return the next definition stage. + */ + Update withDirectConnectEscalation(DirectConnectEscalation directConnectEscalation); + } } /** diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTickets.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTickets.java index 7f212da21523..f56124d576ce 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTickets.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTickets.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -13,30 +13,29 @@ */ public interface SupportTickets { /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket + * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return ticket details for an Azure subscription along with {@link Response}. */ - Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + Response getWithResponse(String supportTicketName, Context context); /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket + * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. + * @return ticket details for an Azure subscription. */ - CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); + SupportTicketDetails get(String supportTicketName); /** * Lists all the support tickets for an Azure subscription. You can also filter the support tickets by _Status_, @@ -47,8 +46,7 @@ public interface SupportTickets { * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -69,35 +67,59 @@ public interface SupportTickets { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ PagedIterable list(Integer top, String filter, Context context); /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * This operation fetches ARM resource id of support resource type. * - * @param supportTicketName Support ticket name. + * @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 ticket details for an Azure subscription along with {@link Response}. + * @return the look up resource id response along with {@link Response}. */ - Response getWithResponse(String supportTicketName, Context context); + Response lookUpResourceIdWithResponse(LookUpResourceIdRequest lookUpResourceIdRequest, + Context context); /** - * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket - * creation. If a ticket was created more than 18 months ago, a request for data might cause an error. + * This operation fetches ARM resource id of support resource type. * - * @param supportTicketName Support ticket name. + * @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 ticket details for an Azure subscription. + * @return the look up resource id response. */ - SupportTicketDetails get(String supportTicketName); + LookUpResourceIdResponse lookUpResourceId(LookUpResourceIdRequest lookUpResourceIdRequest); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API along with {@link Response}. + */ + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API. + */ + CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); /** * Get ticket details for an Azure subscription. Support ticket data is available for 18 months after ticket diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsNoSubscriptions.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsNoSubscriptions.java index 81128873b49f..ba2d5b0478c2 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsNoSubscriptions.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/SupportTicketsNoSubscriptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -14,94 +14,73 @@ */ public interface SupportTicketsNoSubscriptions { /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. + * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API along with {@link Response}. + * @return details for a specific support ticket along with {@link Response}. */ - Response - checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + Response getWithResponse(String supportTicketName, Context context); /** - * Check the availability of a resource name. This API should be used to check the uniqueness of the name for - * support ticket creation for the selected subscription. + * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. + * If a ticket was created more than 18 months ago, a request for data might cause an error. * - * @param checkNameAvailabilityInput Input to check. + * @param supportTicketName The name of the SupportTicketDetails. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return output of check name availability API. - */ - CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); - - /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. + * @return details for a specific support ticket. */ - PagedIterable list(); + SupportTicketDetails get(String supportTicketName); /** - * Lists all the support tickets. <br/><br/>You can also filter the support tickets by - * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with - * <i>nextLink</i>, using which you can retrieve the next set of support tickets. - * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was - * created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param top The number of values to return in the collection. Default is 25 and max is 100. - * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a - * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> - * <br/><i>Status</i> , <i>ServiceId</i>, and - * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For - * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, - * combine them using the logical 'AND'. - * @param context The context to associate with this operation. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents a collection of SupportTicket resources as paginated response with - * {@link PagedIterable}. + * @return object that represents SupportTicketDetails resource. */ - PagedIterable list(Integer top, String filter, Context context); + SupportTicketDetails create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters); /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. + * Creates a new support ticket for Billing, and Subscription Management issues. Learn the + * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call + * the Services and ProblemClassifications API to get the most recent set of services and problem categories + * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the + * API. To add a file to an existing support ticket, visit the [Manage support + * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in + * the Azure portal, select the support ticket, and use the file upload control to add a new + * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not + * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if + * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. + * @param createSupportTicketParameters Support ticket request payload. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket along with {@link Response}. - */ - Response getWithResponse(String supportTicketName, Context context); - - /** - * Gets details for a specific support ticket. Support ticket data is available for 18 months after ticket creation. - * If a ticket was created more than 18 months ago, a request for data might cause an error. - * - * @param supportTicketName Support ticket name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return details for a specific support ticket. + * @return object that represents SupportTicketDetails resource. */ - SupportTicketDetails get(String supportTicketName); + SupportTicketDetails create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, + Context context); /** * This API allows you to update the severity level, ticket status, and your contact information in the support @@ -109,7 +88,7 @@ public interface SupportTicketsNoSubscriptions { * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity * update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,7 +105,7 @@ Response updateWithResponse(String supportTicketName, Upda * worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity * update by adding a new communication using the Communications API. * - * @param supportTicketName Support ticket name. + * @param supportTicketName The name of the SupportTicketDetails. * @param updateSupportTicket UpdateSupportTicket object. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -136,46 +115,65 @@ Response updateWithResponse(String supportTicketName, Upda SupportTicketDetails update(String supportTicketName, UpdateSupportTicket updateSupportTicket); /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. + */ + PagedIterable list(); + + /** + * Lists all the support tickets. <br/><br/>You can also filter the support tickets by + * <i>Status</i>, <i>CreatedDate</i>, , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> using the $filter parameter. Output will be a paged result with + * <i>nextLink</i>, using which you can retrieve the next set of support tickets. + * <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was + * created more than 18 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a + * target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> + * <br/><i>Status</i> , <i>ServiceId</i>, and + * <i>ProblemClassificationId</i> filters can only be used with 'eq' operator. For + * <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, + * combine them using the logical 'AND'. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return object that represents SupportTicketDetails resource. + * @return [Placeholder] Description for page model as paginated response with {@link PagedIterable}. */ - SupportTicketDetails create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters); + PagedIterable list(Integer top, String filter, Context context); /** - * Creates a new support ticket for Billing, and Subscription Management issues. Learn the - * [prerequisites](https://aka.ms/supportAPI) required to create a support ticket.<br/><br/>Always call - * the Services and ProblemClassifications API to get the most recent set of services and problem categories - * required for support ticket creation.<br/><br/>Adding attachments is not currently supported via the - * API. To add a file to an existing support ticket, visit the [Manage support - * ticket](https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest) page in - * the Azure portal, select the support ticket, and use the file upload control to add a new - * file.<br/><br/>Providing consent to share diagnostic information with Azure support is currently not - * supported via the API. The Azure support engineer working on your ticket will reach out to you for consent if - * your issue requires gathering diagnostic information from your Azure resources.<br/><br/>. + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. * - * @param supportTicketName Support ticket name. - * @param createSupportTicketParameters Support ticket request payload. + * @param checkNameAvailabilityInput The 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 object that represents SupportTicketDetails resource. + * @return output of check name availability API along with {@link Response}. */ - SupportTicketDetails create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, - Context context); + Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); + + /** + * Check the availability of a resource name. This API should be used to check the uniqueness of the name for + * support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput The 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 output of check name availability API. + */ + CheckNameAvailabilityOutput checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput); } 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 e178b6e51b64..a1eaca9815de 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -50,14 +50,6 @@ public TechnicalTicketDetails withResourceId(String resourceId) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TranscriptContentType.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TranscriptContentType.java deleted file mode 100644 index d859320cc4d6..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/TranscriptContentType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Content type. - */ -public final class TranscriptContentType extends ExpandableStringEnum { - /** - * Creates a new instance of TranscriptContentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TranscriptContentType() { - } - - /** - * Creates or finds a TranscriptContentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding TranscriptContentType. - */ - public static TranscriptContentType fromString(String name) { - return fromString(name, TranscriptContentType.class); - } - - /** - * Gets known TranscriptContentType values. - * - * @return known TranscriptContentType values. - */ - public static Collection values() { - return values(TranscriptContentType.class); - } -} diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Type.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Type.java index bbe10e7da464..06fed91826c6 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Type.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/Type.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; 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 a6ad1e708483..e7f1a1515646 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -43,7 +43,8 @@ public final class UpdateContactProfile implements JsonSerializable additionalEmailAddresses; /* - * Phone number. This is required if preferred contact method is phone. + * Phone number. This is required if preferred contact method is phone. It is also required when submitting + * 'critical' or 'highestcriticalimpact' severity cases. */ private String phoneNumber; @@ -177,7 +178,8 @@ public UpdateContactProfile withAdditionalEmailAddresses(List additional } /** - * Get the phoneNumber property: Phone number. This is required if preferred contact method is phone. + * Get the phoneNumber property: Phone number. This is required if preferred contact method is phone. It is also + * required when submitting 'critical' or 'highestcriticalimpact' severity cases. * * @return the phoneNumber value. */ @@ -186,7 +188,8 @@ public String phoneNumber() { } /** - * Set the phoneNumber property: Phone number. This is required if preferred contact method is phone. + * Set the phoneNumber property: Phone number. This is required if preferred contact method is phone. It is also + * required when submitting 'critical' or 'highestcriticalimpact' severity cases. * * @param phoneNumber the phoneNumber value to set. * @return the UpdateContactProfile object itself. @@ -268,14 +271,6 @@ public UpdateContactProfile withPreferredSupportLanguage(String preferredSupport return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ 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 8c44b40af1c4..bd03e8f52990 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -43,6 +43,11 @@ public final class UpdateSupportTicket implements JsonSerializable secondaryConsent; + /* + * Direct Connect Escalation details for a support ticket. + */ + private DirectConnectEscalation directConnectEscalation; + /** * Creates an instance of UpdateSupportTicket class. */ @@ -150,17 +155,23 @@ public UpdateSupportTicket withSecondaryConsent(List secondary } /** - * Validates the instance. + * Get the directConnectEscalation property: Direct Connect Escalation details for a support ticket. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (contactDetails() != null) { - contactDetails().validate(); - } - if (secondaryConsent() != null) { - secondaryConsent().forEach(e -> e.validate()); - } + * @return the directConnectEscalation value. + */ + public DirectConnectEscalation directConnectEscalation() { + return this.directConnectEscalation; + } + + /** + * Set the directConnectEscalation property: Direct Connect Escalation details for a support ticket. + * + * @param directConnectEscalation the directConnectEscalation value to set. + * @return the UpdateSupportTicket object itself. + */ + public UpdateSupportTicket withDirectConnectEscalation(DirectConnectEscalation directConnectEscalation) { + this.directConnectEscalation = directConnectEscalation; + return this; } /** @@ -176,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.advancedDiagnosticConsent == null ? null : this.advancedDiagnosticConsent.toString()); jsonWriter.writeArrayField("secondaryConsent", this.secondaryConsent, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("directConnectEscalation", this.directConnectEscalation); return jsonWriter.writeEndObject(); } @@ -206,6 +218,8 @@ public static UpdateSupportTicket fromJson(JsonReader jsonReader) throws IOExcep List secondaryConsent = reader.readArray(reader1 -> SecondaryConsent.fromJson(reader1)); deserializedUpdateSupportTicket.secondaryConsent = secondaryConsent; + } else if ("directConnectEscalation".equals(fieldName)) { + deserializedUpdateSupportTicket.directConnectEscalation = DirectConnectEscalation.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UploadFile.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UploadFile.java index 241abc4ca01e..44e00c145065 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UploadFile.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UploadFile.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; @@ -72,14 +72,6 @@ public UploadFile withChunkIndex(Integer chunkIndex) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - /** * {@inheritDoc} */ diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UserConsent.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UserConsent.java index 5c3cd9225c45..3d85fb7f5c7a 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UserConsent.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/UserConsent.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/package-info.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/package-info.java index fc4305c8130d..39289b29280f 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/package-info.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for MicrosoftSupport. + * Package containing the data models for Support. * Microsoft Azure Support Resource Provider. */ package com.azure.resourcemanager.support.models; diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/package-info.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/package-info.java index 5bf37c3b2066..6cd8e0a4e81c 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/package-info.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for MicrosoftSupport. + * Package containing the classes for Support. * Microsoft Azure Support Resource Provider. */ package com.azure.resourcemanager.support; 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 17db9ab9621e..9e900ea271c6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.support { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.support.fluent.models to com.azure.core; opens com.azure.resourcemanager.support.models to com.azure.core; + opens com.azure.resourcemanager.support.implementation.models to com.azure.core; } diff --git a/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/azure-resourcemanager-support_metadata.json b/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/azure-resourcemanager-support_metadata.json new file mode 100644 index 000000000000..4baa5d516fdd --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/resources/META-INF/azure-resourcemanager-support_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.Support":"2026-07-01"},"crossLanguagePackageId":"Microsoft.Support","crossLanguageVersion":"a59d2396bde2","crossLanguageDefinitions":{"com.azure.resourcemanager.support.fluent.ChatTranscriptsClient":"Microsoft.Support.ChatTranscripts","com.azure.resourcemanager.support.fluent.ChatTranscriptsClient.get":"Microsoft.Support.ChatTranscripts.get","com.azure.resourcemanager.support.fluent.ChatTranscriptsClient.getWithResponse":"Microsoft.Support.ChatTranscripts.get","com.azure.resourcemanager.support.fluent.ChatTranscriptsClient.list":"Microsoft.Support.ChatTranscripts.list","com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient":"Microsoft.Support.ChatTranscriptsNoSubscription","com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient.get":"Microsoft.Support.ChatTranscriptsNoSubscription.get","com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient.getWithResponse":"Microsoft.Support.ChatTranscriptsNoSubscription.get","com.azure.resourcemanager.support.fluent.ChatTranscriptsNoSubscriptionsClient.list":"Microsoft.Support.ChatTranscriptsNoSubscription.list","com.azure.resourcemanager.support.fluent.ClassifyProblemsClient":"Microsoft.Support.ClassifyProblems","com.azure.resourcemanager.support.fluent.ClassifyProblemsClient.classifyProblems":"Microsoft.Support.ClassifyProblems.classifyProblems","com.azure.resourcemanager.support.fluent.ClassifyProblemsClient.classifyProblemsWithResponse":"Microsoft.Support.ClassifyProblems.classifyProblems","com.azure.resourcemanager.support.fluent.ClassifyProblemsNoSubscriptionsClient":"Microsoft.Support.ClassifyProblemsNoSubscription","com.azure.resourcemanager.support.fluent.ClassifyProblemsNoSubscriptionsClient.classifyProblems":"Microsoft.Support.ClassifyProblemsNoSubscription.classifyProblems","com.azure.resourcemanager.support.fluent.ClassifyProblemsNoSubscriptionsClient.classifyProblemsWithResponse":"Microsoft.Support.ClassifyProblemsNoSubscription.classifyProblems","com.azure.resourcemanager.support.fluent.ClassifyServicesClient":"Microsoft.Support.ClassifyServices","com.azure.resourcemanager.support.fluent.ClassifyServicesClient.classifyServices":"Microsoft.Support.ClassifyServices.classifyServices","com.azure.resourcemanager.support.fluent.ClassifyServicesClient.classifyServicesWithResponse":"Microsoft.Support.ClassifyServices.classifyServices","com.azure.resourcemanager.support.fluent.ClassifyServicesNoSubscriptionsClient":"Microsoft.Support.ClassifyServicesNoSubscription","com.azure.resourcemanager.support.fluent.ClassifyServicesNoSubscriptionsClient.classifyServices":"Microsoft.Support.ClassifyServicesNoSubscription.classifyServices","com.azure.resourcemanager.support.fluent.ClassifyServicesNoSubscriptionsClient.classifyServicesWithResponse":"Microsoft.Support.ClassifyServicesNoSubscription.classifyServices","com.azure.resourcemanager.support.fluent.CommunicationsClient":"Microsoft.Support.Communications","com.azure.resourcemanager.support.fluent.CommunicationsClient.beginCreate":"Microsoft.Support.Communications.create","com.azure.resourcemanager.support.fluent.CommunicationsClient.checkNameAvailability":"Microsoft.Support.SupportTickets.checkNameAvailability","com.azure.resourcemanager.support.fluent.CommunicationsClient.checkNameAvailabilityWithResponse":"Microsoft.Support.SupportTickets.checkNameAvailability","com.azure.resourcemanager.support.fluent.CommunicationsClient.create":"Microsoft.Support.Communications.create","com.azure.resourcemanager.support.fluent.CommunicationsClient.get":"Microsoft.Support.Communications.get","com.azure.resourcemanager.support.fluent.CommunicationsClient.getWithResponse":"Microsoft.Support.Communications.get","com.azure.resourcemanager.support.fluent.CommunicationsClient.list":"Microsoft.Support.Communications.list","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient":"Microsoft.Support.CommunicationsNoSubscription","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.beginCreate":"Microsoft.Support.CommunicationsNoSubscription.create","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.checkNameAvailability":"Microsoft.Support.SupportTicketsNoSubscription.checkNameAvailability","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.checkNameAvailabilityWithResponse":"Microsoft.Support.SupportTicketsNoSubscription.checkNameAvailability","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.create":"Microsoft.Support.CommunicationsNoSubscription.create","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.get":"Microsoft.Support.CommunicationsNoSubscription.get","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.getWithResponse":"Microsoft.Support.CommunicationsNoSubscription.get","com.azure.resourcemanager.support.fluent.CommunicationsNoSubscriptionsClient.list":"Microsoft.Support.CommunicationsNoSubscription.list","com.azure.resourcemanager.support.fluent.FileWorkspacesClient":"Microsoft.Support.FileWorkspaces","com.azure.resourcemanager.support.fluent.FileWorkspacesClient.create":"Microsoft.Support.FileWorkspaces.create","com.azure.resourcemanager.support.fluent.FileWorkspacesClient.createWithResponse":"Microsoft.Support.FileWorkspaces.create","com.azure.resourcemanager.support.fluent.FileWorkspacesClient.get":"Microsoft.Support.FileWorkspaces.get","com.azure.resourcemanager.support.fluent.FileWorkspacesClient.getWithResponse":"Microsoft.Support.FileWorkspaces.get","com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient":"Microsoft.Support.FileWorkspacesNoSubscription","com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient.create":"Microsoft.Support.FileWorkspacesNoSubscription.create","com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient.createWithResponse":"Microsoft.Support.FileWorkspacesNoSubscription.create","com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient.get":"Microsoft.Support.FileWorkspacesNoSubscription.get","com.azure.resourcemanager.support.fluent.FileWorkspacesNoSubscriptionsClient.getWithResponse":"Microsoft.Support.FileWorkspacesNoSubscription.get","com.azure.resourcemanager.support.fluent.FilesClient":"Microsoft.Support.Files","com.azure.resourcemanager.support.fluent.FilesClient.create":"Microsoft.Support.Files.create","com.azure.resourcemanager.support.fluent.FilesClient.createWithResponse":"Microsoft.Support.Files.create","com.azure.resourcemanager.support.fluent.FilesClient.get":"Microsoft.Support.Files.get","com.azure.resourcemanager.support.fluent.FilesClient.getWithResponse":"Microsoft.Support.Files.get","com.azure.resourcemanager.support.fluent.FilesClient.list":"Microsoft.Support.Files.list","com.azure.resourcemanager.support.fluent.FilesClient.upload":"Microsoft.Support.Files.upload","com.azure.resourcemanager.support.fluent.FilesClient.uploadWithResponse":"Microsoft.Support.Files.upload","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient":"Microsoft.Support.FilesNoSubscription","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.create":"Microsoft.Support.FilesNoSubscription.create","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.createWithResponse":"Microsoft.Support.FilesNoSubscription.create","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.get":"Microsoft.Support.FilesNoSubscription.get","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.getWithResponse":"Microsoft.Support.FilesNoSubscription.get","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.list":"Microsoft.Support.FilesNoSubscription.list","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.upload":"Microsoft.Support.FilesNoSubscription.upload","com.azure.resourcemanager.support.fluent.FilesNoSubscriptionsClient.uploadWithResponse":"Microsoft.Support.FilesNoSubscription.upload","com.azure.resourcemanager.support.fluent.OperationsClient":"Microsoft.Support.Operations","com.azure.resourcemanager.support.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.support.fluent.ProblemClassificationsClient":"Microsoft.Support.ProblemClassifications","com.azure.resourcemanager.support.fluent.ProblemClassificationsClient.get":"Microsoft.Support.ProblemClassifications.get","com.azure.resourcemanager.support.fluent.ProblemClassificationsClient.getWithResponse":"Microsoft.Support.ProblemClassifications.get","com.azure.resourcemanager.support.fluent.ProblemClassificationsClient.list":"Microsoft.Support.ProblemClassifications.list","com.azure.resourcemanager.support.fluent.ServicesClient":"Microsoft.Support.Services","com.azure.resourcemanager.support.fluent.ServicesClient.get":"Microsoft.Support.Services.get","com.azure.resourcemanager.support.fluent.ServicesClient.getWithResponse":"Microsoft.Support.Services.get","com.azure.resourcemanager.support.fluent.ServicesClient.list":"Microsoft.Support.Services.list","com.azure.resourcemanager.support.fluent.SupportManagementClient":"Microsoft.Support","com.azure.resourcemanager.support.fluent.SupportTicketsClient":"Microsoft.Support.SupportTickets","com.azure.resourcemanager.support.fluent.SupportTicketsClient.beginCreate":"Microsoft.Support.SupportTickets.create","com.azure.resourcemanager.support.fluent.SupportTicketsClient.checkNameAvailability":"Microsoft.Support.SupportTicketsOperationGroup.checkNameAvailability","com.azure.resourcemanager.support.fluent.SupportTicketsClient.checkNameAvailabilityWithResponse":"Microsoft.Support.SupportTicketsOperationGroup.checkNameAvailability","com.azure.resourcemanager.support.fluent.SupportTicketsClient.create":"Microsoft.Support.SupportTickets.create","com.azure.resourcemanager.support.fluent.SupportTicketsClient.get":"Microsoft.Support.SupportTickets.get","com.azure.resourcemanager.support.fluent.SupportTicketsClient.getWithResponse":"Microsoft.Support.SupportTickets.get","com.azure.resourcemanager.support.fluent.SupportTicketsClient.list":"Microsoft.Support.SupportTickets.list","com.azure.resourcemanager.support.fluent.SupportTicketsClient.lookUpResourceId":"Microsoft.Support.SupportTickets.lookUpResourceId","com.azure.resourcemanager.support.fluent.SupportTicketsClient.lookUpResourceIdWithResponse":"Microsoft.Support.SupportTickets.lookUpResourceId","com.azure.resourcemanager.support.fluent.SupportTicketsClient.update":"Microsoft.Support.SupportTickets.update","com.azure.resourcemanager.support.fluent.SupportTicketsClient.updateWithResponse":"Microsoft.Support.SupportTickets.update","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient":"Microsoft.Support.SupportTicketsNoSubscription","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.beginCreate":"Microsoft.Support.SupportTicketsNoSubscription.create","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.checkNameAvailability":"Microsoft.Support.SupportTicketsNoSubscriptionOperationGroup.checkNameAvailability","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.checkNameAvailabilityWithResponse":"Microsoft.Support.SupportTicketsNoSubscriptionOperationGroup.checkNameAvailability","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.create":"Microsoft.Support.SupportTicketsNoSubscription.create","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.get":"Microsoft.Support.SupportTicketsNoSubscription.get","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.getWithResponse":"Microsoft.Support.SupportTicketsNoSubscription.get","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.list":"Microsoft.Support.SupportTicketsNoSubscription.list","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.update":"Microsoft.Support.SupportTicketsNoSubscription.update","com.azure.resourcemanager.support.fluent.SupportTicketsNoSubscriptionsClient.updateWithResponse":"Microsoft.Support.SupportTicketsNoSubscription.update","com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsInner":"Microsoft.Support.ChatTranscriptDetails","com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsProperties":"Microsoft.Support.ChatTranscriptDetailsProperties","com.azure.resourcemanager.support.fluent.models.CheckNameAvailabilityOutputInner":"Microsoft.Support.CheckNameAvailabilityOutput","com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner":"Microsoft.Support.CommunicationDetails","com.azure.resourcemanager.support.fluent.models.CommunicationDetailsProperties":"Microsoft.Support.CommunicationDetailsProperties","com.azure.resourcemanager.support.fluent.models.FileDetailsInner":"Microsoft.Support.FileDetails","com.azure.resourcemanager.support.fluent.models.FileDetailsProperties":"Microsoft.Support.FileDetailsProperties","com.azure.resourcemanager.support.fluent.models.FileWorkspaceDetailsInner":"Microsoft.Support.FileWorkspaceDetails","com.azure.resourcemanager.support.fluent.models.FileWorkspaceDetailsProperties":"Microsoft.Support.FileWorkspaceDetailsProperties","com.azure.resourcemanager.support.fluent.models.LookUpResourceIdResponseInner":"Microsoft.Support.LookUpResourceIdResponse","com.azure.resourcemanager.support.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner":"Microsoft.Support.ProblemClassification","com.azure.resourcemanager.support.fluent.models.ProblemClassificationProperties":"Microsoft.Support.ProblemClassificationProperties","com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner":"Microsoft.Support.ProblemClassificationsClassificationOutput","com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner":"Microsoft.Support.ServiceClassificationOutput","com.azure.resourcemanager.support.fluent.models.ServiceInner":"Microsoft.Support.Service","com.azure.resourcemanager.support.fluent.models.ServiceProperties":"Microsoft.Support.ServiceProperties","com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner":"Microsoft.Support.SupportTicketDetails","com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsProperties":"Microsoft.Support.SupportTicketDetailsProperties","com.azure.resourcemanager.support.implementation.SupportManagementClientBuilder":"Microsoft.Support","com.azure.resourcemanager.support.implementation.models.ChatTranscriptsListResult":"Microsoft.Support.ChatTranscriptsListResult","com.azure.resourcemanager.support.implementation.models.CommunicationsListResult":"Microsoft.Support.CommunicationsListResult","com.azure.resourcemanager.support.implementation.models.FilesListResult":"Microsoft.Support.FilesListResult","com.azure.resourcemanager.support.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.support.implementation.models.ProblemClassificationsListResult":"Microsoft.Support.ProblemClassificationsListResult","com.azure.resourcemanager.support.implementation.models.ServicesListResult":"Microsoft.Support.ServicesListResult","com.azure.resourcemanager.support.implementation.models.SupportTicketsListResult":"Microsoft.Support.SupportTicketsListResult","com.azure.resourcemanager.support.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.support.models.ChatConversationStatus":"Microsoft.Support.ChatConversationStatus","com.azure.resourcemanager.support.models.CheckNameAvailabilityInput":"Microsoft.Support.CheckNameAvailabilityInput","com.azure.resourcemanager.support.models.ClassificationService":"Microsoft.Support.ClassificationService","com.azure.resourcemanager.support.models.CommunicationDirection":"Microsoft.Support.CommunicationDirection","com.azure.resourcemanager.support.models.CommunicationType":"Microsoft.Support.CommunicationType","com.azure.resourcemanager.support.models.Consent":"Microsoft.Support.Consent","com.azure.resourcemanager.support.models.ContactProfile":"Microsoft.Support.ContactProfile","com.azure.resourcemanager.support.models.DirectConnectEscalation":"Microsoft.Support.DirectConnectEscalation","com.azure.resourcemanager.support.models.EscalationStatus":"Microsoft.Support.EscalationStatus","com.azure.resourcemanager.support.models.IsTemporaryTicket":"Microsoft.Support.IsTemporaryTicket","com.azure.resourcemanager.support.models.LookUpResourceIdRequest":"Microsoft.Support.LookUpResourceIdRequest","com.azure.resourcemanager.support.models.LookUpResourceIdRequestType":null,"com.azure.resourcemanager.support.models.MessageProperties":"Microsoft.Support.MessageProperties","com.azure.resourcemanager.support.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.support.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.support.models.PreferredContactMethod":"Microsoft.Support.PreferredContactMethod","com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput":"Microsoft.Support.ProblemClassificationsClassificationInput","com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult":"Microsoft.Support.ProblemClassificationsClassificationResult","com.azure.resourcemanager.support.models.QuotaChangeRequest":"Microsoft.Support.QuotaChangeRequest","com.azure.resourcemanager.support.models.QuotaTicketDetails":"Microsoft.Support.QuotaTicketDetails","com.azure.resourcemanager.support.models.SecondaryConsent":"Microsoft.Support.SecondaryConsent","com.azure.resourcemanager.support.models.SecondaryConsentEnabled":"Microsoft.Support.SecondaryConsentEnabled","com.azure.resourcemanager.support.models.ServiceClassificationAnswer":"Microsoft.Support.ServiceClassificationAnswer","com.azure.resourcemanager.support.models.ServiceClassificationRequest":"Microsoft.Support.ServiceClassificationRequest","com.azure.resourcemanager.support.models.ServiceLevelAgreement":"Microsoft.Support.ServiceLevelAgreement","com.azure.resourcemanager.support.models.SeverityLevel":"Microsoft.Support.SeverityLevel","com.azure.resourcemanager.support.models.Status":"Microsoft.Support.Status","com.azure.resourcemanager.support.models.SupportChannel":"Microsoft.Support.SupportChannel","com.azure.resourcemanager.support.models.SupportEngineer":"Microsoft.Support.SupportEngineer","com.azure.resourcemanager.support.models.TechnicalTicketDetails":"Microsoft.Support.TechnicalTicketDetails","com.azure.resourcemanager.support.models.Type":"Microsoft.Support.Type","com.azure.resourcemanager.support.models.UpdateContactProfile":"Microsoft.Support.UpdateContactProfile","com.azure.resourcemanager.support.models.UpdateSupportTicket":"Microsoft.Support.UpdateSupportTicket","com.azure.resourcemanager.support.models.UploadFile":"Microsoft.Support.UploadFile","com.azure.resourcemanager.support.models.UserConsent":"Microsoft.Support.UserConsent"},"generatedFiles":["src/main/java/com/azure/resourcemanager/support/SupportManager.java","src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ChatTranscriptsNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ClassifyProblemsNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ClassifyServicesClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ClassifyServicesNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/CommunicationsNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesClient.java","src/main/java/com/azure/resourcemanager/support/fluent/FileWorkspacesNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/FilesClient.java","src/main/java/com/azure/resourcemanager/support/fluent/FilesNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ProblemClassificationsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/ServicesClient.java","src/main/java/com/azure/resourcemanager/support/fluent/SupportManagementClient.java","src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/SupportTicketsNoSubscriptionsClient.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ChatTranscriptDetailsProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/CheckNameAvailabilityOutputInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/FileDetailsProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/FileWorkspaceDetailsProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/LookUpResourceIdResponseInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationsClassificationOutputInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceClassificationOutputInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsInner.java","src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsProperties.java","src/main/java/com/azure/resourcemanager/support/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/support/fluent/package-info.java","src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptDetailsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ChatTranscriptsNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/CheckNameAvailabilityOutputImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyProblemsNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ClassifyServicesNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/CommunicationDetailsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/CommunicationsNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FileDetailsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspaceDetailsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FileWorkspacesNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FilesClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FilesImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/FilesNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/LookUpResourceIdResponseImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClassificationOutputImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ProblemClassificationsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/support/implementation/ServiceClassificationOutputImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ServiceImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ServicesClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/ServicesImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportManagementClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketDetailsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsClientImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/SupportTicketsNoSubscriptionsImpl.java","src/main/java/com/azure/resourcemanager/support/implementation/models/ChatTranscriptsListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/models/CommunicationsListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/models/FilesListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/models/ProblemClassificationsListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/models/ServicesListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/models/SupportTicketsListResult.java","src/main/java/com/azure/resourcemanager/support/implementation/package-info.java","src/main/java/com/azure/resourcemanager/support/models/ActionType.java","src/main/java/com/azure/resourcemanager/support/models/ChatConversationStatus.java","src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptDetails.java","src/main/java/com/azure/resourcemanager/support/models/ChatTranscripts.java","src/main/java/com/azure/resourcemanager/support/models/ChatTranscriptsNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityInput.java","src/main/java/com/azure/resourcemanager/support/models/CheckNameAvailabilityOutput.java","src/main/java/com/azure/resourcemanager/support/models/ClassificationService.java","src/main/java/com/azure/resourcemanager/support/models/ClassifyProblems.java","src/main/java/com/azure/resourcemanager/support/models/ClassifyProblemsNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/ClassifyServices.java","src/main/java/com/azure/resourcemanager/support/models/ClassifyServicesNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/CommunicationDetails.java","src/main/java/com/azure/resourcemanager/support/models/CommunicationDirection.java","src/main/java/com/azure/resourcemanager/support/models/CommunicationType.java","src/main/java/com/azure/resourcemanager/support/models/Communications.java","src/main/java/com/azure/resourcemanager/support/models/CommunicationsNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/Consent.java","src/main/java/com/azure/resourcemanager/support/models/ContactProfile.java","src/main/java/com/azure/resourcemanager/support/models/DirectConnectEscalation.java","src/main/java/com/azure/resourcemanager/support/models/EscalationStatus.java","src/main/java/com/azure/resourcemanager/support/models/FileDetails.java","src/main/java/com/azure/resourcemanager/support/models/FileWorkspaceDetails.java","src/main/java/com/azure/resourcemanager/support/models/FileWorkspaces.java","src/main/java/com/azure/resourcemanager/support/models/FileWorkspacesNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/Files.java","src/main/java/com/azure/resourcemanager/support/models/FilesNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/IsTemporaryTicket.java","src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequest.java","src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdRequestType.java","src/main/java/com/azure/resourcemanager/support/models/LookUpResourceIdResponse.java","src/main/java/com/azure/resourcemanager/support/models/MessageProperties.java","src/main/java/com/azure/resourcemanager/support/models/Operation.java","src/main/java/com/azure/resourcemanager/support/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/support/models/Operations.java","src/main/java/com/azure/resourcemanager/support/models/Origin.java","src/main/java/com/azure/resourcemanager/support/models/PreferredContactMethod.java","src/main/java/com/azure/resourcemanager/support/models/ProblemClassification.java","src/main/java/com/azure/resourcemanager/support/models/ProblemClassifications.java","src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationInput.java","src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationOutput.java","src/main/java/com/azure/resourcemanager/support/models/ProblemClassificationsClassificationResult.java","src/main/java/com/azure/resourcemanager/support/models/QuotaChangeRequest.java","src/main/java/com/azure/resourcemanager/support/models/QuotaTicketDetails.java","src/main/java/com/azure/resourcemanager/support/models/SecondaryConsent.java","src/main/java/com/azure/resourcemanager/support/models/SecondaryConsentEnabled.java","src/main/java/com/azure/resourcemanager/support/models/Service.java","src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationAnswer.java","src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationOutput.java","src/main/java/com/azure/resourcemanager/support/models/ServiceClassificationRequest.java","src/main/java/com/azure/resourcemanager/support/models/ServiceLevelAgreement.java","src/main/java/com/azure/resourcemanager/support/models/Services.java","src/main/java/com/azure/resourcemanager/support/models/SeverityLevel.java","src/main/java/com/azure/resourcemanager/support/models/Status.java","src/main/java/com/azure/resourcemanager/support/models/SupportChannel.java","src/main/java/com/azure/resourcemanager/support/models/SupportEngineer.java","src/main/java/com/azure/resourcemanager/support/models/SupportTicketDetails.java","src/main/java/com/azure/resourcemanager/support/models/SupportTickets.java","src/main/java/com/azure/resourcemanager/support/models/SupportTicketsNoSubscriptions.java","src/main/java/com/azure/resourcemanager/support/models/TechnicalTicketDetails.java","src/main/java/com/azure/resourcemanager/support/models/Type.java","src/main/java/com/azure/resourcemanager/support/models/UpdateContactProfile.java","src/main/java/com/azure/resourcemanager/support/models/UpdateSupportTicket.java","src/main/java/com/azure/resourcemanager/support/models/UploadFile.java","src/main/java/com/azure/resourcemanager/support/models/UserConsent.java","src/main/java/com/azure/resourcemanager/support/models/package-info.java","src/main/java/com/azure/resourcemanager/support/package-info.java","src/main/java/module-info.java"]} \ 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 d3286c9251db..6c96ab007026 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.ChatTranscriptsClientImpl$ChatTranscriptsService"],["com.azure.resourcemanager.support.implementation.ChatTranscriptsNoSubscriptionsClientImpl$ChatTranscriptsNoSubscriptionsService"],["com.azure.resourcemanager.support.implementation.CommunicationsClientImpl$CommunicationsService"],["com.azure.resourcemanager.support.implementation.CommunicationsNoSubscriptionsClientImpl$CommunicationsNoSubscriptionsService"],["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.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.support.implementation.ProblemClassificationsClientImpl$ProblemClassificationsService"],["com.azure.resourcemanager.support.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.support.implementation.SupportTicketsClientImpl$SupportTicketsService"],["com.azure.resourcemanager.support.implementation.SupportTicketsNoSubscriptionsClientImpl$SupportTicketsNoSubscriptionsService"]] \ No newline at end of file +[["com.azure.resourcemanager.support.implementation.ChatTranscriptsClientImpl$ChatTranscriptsService"],["com.azure.resourcemanager.support.implementation.ChatTranscriptsNoSubscriptionsClientImpl$ChatTranscriptsNoSubscriptionsService"],["com.azure.resourcemanager.support.implementation.ClassifyProblemsClientImpl$ClassifyProblemsService"],["com.azure.resourcemanager.support.implementation.ClassifyProblemsNoSubscriptionsClientImpl$ClassifyProblemsNoSubscriptionsService"],["com.azure.resourcemanager.support.implementation.ClassifyServicesClientImpl$ClassifyServicesService"],["com.azure.resourcemanager.support.implementation.ClassifyServicesNoSubscriptionsClientImpl$ClassifyServicesNoSubscriptionsService"],["com.azure.resourcemanager.support.implementation.CommunicationsClientImpl$CommunicationsService"],["com.azure.resourcemanager.support.implementation.CommunicationsNoSubscriptionsClientImpl$CommunicationsNoSubscriptionsService"],["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.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.support.implementation.ProblemClassificationsClientImpl$ProblemClassificationsService"],["com.azure.resourcemanager.support.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.support.implementation.SupportTicketsClientImpl$SupportTicketsService"],["com.azure.resourcemanager.support.implementation.SupportTicketsNoSubscriptionsClientImpl$SupportTicketsNoSubscriptionsService"]] \ No newline at end of file diff --git a/sdk/support/azure-resourcemanager-support/src/main/resources/azure-resourcemanager-support.properties b/sdk/support/azure-resourcemanager-support/src/main/resources/azure-resourcemanager-support.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/resources/azure-resourcemanager-support.properties @@ -0,0 +1 @@ +version=${project.version} 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 46f64e0b43d8..8dd01c3e56a7 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetchatTranscriptDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/GetchatTranscriptDetailsForSubscriptionSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. 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 6fd2f83dc27b..40d5eb6e3976 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListChatTranscriptsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/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 1bda622960cb..f3305b7997db 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetchatTranscriptDetailsForSupportTicket.json + * x-ms-original-file: 2026-07-01/GetchatTranscriptDetailsForSupportTicket.json */ /** * Sample code: Get chat transcript details for a subscription support ticket. 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 5f2c6c995688..66797d0e5f7b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ChatTranscriptsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListChatTranscriptsForSupportTicket.json + * x-ms-original-file: 2026-07-01/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/ClassifyProblemsClassifyProblemsSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyProblemsClassifyProblemsSamples.java new file mode 100644 index 000000000000..6906ff4191c6 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyProblemsClassifyProblemsSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; + +/** + * Samples for ClassifyProblems ClassifyProblems. + */ +public final class ClassifyProblemsClassifyProblemsSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyProblems() + .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/ClassifyProblemsNoSubscriptionClassifyProblemsSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyProblemsNoSubscriptionClassifyProblemsSamples.java new file mode 100644 index 000000000000..2dc6568a7efc --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyProblemsNoSubscriptionClassifyProblemsSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; + +/** + * Samples for ClassifyProblemsNoSubscription ClassifyProblems. + */ +public final class ClassifyProblemsNoSubscriptionClassifyProblemsSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyProblemsNoSubscriptions() + .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/ClassifyServicesClassifyServicesSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyServicesClassifyServicesSamples.java new file mode 100644 index 000000000000..3c2034a33d18 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyServicesClassifyServicesSamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; + +/** + * Samples for ClassifyServices ClassifyServices. + */ +public final class ClassifyServicesClassifyServicesSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyServices() + .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/ClassifyServicesNoSubscriptionClassifyServicesSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyServicesNoSubscriptionClassifyServicesSamples.java new file mode 100644 index 000000000000..204fd568270c --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ClassifyServicesNoSubscriptionClassifyServicesSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; + +/** + * Samples for ClassifyServicesNoSubscription ClassifyServices. + */ +public final class ClassifyServicesNoSubscriptionClassifyServicesSamples { + /* + * x-ms-original-file: 2026-07-01/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.classifyServicesNoSubscriptions() + .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/CommunicationsCheckNameAvailabilitySamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilitySamples.java index 02030f25fb4c..e27719c90f1d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,8 +12,7 @@ */ public final class CommunicationsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CheckNameAvailabilityForSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CheckNameAvailabilityForSupportTicketCommunication.json */ /** * Sample code: Checks whether name is available for Communication resource for a subscription support ticket. 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 1c7c43360707..f06a02e7ba89 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class CommunicationsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CreateSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToSubscriptionTicket. 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 1a12c787abb1..fcc6ff29bbf1 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class CommunicationsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetCommunicationDetailsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/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 164f73fcdd4d..c4ab553bca85 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class CommunicationsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/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/stable/2024-04-01/examples/ - * ListWebCommunicationsForSubscriptionSupportTicket.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSubscriptionSupportTicket.json */ /** * Sample code: List web communications for a subscription support ticket. @@ -38,8 +36,7 @@ public final class CommunicationsListSamples { } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a subscription support ticket. 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 bc10a2584e79..5c499730642f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,8 +12,7 @@ */ public final class CommunicationsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CheckNameAvailabilityForNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: Checks whether name is available for Communication resource. 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 e39918cdd641..83947afc2b58 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,8 +11,7 @@ */ public final class CommunicationsNoSubscriptionCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateNoSubscriptionSupportTicketCommunication.json + * x-ms-original-file: 2026-07-01/CreateNoSubscriptionSupportTicketCommunication.json */ /** * Sample code: AddCommunicationToNoSubscriptionTicket. 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 8875257048f4..0d8a618040cc 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class CommunicationsNoSubscriptionGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetCommunicationDetailsForSupportTicket.json + * x-ms-original-file: 2026-07-01/GetCommunicationDetailsForSupportTicket.json */ /** * Sample code: Get communication details for a no-subscription support ticket. 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 3382c2a8506c..f8dbdf807e92 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class CommunicationsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListCommunicationsForSupportTicket.json + * x-ms-original-file: 2026-07-01/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/stable/2024-04-01/examples/ - * ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSupportTicketCreatedOnOrAfter.json */ /** * Sample code: List web communication created on or after a specific date for a no-subscription support ticket. @@ -39,8 +37,7 @@ public static void listWebCommunicationCreatedOnOrAfterASpecificDateForANoSubscr } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListWebCommunicationsForSupportTicket.json + * x-ms-original-file: 2026-07-01/ListWebCommunicationsForSupportTicket.json */ /** * Sample code: List web communications for a no-subscription support ticket. 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 aaa688f933de..8ab9289b9b3b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class FileWorkspacesCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateFileWorkspaceForSubscription.json + * x-ms-original-file: 2026-07-01/CreateFileWorkspaceForSubscription.json */ /** * Sample code: Create a file workspace for a subscription. 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 c8661be36434..830865beaf36 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class FileWorkspacesGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetFileWorkspaceDetailsForSubscription.json + * x-ms-original-file: 2026-07-01/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 a8863f58ab69..a5df92e29b24 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class FileWorkspacesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileWorkspace.json + * x-ms-original-file: 2026-07-01/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 73d16afc460b..ec2911a840ab 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class FileWorkspacesNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileWorkspaceDetails.json + * x-ms-original-file: 2026-07-01/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 a79026095e9a..9aba7e4a2267 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,9 +9,7 @@ */ public final class FilesCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFileForSubscription. - * json + * x-ms-original-file: 2026-07-01/CreateFileForSubscription.json */ /** * Sample code: Create a file under a subscription workspace. 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 ade7b28febce..0e53ec46c09e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,9 +9,7 @@ */ public final class FilesGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetailsForSubscription - * .json + * x-ms-original-file: 2026-07-01/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 978fc5a8da2b..af425c312055 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class FilesListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListFilesForSubscriptionUnderFileWorkspace.json + * x-ms-original-file: 2026-07-01/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 0263004d0d4b..d117ad29214c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,8 +11,7 @@ */ public final class FilesNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateFile.json + * x-ms-original-file: 2026-07-01/CreateFile.json */ /** * Sample code: Create a file workspace. 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 a41c2deea14a..64f6ccac701b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class FilesNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetFileDetails.json + * x-ms-original-file: 2026-07-01/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 f9c06f3bfadf..29ab8eb69d40 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,9 +9,7 @@ */ public final class FilesNoSubscriptionListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListFilesUnderFileWorkspace. - * json + * x-ms-original-file: 2026-07-01/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 65f0f807bd75..18bfbf9bb23d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,8 +11,7 @@ */ public final class FilesNoSubscriptionUploadSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFile.json + * x-ms-original-file: 2026-07-01/UploadFile.json */ /** * Sample code: UploadFile. 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 3af989f95523..9a6f19198ebf 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,9 +11,7 @@ */ public final class FilesUploadSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UploadFileForSubscription. - * json + * x-ms-original-file: 2026-07-01/UploadFileForSubscription.json */ /** * Sample code: UploadFileForSubscription. 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 5a60941ea35f..853a65b50935 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListOperations.json + * x-ms-original-file: 2026-07-01/ListOperations.json */ /** * Sample code: Get all operations. 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 449ce117d8ce..eb1382647c4b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ProblemClassificationsGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetProblemClassification.json + * x-ms-original-file: 2026-07-01/GetProblemClassification.json */ /** * Sample code: Gets details of problemClassification for Azure service. 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 e4fdd59c1523..c910c37f0f6a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,9 +9,7 @@ */ public final class ProblemClassificationsListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListProblemClassifications. - * json + * x-ms-original-file: 2026-07-01/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/ServicesGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java index 9cc0dbff9d71..88869ecb0182 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ServicesGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetService.json + * x-ms-original-file: 2026-07-01/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 34386775b2b7..65573359175c 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class ServicesListSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListServices.json + * x-ms-original-file: 2026-07-01/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 d97617d424ea..62ba6f8fbe07 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,8 +12,7 @@ */ public final class SupportTicketsCheckNameAvailabilitySamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CheckNameAvailabilityWithSubscription.json + * x-ms-original-file: 2026-07-01/CheckNameAvailabilityWithSubscription.json */ /** * Sample code: Checks whether name is available for a subscription support ticket resource. 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 5232bace000b..b40e94491e83 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -20,8 +20,7 @@ */ public final class SupportTicketsCreateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatawarehouseQuotaTicketForDTUs.json + * x-ms-original-file: 2026-07-01/CreateSqlDatawarehouseQuotaTicketForDTUs.json */ /** * Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics. @@ -56,8 +55,7 @@ public static void createATicketToRequestQuotaIncreaseForDTUsForAzureSynapseAnal } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json */ /** * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. @@ -92,8 +90,7 @@ public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedul } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateMachineLearningQuotaTicketForLowPriorityCores.json + * x-ms-original-file: 2026-07-01/CreateMachineLearningQuotaTicketForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service. @@ -128,8 +125,7 @@ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMach } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription. @@ -164,21 +160,22 @@ public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscr } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatabaseQuotaTicketForDTUs.json + * x-ms-original-file: 2026-07-01/CreateGenericQuotaTicket.json */ /** - * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. + * Sample code: Create a ticket to request Quota increase for services that do not require additional details in the + * quotaTicketDetails object. * * @param manager Entry point to SupportManager. */ - public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( - com.azure.resourcemanager.support.SupportManager manager) { + public static void + createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( + com.azure.resourcemanager.support.SupportManager manager) { manager.supportTickets() .define("testticket") - .withDescription("my description") + .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") .withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) .withAdvancedDiagnosticConsent(Consent.YES) .withContactDetails(new ContactProfile().withFirstName("abc") @@ -190,33 +187,24 @@ public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( .withPreferredSupportLanguage("en-US")) .withTitle("my title") .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") - .withSupportPlanId( - "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") - .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") - .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/stable/2024-04-01/examples/CreateGenericQuotaTicket.json + * x-ms-original-file: 2026-07-01/CreateSqlDatabaseQuotaTicketForDTUs.json */ /** - * Sample code: Create a ticket to request Quota increase for services that do not require additional details in the - * quotaTicketDetails object. + * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. * * @param manager Entry point to SupportManager. */ - public static void - createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( - com.azure.resourcemanager.support.SupportManager manager) { + public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( + com.azure.resourcemanager.support.SupportManager manager) { manager.supportTickets() .define("testticket") - .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") + .withDescription("my description") .withProblemClassificationId( - "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") .withSeverity(SeverityLevel.MODERATE) .withAdvancedDiagnosticConsent(Consent.YES) .withContactDetails(new ContactProfile().withFirstName("abc") @@ -228,12 +216,17 @@ public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( .withPreferredSupportLanguage("en-US")) .withTitle("my title") .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withSupportPlanId( + "U291cmNlOlNDTSxDbGFyaWZ5SW5zdGFsbGF0aW9uU2l0ZUlkOjcsTGluZUl0ZW1JZDo5ODY1NzIyOSxDb250cmFjdElkOjk4NjU5MTk0LFN1YnNjcmlwdGlvbklkOjc2Y2I3N2ZhLThiMTctNGVhYi05NDkzLWI2NWRhY2U5OTgxMyw=") + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("DTUs") + .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/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json */ /** * Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account. @@ -268,8 +261,7 @@ public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForABat } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlManagedInstanceQuotaTicket.json + * x-ms-original-file: 2026-07-01/CreateSqlManagedInstanceQuotaTicket.json */ /** * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. @@ -307,8 +299,7 @@ public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSubMgmtSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateSubMgmtSupportTicketForSubscription.json */ /** * Sample code: Create a ticket for Subscription Management related issues for a subscription. @@ -340,8 +331,7 @@ public static void createATicketForSubscriptionManagementRelatedIssuesForASubscr } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateTechnicalSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateTechnicalSupportTicketForSubscription.json */ /** * Sample code: Create a ticket for Technical issue related to a specific resource for a subscription. @@ -375,12 +365,13 @@ public static void createATicketForTechnicalIssueRelatedToASpecificResourceForAS "/subscriptions/132d901f-189d-4381-9214-fe68e27e05a1/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) .withSecondaryConsent(Arrays.asList( new SecondaryConsent().withUserConsent(UserConsent.YES).withType("virtualmachinerunninglinuxservice"))) + .withCommunityForumPost( + "https://learn.microsoft.com/en-us/answers/questions/2283704/unverified-app-listed-under-applications-from-pers") .create(); } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json */ /** * Sample code: Create a ticket to request Quota increase for Pools for a Batch account. @@ -415,8 +406,7 @@ public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + * x-ms-original-file: 2026-07-01/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account. @@ -452,8 +442,7 @@ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresFo } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatabaseQuotaTicketForServers.json + * x-ms-original-file: 2026-07-01/CreateSqlDatabaseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for SQL Database. @@ -488,8 +477,7 @@ public static void createATicketToRequestQuotaIncreaseForServersForSQLDatabase( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateBillingSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateBillingSupportTicketForSubscription.json */ /** * Sample code: Create a ticket for Billing related issues. @@ -520,8 +508,7 @@ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanage } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateMachineLearningQuotaTicketForDedicatedCores.json + * x-ms-original-file: 2026-07-01/CreateMachineLearningQuotaTicketForDedicatedCores.json */ /** * Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service. @@ -556,8 +543,7 @@ public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresFo } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateSqlDatawarehouseQuotaTicketForServers.json + * x-ms-original-file: 2026-07-01/CreateSqlDatawarehouseQuotaTicketForServers.json */ /** * Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics. @@ -592,8 +578,7 @@ public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseA } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * CreateCoresQuotaTicketForSubscription.json + * x-ms-original-file: 2026-07-01/CreateCoresQuotaTicketForSubscription.json */ /** * Sample code: Create a ticket to request Quota increase for Compute VM Cores. 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 f2246d168017..6a1e53f9790e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class SupportTicketsGetSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * GetSubscriptionSupportTicketDetails.json + * x-ms-original-file: 2026-07-01/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 a4b8bcf3a011..06c83c8383d8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class SupportTicketsListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsServiceIdEqualsForSubscription.json + * x-ms-original-file: 2026-07-01/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/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in open state for a subscription. @@ -38,8 +36,7 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateF } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsInUpdatingStateBySubscription.json + * x-ms-original-file: 2026-07-01/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/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInUpdatingStateBySubscription.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state for a subscription. @@ -68,8 +64,7 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingSt } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsProblemClassificationIdEqualsForSubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsProblemClassificationIdEqualsForSubscription.json */ /** * Sample code: List support tickets with a certain problem classification id for a subscription. @@ -84,8 +79,7 @@ public static void listSupportTicketsWithACertainProblemClassificationIdForASubs } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsBySubscription.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsBySubscription.json */ /** * Sample code: List support tickets for a subscription. @@ -97,8 +91,7 @@ public static void listSupportTicketsForASubscription(com.azure.resourcemanager. } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsInOpenStateBySubscription.json + * x-ms-original-file: 2026-07-01/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/SupportTicketsLookUpResourceIdSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsLookUpResourceIdSamples.java new file mode 100644 index 000000000000..5a8c65ae7e5d --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsLookUpResourceIdSamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequestType; + +/** + * Samples for SupportTickets LookUpResourceId. + */ +public final class SupportTicketsLookUpResourceIdSamples { + /* + * x-ms-original-file: 2026-07-01/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.supportTickets() + .lookUpResourceIdWithResponse( + new LookUpResourceIdRequest().withIdentifier("1234668596") + .withType(LookUpResourceIdRequestType.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/SupportTicketsNoSubscriptionCheckNameAvailabilitySamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsNoSubscriptionCheckNameAvailabilitySamples.java index 54c96d0d6268..c916d3d0c718 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,8 +12,7 @@ */ public final class SupportTicketsNoSubscriptionCheckNameAvailabilitySamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CheckNameAvailability.json + * x-ms-original-file: 2026-07-01/CheckNameAvailability.json */ /** * Sample code: Checks whether name is available for SupportTicket resource. 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 a7000e6cf095..a1fb198aeeab 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -18,9 +18,7 @@ */ public final class SupportTicketsNoSubscriptionCreateSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateBillingSupportTicket. - * json + * x-ms-original-file: 2026-07-01/CreateBillingSupportTicket.json */ /** * Sample code: Create a ticket for Billing related issues. @@ -50,9 +48,7 @@ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanage } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateSubMgmtSupportTicket. - * json + * x-ms-original-file: 2026-07-01/CreateSubMgmtSupportTicket.json */ /** * Sample code: Create a ticket for Subscription Management related issues. @@ -83,9 +79,7 @@ public static void createATicketForBillingRelatedIssues(com.azure.resourcemanage } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/CreateTechnicalSupportTicket. - * json + * x-ms-original-file: 2026-07-01/CreateTechnicalSupportTicket.json */ /** * Sample code: Create a ticket for Technical issue related to a specific resource. @@ -115,7 +109,9 @@ public static void createATicketForTechnicalIssueRelatedToASpecificResource( .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"))), + .withType("virtualmachinerunninglinuxservice"))) + .withCommunityForumPost( + "https://learn.microsoft.com/en-us/answers/questions/2283704/unverified-app-listed-under-applications-from-pers"), 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 7e29868ffe11..b51efe44b8c9 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class SupportTicketsNoSubscriptionGetSamples { /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/GetSupportTicketDetails.json + * x-ms-original-file: 2026-07-01/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 e44b0df2644f..059f9c272d04 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -9,8 +9,7 @@ */ public final class SupportTicketsNoSubscriptionListSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInUpdatingState.json */ /** * Sample code: List support tickets created on or after a certain date and in updating state. @@ -25,9 +24,7 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInUpdatingSt } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTicketsInOpenState - * .json + * x-ms-original-file: 2026-07-01/ListSupportTicketsInOpenState.json */ /** * Sample code: List support tickets in open state. @@ -39,8 +36,7 @@ public static void listSupportTicketsInOpenState(com.azure.resourcemanager.suppo } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ListSupportTickets.json + * x-ms-original-file: 2026-07-01/ListSupportTickets.json */ /** * Sample code: List support tickets. @@ -52,8 +48,7 @@ public static void listSupportTickets(com.azure.resourcemanager.support.SupportM } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsInUpdatingState.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsInUpdatingState.json */ /** * Sample code: List support tickets in updating state. @@ -65,8 +60,7 @@ public static void listSupportTicketsInUpdatingState(com.azure.resourcemanager.s } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsCreatedOnOrAfterAndInOpenState.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsCreatedOnOrAfterAndInOpenState.json */ /** * Sample code: List support tickets created on or after a certain date and in open state. @@ -80,8 +74,7 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsServiceIdEquals.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsServiceIdEquals.json */ /** * Sample code: List support tickets with a certain service id. @@ -95,8 +88,7 @@ public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenState( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * ListSupportTicketsProblemClassificationIdEquals.json + * x-ms-original-file: 2026-07-01/ListSupportTicketsProblemClassificationIdEquals.json */ /** * Sample code: List support tickets with a certain problem classification id. 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 9176e0511024..10442e6a3312 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 @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.resourcemanager.support.models.Consent; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.Status; @@ -17,8 +19,7 @@ */ public final class SupportTicketsNoSubscriptionUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicket.json + * x-ms-original-file: 2026-07-01/UpdateAdvancedDiagnosticConsentOfSupportTicket.json */ /** * Sample code: Update advanced diagnostic consent of a support ticket. @@ -33,9 +34,7 @@ public final class SupportTicketsNoSubscriptionUpdateSamples { } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateSeverityOfSupportTicket - * .json + * x-ms-original-file: 2026-07-01/UpdateSeverityOfSupportTicket.json */ /** * Sample code: Update severity of a support ticket. @@ -49,9 +48,7 @@ public static void updateSeverityOfASupportTicket(com.azure.resourcemanager.supp } /* - * x-ms-original-file: - * specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/UpdateStatusOfSupportTicket. - * json + * x-ms-original-file: 2026-07-01/UpdateStatusOfSupportTicket.json */ /** * Sample code: Update status of a support ticket. @@ -65,8 +62,26 @@ public static void updateStatusOfASupportTicket(com.azure.resourcemanager.suppor } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateContactDetailsOfSupportTicket.json + * x-ms-original-file: 2026-07-01/UpdateEscalationStatusOfSupportTicket.json + */ + /** + * Sample code: Update escalation status of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void + updateEscalationStatusOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTicketsNoSubscriptions() + .updateWithResponse("testticket", + new UpdateSupportTicket().withContactDetails(new UpdateContactProfile().withPhoneNumber("123-456-7890")) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_INITIATED) + .withReasonForEscalation("Server is down and business is impacted")), + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: 2026-07-01/UpdateContactDetailsOfSupportTicket.json */ /** * Sample code: Update contact details of a support ticket. 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 32ba036f14a7..9d02dcd9c335 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 @@ -1,10 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.resourcemanager.support.models.Consent; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.Status; @@ -17,8 +19,27 @@ */ public final class SupportTicketsUpdateSamples { /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateEscalationStatusOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update escalation status of a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void + updateEscalationStatusOfASubscriptionSupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource + = manager.supportTickets().getWithResponse("testticket", com.azure.core.util.Context.NONE).getValue(); + resource.update() + .withContactDetails(new UpdateContactProfile().withPhoneNumber("123-456-7890")) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_INITIATED) + .withReasonForEscalation("Server is down and business is impacted")) + .apply(); + } + + /* + * x-ms-original-file: 2026-07-01/UpdateAdvancedDiagnosticConsentOfSupportTicketForSubscription.json */ /** * Sample code: Update advanced diagnostic consent of a subscription support ticket. @@ -33,8 +54,7 @@ public static void updateAdvancedDiagnosticConsentOfASubscriptionSupportTicket( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateSeverityOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateSeverityOfSupportTicketForSubscription.json */ /** * Sample code: Update severity of a subscription support ticket. @@ -49,8 +69,7 @@ public static void updateAdvancedDiagnosticConsentOfASubscriptionSupportTicket( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateStatusOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateStatusOfSupportTicketForSubscription.json */ /** * Sample code: Update status of a subscription support ticket. @@ -65,8 +84,7 @@ public static void updateAdvancedDiagnosticConsentOfASubscriptionSupportTicket( } /* - * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2024-04-01/examples/ - * UpdateContactDetailsOfSupportTicketForSubscription.json + * x-ms-original-file: 2026-07-01/UpdateContactDetailsOfSupportTicketForSubscription.json */ /** * Sample code: Update contact details of a subscription support ticket. 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 84775c28f13f..17aeebe9c9c8 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 @@ -1,32 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsInner; -import com.azure.resourcemanager.support.models.MessageProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ChatTranscriptDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChatTranscriptDetailsInner model = BinaryData.fromString( - "{\"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\"}") + "{\"properties\":{\"messages\":[{\"contentType\":\"asrru\",\"communicationDirection\":\"outbound\",\"sender\":\"sqfsubcgjbirxb\",\"body\":\"bsrfbj\",\"createdDate\":\"2021-07-26T21:20:39Z\"},{\"contentType\":\"ssotftpv\",\"communicationDirection\":\"outbound\",\"sender\":\"xilzznf\",\"body\":\"nvwpmqtaruouj\",\"createdDate\":\"2021-07-07T14:17:28Z\"},{\"contentType\":\"hwqytj\",\"communicationDirection\":\"inbound\",\"sender\":\"wj\",\"body\":\"gdrjervnaenqpe\",\"createdDate\":\"2021-05-26T12:17:52Z\"},{\"contentType\":\"oygmift\",\"communicationDirection\":\"inbound\",\"sender\":\"ndslgnayqigynduh\",\"body\":\"hqlkthumaqo\",\"createdDate\":\"2021-05-05T06:10:43Z\"}],\"startTime\":\"2021-05-30T14:02:28Z\"},\"id\":\"uie\",\"name\":\"tgccymvaolpss\",\"type\":\"qlfmmdnbb\"}") .toObject(ChatTranscriptDetailsInner.class); - 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("jfdtwssotftpvj").withBody("exilzznfqqnvwpmq"), - new MessageProperties().withSender("mkcjhwqytjrybn").withBody("ewgdrjervn"))); - model = BinaryData.fromObject(model).toObject(ChatTranscriptDetailsInner.class); - Assertions.assertEquals("jfdtwssotftpvj", model.messages().get(0).sender()); - Assertions.assertEquals("exilzznfqqnvwpmq", model.messages().get(0).body()); + Assertions.assertEquals("sqfsubcgjbirxb", model.messages().get(0).sender()); + Assertions.assertEquals("bsrfbj", 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 e53688e633df..2ea7052f8e8f 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 @@ -1,34 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsProperties; -import com.azure.resourcemanager.support.models.MessageProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ChatTranscriptDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChatTranscriptDetailsProperties model = BinaryData.fromString( - "{\"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\"}") + "{\"messages\":[{\"contentType\":\"swiydmcwyhzdx\",\"communicationDirection\":\"outbound\",\"sender\":\"bzmnvdfznud\",\"body\":\"dvxzbncblylpst\",\"createdDate\":\"2021-11-13T03:54:29Z\"},{\"contentType\":\"xsrz\",\"communicationDirection\":\"outbound\",\"sender\":\"erscdntne\",\"body\":\"iwjmygtdssls\",\"createdDate\":\"2021-06-02T21:20:03Z\"},{\"contentType\":\"eriofzpyqs\",\"communicationDirection\":\"inbound\",\"sender\":\"bnetshh\",\"body\":\"h\",\"createdDate\":\"2021-01-02T19:13:53Z\"}],\"startTime\":\"2021-08-08T18:22:23Z\"}") .toObject(ChatTranscriptDetailsProperties.class); - 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("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("uhavhql", model.messages().get(0).sender()); - Assertions.assertEquals("humaqolbgyc", model.messages().get(0).body()); + Assertions.assertEquals("bzmnvdfznud", model.messages().get(0).sender()); + Assertions.assertEquals("dvxzbncblylpst", 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 8aec9fe326f8..ec4ae173f6e6 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; @@ -21,19 +21,20 @@ public final class ChatTranscriptsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"messages\":[{\"contentType\":\"nfnw\",\"communicationDirection\":\"outbound\",\"sender\":\"vpdvjdhttzae\",\"body\":\"dxihc\",\"createdDate\":\"2021-05-03T20:49:03Z\"},{\"contentType\":\"k\",\"communicationDirection\":\"outbound\",\"sender\":\"dqns\",\"body\":\"zpbgtgkylkdg\",\"createdDate\":\"2021-03-05T10:28:15Z\"},{\"contentType\":\"uutlwxezwzhok\",\"communicationDirection\":\"outbound\",\"sender\":\"hh\",\"body\":\"lgehg\",\"createdDate\":\"2021-01-12T07:30:51Z\"},{\"contentType\":\"ifhpf\",\"communicationDirection\":\"outbound\",\"sender\":\"vgcxtx\",\"body\":\"sheafid\",\"createdDate\":\"2021-04-13T14:48:11Z\"}],\"startTime\":\"2021-07-18T03:03:02Z\"},\"id\":\"esmkssjhoiftxfkf\",\"name\":\"egprhptil\",\"type\":\"ucb\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - ChatTranscriptDetails response - = manager.chatTranscripts().getWithResponse("tj", "zysdzh", com.azure.core.util.Context.NONE).getValue(); + ChatTranscriptDetails response = manager.chatTranscripts() + .getWithResponse("disdosfjbjsvgj", "whryvycytdcl", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("yuvvfonkp", response.messages().get(0).sender()); - Assertions.assertEquals("qyikvy", response.messages().get(0).body()); + Assertions.assertEquals("vpdvjdhttzae", response.messages().get(0).sender()); + Assertions.assertEquals("dxihc", 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 ed2da72dc8f8..851d43ed0d50 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; @@ -22,19 +22,19 @@ public final class ChatTranscriptsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"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\"}]}"; + = "{\"value\":[{\"properties\":{\"messages\":[{\"contentType\":\"tpwb\",\"communicationDirection\":\"inbound\",\"sender\":\"libph\",\"body\":\"zmizakakan\",\"createdDate\":\"2021-05-23T03:49:23Z\"},{\"contentType\":\"n\",\"communicationDirection\":\"inbound\",\"sender\":\"joylh\",\"body\":\"muoyxprimr\",\"createdDate\":\"2021-01-23T03:44:08Z\"}],\"startTime\":\"2021-07-10T13:36:57Z\"},\"id\":\"cjmeislstvasy\",\"name\":\"wxdzaumweoohgu\",\"type\":\"fuzboyjathwtzolb\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.chatTranscripts().list("aawzqadfl", com.azure.core.util.Context.NONE); + = manager.chatTranscripts().list("qtgdqohmcwsl", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ecxn", response.iterator().next().messages().get(0).sender()); - Assertions.assertEquals("icokpv", response.iterator().next().messages().get(0).body()); + Assertions.assertEquals("libph", response.iterator().next().messages().get(0).sender()); + Assertions.assertEquals("zmizakakan", 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 5acfad600553..fa4275397ae7 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 @@ -1,40 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ChatTranscriptDetailsInner; -import com.azure.resourcemanager.support.models.ChatTranscriptsListResult; -import com.azure.resourcemanager.support.models.MessageProperties; -import java.util.Arrays; +import com.azure.resourcemanager.support.implementation.models.ChatTranscriptsListResult; import org.junit.jupiter.api.Assertions; public final class ChatTranscriptsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ChatTranscriptsListResult model = BinaryData.fromString( - "{\"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\"}") + "{\"nextLink\":\"qqkdltfzxmhhvhgu\",\"value\":[{\"properties\":{\"messages\":[{\"contentType\":\"bdagxt\",\"communicationDirection\":\"inbound\",\"sender\":\"xbxwa\",\"body\":\"ogqxndlkzgxhuri\",\"createdDate\":\"2021-08-01T11:38:37Z\"},{\"contentType\":\"odxun\",\"communicationDirection\":\"outbound\",\"sender\":\"xmubyyntwlrbq\",\"body\":\"oievseotgqrlltm\",\"createdDate\":\"2021-07-16T23:27:24Z\"},{\"contentType\":\"uwz\",\"communicationDirection\":\"inbound\",\"sender\":\"mpgcjefuzmuvpbt\",\"body\":\"um\",\"createdDate\":\"2021-07-07T00:12:33Z\"},{\"contentType\":\"xe\",\"communicationDirection\":\"inbound\",\"sender\":\"btbhjpglkfgohd\",\"body\":\"uel\",\"createdDate\":\"2021-04-04T13:11:17Z\"}],\"startTime\":\"2021-09-10T03:53:24Z\"},\"id\":\"htozfikdow\",\"name\":\"quuvxzxcl\",\"type\":\"ithhqzon\"},{\"properties\":{\"messages\":[{\"contentType\":\"hcohfwdsjnk\",\"communicationDirection\":\"outbound\",\"sender\":\"tiiswacffg\",\"body\":\"zzewkfvhqcrai\",\"createdDate\":\"2021-06-17T18:03:27Z\"},{\"contentType\":\"ppfufl\",\"communicationDirection\":\"outbound\",\"sender\":\"hdlxyjrxsagafcn\",\"body\":\"gwq\",\"createdDate\":\"2021-02-20T01:03:23Z\"},{\"contentType\":\"dgfbcvkcvqvpke\",\"communicationDirection\":\"outbound\",\"sender\":\"drhvoodsotbo\",\"body\":\"dopcjwvnh\",\"createdDate\":\"2021-09-01T11:04:55Z\"}],\"startTime\":\"2021-10-04T22:02:40Z\"},\"id\":\"xcxrsl\",\"name\":\"mutwuoe\",\"type\":\"rpkhjwn\"}]}") .toObject(ChatTranscriptsListResult.class); - 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("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("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()); + Assertions.assertEquals("qqkdltfzxmhhvhgu", model.nextLink()); + Assertions.assertEquals("xbxwa", model.value().get(0).messages().get(0).sender()); + Assertions.assertEquals("ogqxndlkzgxhuri", model.value().get(0).messages().get(0).body()); } } 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 937f56978b09..0ba77463ffc0 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; @@ -21,20 +21,20 @@ public final class ChatTranscriptsNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"messages\":[{\"contentType\":\"mwmqtibx\",\"communicationDirection\":\"inbound\",\"sender\":\"dt\",\"body\":\"cttadi\",\"createdDate\":\"2021-03-19T17:47:24Z\"},{\"contentType\":\"kmr\",\"communicationDirection\":\"inbound\",\"sender\":\"kpn\",\"body\":\"aapm\",\"createdDate\":\"2021-04-29T10:29:21Z\"},{\"contentType\":\"eqw\",\"communicationDirection\":\"outbound\",\"sender\":\"bu\",\"body\":\"wyxebeybpmzz\",\"createdDate\":\"2021-07-31T19:09:27Z\"},{\"contentType\":\"fyaqitm\",\"communicationDirection\":\"outbound\",\"sender\":\"oqaqhvseufuq\",\"body\":\"xpdlcgqlsis\",\"createdDate\":\"2021-03-09T15:21:31Z\"}],\"startTime\":\"2021-11-20T10:23:31Z\"},\"id\":\"dgamquhiosrsj\",\"name\":\"ivfcdisyirnx\",\"type\":\"hcz\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ChatTranscriptDetails response = manager.chatTranscriptsNoSubscriptions() - .getWithResponse("m", "rafwgckhocxvdf", com.azure.core.util.Context.NONE) + .getWithResponse("emwmdxmebwjs", "jpahlxvea", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("udaspavehh", response.messages().get(0).sender()); - Assertions.assertEquals("kbunzoz", response.messages().get(0).body()); + Assertions.assertEquals("dt", response.messages().get(0).sender()); + Assertions.assertEquals("cttadi", 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 fba987651591..c1cf93977d6f 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ChatTranscriptDetails; @@ -22,19 +22,19 @@ public final class ChatTranscriptsNoSubscriptionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"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\"}]}"; + = "{\"value\":[{\"properties\":{\"messages\":[{\"contentType\":\"evkh\",\"communicationDirection\":\"outbound\",\"sender\":\"zonzlrpiqywnc\",\"body\":\"tszcofizehtdhgb\",\"createdDate\":\"2020-12-26T18:59:24Z\"},{\"contentType\":\"eljeamurvzmlovua\",\"communicationDirection\":\"outbound\",\"sender\":\"cxlpmjerb\",\"body\":\"elvidizozsdbccx\",\"createdDate\":\"2021-04-03T14:05:40Z\"},{\"contentType\":\"fdgnwncypuuwwlt\",\"communicationDirection\":\"outbound\",\"sender\":\"ctzenkeifzzhmkd\",\"body\":\"vflyhbxcu\",\"createdDate\":\"2021-01-19T10:38:22Z\"},{\"contentType\":\"gsrboldforobw\",\"communicationDirection\":\"inbound\",\"sender\":\"zbfhfovvac\",\"body\":\"btuodxeszabbel\",\"createdDate\":\"2021-06-04T10:52:18Z\"}],\"startTime\":\"2020-12-26T02:35:36Z\"},\"id\":\"slzkwrrwoycqu\",\"name\":\"wyh\",\"type\":\"hnomdrkywuh\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.chatTranscriptsNoSubscriptions().list("qgnjdgkynscli", com.azure.core.util.Context.NONE); + = manager.chatTranscriptsNoSubscriptions().list("xrxzbujrtr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("omtkub", response.iterator().next().messages().get(0).sender()); - Assertions.assertEquals("ppnvdxz", response.iterator().next().messages().get(0).body()); + Assertions.assertEquals("zonzlrpiqywnc", response.iterator().next().messages().get(0).sender()); + Assertions.assertEquals("tszcofizehtdhgb", 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 440eb5bbbfc0..bdfffdb8073f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -13,18 +13,18 @@ public final class CheckNameAvailabilityInputTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityInput model - = BinaryData.fromString("{\"name\":\"psalgbqux\",\"type\":\"Microsoft.Support/communications\"}") + = BinaryData.fromString("{\"name\":\"dystkiiuxhqyud\",\"type\":\"Microsoft.Support/supportTickets\"}") .toObject(CheckNameAvailabilityInput.class); - Assertions.assertEquals("psalgbqux", model.name()); - Assertions.assertEquals(Type.MICROSOFT_SUPPORT_COMMUNICATIONS, model.type()); + Assertions.assertEquals("dystkiiuxhqyud", model.name()); + Assertions.assertEquals(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CheckNameAvailabilityInput model - = new CheckNameAvailabilityInput().withName("psalgbqux").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS); + CheckNameAvailabilityInput model = new CheckNameAvailabilityInput().withName("dystkiiuxhqyud") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS); model = BinaryData.fromObject(model).toObject(CheckNameAvailabilityInput.class); - Assertions.assertEquals("psalgbqux", model.name()); - Assertions.assertEquals(Type.MICROSOFT_SUPPORT_COMMUNICATIONS, model.type()); + Assertions.assertEquals("dystkiiuxhqyud", model.name()); + Assertions.assertEquals(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS, 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 8d525254b3f1..99aae1575505 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,13 +11,7 @@ public final class CheckNameAvailabilityOutputInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CheckNameAvailabilityOutputInner model - = BinaryData.fromString("{\"nameAvailable\":true,\"reason\":\"gzjaoyfhrtxilne\",\"message\":\"ujysvle\"}") + = BinaryData.fromString("{\"nameAvailable\":false,\"reason\":\"nbpoczvyifqrvkdv\",\"message\":\"llr\"}") .toObject(CheckNameAvailabilityOutputInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CheckNameAvailabilityOutputInner model = new CheckNameAvailabilityOutputInner(); - model = BinaryData.fromObject(model).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 new file mode 100644 index 000000000000..2b658bfba589 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassificationServiceTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.models.ClassificationService; +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\":\"kwtmutduqktapspw\",\"displayName\":\"uertumk\",\"resourceTypes\":[\"vqwhbmdgbbjfd\",\"gmbmbexppbh\",\"q\",\"rolfpfp\"]}") + .toObject(ClassificationService.class); + Assertions.assertEquals("vqwhbmdgbbjfd", model.resourceTypes().get(0)); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyProblemsClassifyProblemsWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyProblemsClassifyProblemsWithResponseMockTests.java new file mode 100644 index 000000000000..bb85a79c869b --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyProblemsClassifyProblemsWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.support.SupportManager; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClassifyProblemsClassifyProblemsWithResponseMockTests { + @Test + public void testClassifyProblemsWithResponse() throws Exception { + String responseStr + = "{\"problemClassificationResults\":[{\"problemId\":\"dnw\",\"title\":\"mewzsyyc\",\"description\":\"zsoibjudpfrxtr\",\"serviceId\":\"zvaytdwkqbr\",\"problemClassificationId\":\"bpaxhexiilivpdt\",\"relatedService\":{\"serviceId\":\"q\",\"displayName\":\"qoaxoruzfgs\",\"resourceTypes\":[\"fxrxxle\",\"tramxjez\"]},\"articleId\":\"wnwxuqlcvyd\"},{\"problemId\":\"atdooaojkniod\",\"title\":\"oebwnujhemms\",\"description\":\"dkcrodt\",\"serviceId\":\"nfwjlfltkacjvefk\",\"problemClassificationId\":\"foakgg\",\"relatedService\":{\"serviceId\":\"agaowpulpqblylsy\",\"displayName\":\"qjnsjervtia\",\"resourceTypes\":[\"dszue\",\"psbzkfzbeyvpn\"]},\"articleId\":\"cvinvkjjxdxrbuuk\"},{\"problemId\":\"lewyhmlwpaz\",\"title\":\"pofncck\",\"description\":\"fz\",\"serviceId\":\"hxx\",\"problemClassificationId\":\"yq\",\"relatedService\":{\"serviceId\":\"feqztppriol\",\"displayName\":\"rjaltolmncw\",\"resourceTypes\":[\"qwcsdbnwdcfhuc\",\"dpfuvg\",\"sbjjc\"]},\"articleId\":\"vxb\"},{\"problemId\":\"vudutncor\",\"title\":\"lxqtvcofudfl\",\"description\":\"gj\",\"serviceId\":\"gdknnqv\",\"problemClassificationId\":\"znqntoru\",\"relatedService\":{\"serviceId\":\"sahmky\",\"displayName\":\"rauwjuetaebu\",\"resourceTypes\":[\"dmovsm\",\"l\",\"wabm\",\"oefki\"]},\"articleId\":\"vtpuqujmqlgk\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProblemClassificationsClassificationOutput response = manager.classifyProblems() + .classifyProblemsWithResponse("krmnjijpxacqqud", + new ProblemClassificationsClassificationInput().withIssueSummary("nbyxbaaabjyv") + .withResourceId("ffimrzrtuzqogsex"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("fxrxxle", + response.problemClassificationResults().get(0).relatedService().resourceTypes().get(0)); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyProblemsNoSubscriptionsClassifyProblemsWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyProblemsNoSubscriptionsClassifyProblemsWithResponseMockTests.java new file mode 100644 index 000000000000..cece8c45dbde --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyProblemsNoSubscriptionsClassifyProblemsWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.support.SupportManager; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationInput; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationOutput; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClassifyProblemsNoSubscriptionsClassifyProblemsWithResponseMockTests { + @Test + public void testClassifyProblemsWithResponse() throws Exception { + String responseStr + = "{\"problemClassificationResults\":[{\"problemId\":\"df\",\"title\":\"waezkojvd\",\"description\":\"zfoqouicybxar\",\"serviceId\":\"szufoxciqopidoa\",\"problemClassificationId\":\"iodhkhazxkhnz\",\"relatedService\":{\"serviceId\":\"lwntoego\",\"displayName\":\"wbw\",\"resourceTypes\":[\"z\",\"cmrvexzt\",\"bt\"]},\"articleId\":\"sfraoyzko\"}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ProblemClassificationsClassificationOutput response = manager.classifyProblemsNoSubscriptions() + .classifyProblemsWithResponse("btndo", + new ProblemClassificationsClassificationInput().withIssueSummary("ongbjcnt").withResourceId("i"), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("z", + response.problemClassificationResults().get(0).relatedService().resourceTypes().get(0)); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyServicesClassifyServicesWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyServicesClassifyServicesWithResponseMockTests.java new file mode 100644 index 000000000000..a489f15deb07 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyServicesClassifyServicesWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.support.SupportManager; +import com.azure.resourcemanager.support.models.ServiceClassificationOutput; +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClassifyServicesClassifyServicesWithResponseMockTests { + @Test + public void testClassifyServicesWithResponse() throws Exception { + String responseStr + = "{\"serviceClassificationResults\":[{\"childService\":{\"serviceId\":\"rpzbchckqqzqi\",\"displayName\":\"iysui\",\"resourceTypes\":[\"nkedyatrwyhqmib\",\"yhwitsmypyynpcdp\",\"mnzgmwznmabi\",\"nsorgjhxbldt\"]},\"serviceId\":\"wrlkdmtn\",\"displayName\":\"ok\",\"resourceTypes\":[\"lxdy\",\"gsyocogj\"]},{\"childService\":{\"serviceId\":\"tbnnha\",\"displayName\":\"ocrkvcikh\",\"resourceTypes\":[\"amqgxqquezikyw\"]},\"serviceId\":\"xkalla\",\"displayName\":\"elwuipi\",\"resourceTypes\":[\"zkzivgvvcnay\",\"hyrnxxmu\"]},{\"childService\":{\"serviceId\":\"ndrdvstkwq\",\"displayName\":\"chea\",\"resourceTypes\":[\"mtdaa\",\"gdv\",\"vgpiohgwxrt\",\"udxepxgyqagv\"]},\"serviceId\":\"mnpkukghimdblxg\",\"displayName\":\"mfnjh\",\"resourceTypes\":[\"wmszkk\"]},{\"childService\":{\"serviceId\":\"rey\",\"displayName\":\"zi\",\"resourceTypes\":[\"aw\",\"eaivxwczel\"]},\"serviceId\":\"irels\",\"displayName\":\"aenwabf\",\"resourceTypes\":[\"lddxbjhwua\"]}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ServiceClassificationOutput response = manager.classifyServices() + .classifyServicesWithResponse(new ServiceClassificationRequest().withIssueSummary("ph") + .withResourceId("pxodlqiyntorzih") + .withAdditionalContext("osjswsr"), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("lxdy", response.serviceClassificationResults().get(0).resourceTypes().get(0)); + Assertions.assertEquals("nkedyatrwyhqmib", + response.serviceClassificationResults().get(0).childService().resourceTypes().get(0)); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyServicesNoSubscriptionsClassifyServicesWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyServicesNoSubscriptionsClassifyServicesWithResponseMockTests.java new file mode 100644 index 000000000000..fe6503d1146c --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ClassifyServicesNoSubscriptionsClassifyServicesWithResponseMockTests.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.support.SupportManager; +import com.azure.resourcemanager.support.models.ServiceClassificationOutput; +import com.azure.resourcemanager.support.models.ServiceClassificationRequest; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class ClassifyServicesNoSubscriptionsClassifyServicesWithResponseMockTests { + @Test + public void testClassifyServicesWithResponse() throws Exception { + String responseStr + = "{\"serviceClassificationResults\":[{\"childService\":{\"serviceId\":\"umiekkezzi\",\"displayName\":\"ly\",\"resourceTypes\":[\"dgqggebdu\",\"ygaeqidbqfatpxl\"]},\"serviceId\":\"xcyjmoadsuvarmy\",\"displayName\":\"mjsjqb\",\"resourceTypes\":[\"yxxrwlycoduh\",\"kxkgymareqna\",\"xqugjhkycubedd\",\"ssofwqmzqa\"]}]}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + ServiceClassificationOutput response = manager.classifyServicesNoSubscriptions() + .classifyServicesWithResponse(new ServiceClassificationRequest().withIssueSummary("oz") + .withResourceId("sphyoulpjrvxa") + .withAdditionalContext("rvimjwosytxitcsk"), com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("yxxrwlycoduh", response.serviceClassificationResults().get(0).resourceTypes().get(0)); + Assertions.assertEquals("dgqggebdu", + response.serviceClassificationResults().get(0).childService().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 950f3adfa04c..f6dfde893e58 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -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\":\"outbound\",\"sender\":\"pnyiropuhp\",\"subject\":\"gvpgy\",\"body\":\"gqgitxmedjvcsl\",\"createdDate\":\"2021-02-07T09:50:45Z\"},\"id\":\"wwncwzzhxgk\",\"name\":\"rmgucnap\",\"type\":\"t\"}") + "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"q\",\"subject\":\"c\",\"body\":\"refovgmkqsleyyvx\",\"createdDate\":\"2021-01-13T20:24:26Z\"},\"id\":\"k\",\"name\":\"attpngjcrcczsq\",\"type\":\"jh\"}") .toObject(CommunicationDetailsInner.class); - Assertions.assertEquals("pnyiropuhp", model.sender()); - Assertions.assertEquals("gvpgy", model.subject()); - Assertions.assertEquals("gqgitxmedjvcsl", model.body()); + Assertions.assertEquals("q", model.sender()); + Assertions.assertEquals("c", model.subject()); + Assertions.assertEquals("refovgmkqsleyyvx", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CommunicationDetailsInner model - = new CommunicationDetailsInner().withSender("pnyiropuhp").withSubject("gvpgy").withBody("gqgitxmedjvcsl"); + = new CommunicationDetailsInner().withSender("q").withSubject("c").withBody("refovgmkqsleyyvx"); model = BinaryData.fromObject(model).toObject(CommunicationDetailsInner.class); - Assertions.assertEquals("pnyiropuhp", model.sender()); - Assertions.assertEquals("gvpgy", model.subject()); - Assertions.assertEquals("gqgitxmedjvcsl", model.body()); + Assertions.assertEquals("q", model.sender()); + Assertions.assertEquals("c", model.subject()); + Assertions.assertEquals("refovgmkqsleyyvx", 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 43b2dde14c7f..573c7b28ac00 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,20 +12,20 @@ public final class CommunicationDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommunicationDetailsProperties model = BinaryData.fromString( - "{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"pt\",\"subject\":\"d\",\"body\":\"gpfqbuace\",\"createdDate\":\"2021-09-04T05:04:19Z\"}") + "{\"communicationType\":\"web\",\"communicationDirection\":\"outbound\",\"sender\":\"nysounqe\",\"subject\":\"a\",\"body\":\"oaeupfhyhltrpmo\",\"createdDate\":\"2021-10-07T12:57:21Z\"}") .toObject(CommunicationDetailsProperties.class); - Assertions.assertEquals("pt", model.sender()); - Assertions.assertEquals("d", model.subject()); - Assertions.assertEquals("gpfqbuace", model.body()); + Assertions.assertEquals("nysounqe", model.sender()); + Assertions.assertEquals("a", model.subject()); + Assertions.assertEquals("oaeupfhyhltrpmo", model.body()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { CommunicationDetailsProperties model - = new CommunicationDetailsProperties().withSender("pt").withSubject("d").withBody("gpfqbuace"); + = new CommunicationDetailsProperties().withSender("nysounqe").withSubject("a").withBody("oaeupfhyhltrpmo"); model = BinaryData.fromObject(model).toObject(CommunicationDetailsProperties.class); - Assertions.assertEquals("pt", model.sender()); - Assertions.assertEquals("d", model.subject()); - Assertions.assertEquals("gpfqbuace", model.body()); + Assertions.assertEquals("nysounqe", model.sender()); + Assertions.assertEquals("a", model.subject()); + Assertions.assertEquals("oaeupfhyhltrpmo", 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 2aeba55111f2..9836827d89bd 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; @@ -21,18 +21,18 @@ public final class CommunicationsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"fnynszqujizdvoqy\",\"message\":\"byowbblgyavutp\"}"; + String responseStr = "{\"nameAvailable\":false,\"reason\":\"wxwlmdjrkvfgb\",\"message\":\"vpdbodaciz\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityOutput response = manager.communications() - .checkNameAvailabilityWithResponse("ilbywdxsm", - new CheckNameAvailabilityInput().withName("ccwr").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + .checkNameAvailabilityWithResponse("xqi", + new CheckNameAvailabilityInput().withName("y").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/CommunicationsCreateMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsCreateMockTests.java index 6cd42173a2f8..fe3426f98556 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; @@ -21,25 +21,25 @@ public final class CommunicationsCreateMockTests { @Test public void testCreate() throws Exception { String responseStr - = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"udzpxgwjplmagstc\",\"subject\":\"ohpfkyrkdbdgiog\",\"body\":\"jkmnwq\",\"createdDate\":\"2021-09-21T11:57:43Z\"},\"id\":\"baiyhddviaceg\",\"name\":\"n\",\"type\":\"ntfpmvmemfnc\"}"; + = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"fsdjpvkvp\",\"subject\":\"jxbkzbzkdvn\",\"body\":\"jabudurgkakmo\",\"createdDate\":\"2021-07-24T12:59:33Z\"},\"id\":\"jk\",\"name\":\"ffhmouwqlgzr\",\"type\":\"zeeyebi\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommunicationDetails response = manager.communications() - .define("jxakv") - .withExistingSupportTicket("bteoybf") - .withSubject("il") - .withBody("yw") - .withSender("r") + .define("lhkrribdeibqipqk") + .withExistingSupportTicket("j") + .withSubject("efajpj") + .withBody("rwkq") + .withSender("zwmk") .create(); - Assertions.assertEquals("udzpxgwjplmagstc", response.sender()); - Assertions.assertEquals("ohpfkyrkdbdgiog", response.subject()); - Assertions.assertEquals("jkmnwq", response.body()); + Assertions.assertEquals("fsdjpvkvp", response.sender()); + Assertions.assertEquals("jxbkzbzkdvn", response.subject()); + Assertions.assertEquals("jabudurgkakmo", 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 0fb92d8f354a..0f9f329d06ab 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; @@ -21,21 +21,20 @@ public final class CommunicationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"juisavokqdzf\",\"subject\":\"azivjlfrqttbajl\",\"body\":\"atnwxyiopi\",\"createdDate\":\"2021-05-28T18:08:40Z\"},\"id\":\"qfkuvscxkdmli\",\"name\":\"ovibrxkp\",\"type\":\"loazuruocbgoo\"}"; + = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"dwmsweypqwd\",\"subject\":\"ggicccnxqhue\",\"body\":\"mkttlstvlzywem\",\"createdDate\":\"2021-05-31T04:58:05Z\"},\"id\":\"csdtclusiypbs\",\"name\":\"gytguslfead\",\"type\":\"ygqukyhejh\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - CommunicationDetails response = manager.communications() - .getWithResponse("ctxtgzukxi", "mmqtgqqqxhr", com.azure.core.util.Context.NONE) - .getValue(); + CommunicationDetails response + = manager.communications().getWithResponse("zbwemh", "i", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("juisavokqdzf", response.sender()); - Assertions.assertEquals("azivjlfrqttbajl", response.subject()); - Assertions.assertEquals("atnwxyiopi", response.body()); + Assertions.assertEquals("dwmsweypqwd", response.sender()); + Assertions.assertEquals("ggicccnxqhue", response.subject()); + Assertions.assertEquals("mkttlstvlzywem", 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 98195344e345..586943bbfb3e 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; @@ -22,20 +22,20 @@ public final class CommunicationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"jxkcgxxlxsff\",\"subject\":\"cvizqzdwlvw\",\"body\":\"youpfgfbkj\",\"createdDate\":\"2021-08-08T19:25:39Z\"},\"id\":\"yhgk\",\"name\":\"minsgowzf\",\"type\":\"tsttktlahbq\"}]}"; + = "{\"value\":[{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"dw\",\"subject\":\"ftswibyrcdlbhsh\",\"body\":\"wpracstwitykhev\",\"createdDate\":\"2021-04-16T00:20:28Z\"},\"id\":\"dcpnmdyodnw\",\"name\":\"xltjcvnhltiu\",\"type\":\"cxnavv\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.communications().list("hjoxo", 1315761996, "msksbp", com.azure.core.util.Context.NONE); + = manager.communications().list("isxgfp", 843863757, "olppvksrpqvujz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jxkcgxxlxsff", response.iterator().next().sender()); - Assertions.assertEquals("cvizqzdwlvw", response.iterator().next().subject()); - Assertions.assertEquals("youpfgfbkj", response.iterator().next().body()); + Assertions.assertEquals("dw", response.iterator().next().sender()); + Assertions.assertEquals("ftswibyrcdlbhsh", response.iterator().next().subject()); + Assertions.assertEquals("wpracstwitykhev", 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 a7fd511bf154..96364ae41285 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 @@ -1,42 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; -import com.azure.resourcemanager.support.models.CommunicationsListResult; -import java.util.Arrays; +import com.azure.resourcemanager.support.implementation.models.CommunicationsListResult; import org.junit.jupiter.api.Assertions; public final class CommunicationsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CommunicationsListResult model = BinaryData.fromString( - "{\"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\"}") + "{\"nextLink\":\"matuok\",\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"outbound\",\"sender\":\"dsfcpkvxodpuoz\",\"subject\":\"yzydagfuaxbezyi\",\"body\":\"okktwhrdxw\",\"createdDate\":\"2021-02-16T11:08:22Z\"},\"id\":\"sm\",\"name\":\"surex\",\"type\":\"moryocfsfksym\"}]}") .toObject(CommunicationsListResult.class); - 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("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("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()); + Assertions.assertEquals("matuok", model.nextLink()); + Assertions.assertEquals("dsfcpkvxodpuoz", model.value().get(0).sender()); + Assertions.assertEquals("yzydagfuaxbezyi", model.value().get(0).subject()); + Assertions.assertEquals("okktwhrdxw", model.value().get(0).body()); } } 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 536dae8d4439..9e36b1fe8de0 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; @@ -21,20 +21,20 @@ public final class CommunicationsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"vwrdnhfukuvsj\",\"message\":\"wsmystuluqypf\"}"; + String responseStr = "{\"nameAvailable\":false,\"reason\":\"wey\",\"message\":\"dunvmnnrwrbiorkt\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityOutput response = manager.communicationsNoSubscriptions() - .checkNameAvailabilityWithResponse("dwvvba", - new CheckNameAvailabilityInput().withName("xlllchp") - .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), + .checkNameAvailabilityWithResponse("kwbqplhlvnuu", + new CheckNameAvailabilityInput().withName("pzlrphw") + .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/CommunicationsNoSubscriptionsCreateMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/CommunicationsNoSubscriptionsCreateMockTests.java index 8ee87d47fd46..097fc714e65f 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; @@ -22,22 +22,22 @@ public final class CommunicationsNoSubscriptionsCreateMockTests { @Test public void testCreate() throws Exception { String responseStr - = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"z\",\"subject\":\"rr\",\"body\":\"vpglydz\",\"createdDate\":\"2021-02-08T17:34:52Z\"},\"id\":\"vqeevtoep\",\"name\":\"yutnwytpzdmov\",\"type\":\"vf\"}"; + = "{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"bj\",\"subject\":\"ewzcjznmwcp\",\"body\":\"guaadraufactkahz\",\"createdDate\":\"2021-09-08T06:19:33Z\"},\"id\":\"j\",\"name\":\"iuxxpshneekulfg\",\"type\":\"lqubkwdlen\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommunicationDetails response = manager.communicationsNoSubscriptions() - .create("eqvldspast", "bkkd", - new CommunicationDetailsInner().withSender("tmjlx").withSubject("ril").withBody("zapeewchpx"), + .create("vyvnqqyb", "ryeu", + new CommunicationDetailsInner().withSender("bqgzslesjcbhern").withSubject("tiewdj").withBody("vbquwr"), com.azure.core.util.Context.NONE); - Assertions.assertEquals("z", response.sender()); - Assertions.assertEquals("rr", response.subject()); - Assertions.assertEquals("vpglydz", response.body()); + Assertions.assertEquals("bj", response.sender()); + Assertions.assertEquals("ewzcjznmwcp", response.subject()); + Assertions.assertEquals("guaadraufactkahz", 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 dd0a2f84ecd2..ea3516deb020 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; @@ -21,21 +21,21 @@ public final class CommunicationsNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"jtlvofqzhvfciby\",\"subject\":\"mowuxrk\",\"body\":\"pvdwxf\",\"createdDate\":\"2021-09-25T09:52:18Z\"},\"id\":\"vwzjbhyz\",\"name\":\"xjrk\",\"type\":\"mbtrnegvmnvu\"}"; + = "{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"outbound\",\"sender\":\"brhu\",\"subject\":\"skh\",\"body\":\"dyg\",\"createdDate\":\"2021-02-04T04:44:46Z\"},\"id\":\"kqfqjbvl\",\"name\":\"orfmluiqt\",\"type\":\"zf\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CommunicationDetails response = manager.communicationsNoSubscriptions() - .getWithResponse("pgogtqxepny", "b", com.azure.core.util.Context.NONE) + .getWithResponse("mlkxtrqjfs", "lmbtxhwgfwsrt", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("jtlvofqzhvfciby", response.sender()); - Assertions.assertEquals("mowuxrk", response.subject()); - Assertions.assertEquals("pvdwxf", response.body()); + Assertions.assertEquals("brhu", response.sender()); + Assertions.assertEquals("skh", response.subject()); + Assertions.assertEquals("dyg", 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 45b48db90fd6..f9bd16ea9432 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CommunicationDetails; @@ -22,20 +22,20 @@ public final class CommunicationsNoSubscriptionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"communicationType\":\"web\",\"communicationDirection\":\"inbound\",\"sender\":\"rihpfhoq\",\"subject\":\"aaewdaomdjv\",\"body\":\"pjxxkzb\",\"createdDate\":\"2021-07-29T14:30:38Z\"},\"id\":\"geivsiykzkdncj\",\"name\":\"xonbzoggculapz\",\"type\":\"y\"}]}"; + = "{\"value\":[{\"properties\":{\"communicationType\":\"phone\",\"communicationDirection\":\"inbound\",\"sender\":\"flnorwmduvwp\",\"subject\":\"lvxwmyg\",\"body\":\"xpgpq\",\"createdDate\":\"2021-06-13T19:04:17Z\"},\"id\":\"zepn\",\"name\":\"bjcrxgibbdaxco\",\"type\":\"fozauorsuk\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.communicationsNoSubscriptions() - .list("vlerchpqbmfpjba", 877892499, "idfcxsspuunnoxyh", com.azure.core.util.Context.NONE); + .list("d", 1559984904, "tujbazpju", com.azure.core.util.Context.NONE); - Assertions.assertEquals("rihpfhoq", response.iterator().next().sender()); - Assertions.assertEquals("aaewdaomdjv", response.iterator().next().subject()); - Assertions.assertEquals("pjxxkzb", response.iterator().next().body()); + Assertions.assertEquals("flnorwmduvwp", response.iterator().next().sender()); + Assertions.assertEquals("lvxwmyg", response.iterator().next().subject()); + Assertions.assertEquals("xpgpq", 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 abd71ad4a1e9..7b8390a16ad2 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -14,39 +14,39 @@ public final class ContactProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ContactProfile model = BinaryData.fromString( - "{\"firstName\":\"zntxhdz\",\"lastName\":\"lrqjbhckfr\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"rxsbkyvp\",\"additionalEmailAddresses\":[\"n\",\"z\",\"p\",\"kafkuwbcrnwbm\"],\"phoneNumber\":\"hseyvju\",\"preferredTimeZone\":\"rts\",\"country\":\"hspkdeemao\",\"preferredSupportLanguage\":\"mx\"}") + "{\"firstName\":\"gnxytxhpzxbz\",\"lastName\":\"fzab\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"cuh\",\"additionalEmailAddresses\":[\"ctyqik\"],\"phoneNumber\":\"bovpl\",\"preferredTimeZone\":\"zbhvgyuguosv\",\"country\":\"kfssxqukkf\",\"preferredSupportLanguage\":\"l\"}") .toObject(ContactProfile.class); - 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()); + Assertions.assertEquals("gnxytxhpzxbz", model.firstName()); + Assertions.assertEquals("fzab", model.lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); + Assertions.assertEquals("cuh", model.primaryEmailAddress()); + Assertions.assertEquals("ctyqik", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("bovpl", model.phoneNumber()); + Assertions.assertEquals("zbhvgyuguosv", model.preferredTimeZone()); + Assertions.assertEquals("kfssxqukkf", model.country()); + Assertions.assertEquals("l", model.preferredSupportLanguage()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - 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"); + ContactProfile model = new ContactProfile().withFirstName("gnxytxhpzxbz") + .withLastName("fzab") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("cuh") + .withAdditionalEmailAddresses(Arrays.asList("ctyqik")) + .withPhoneNumber("bovpl") + .withPreferredTimeZone("zbhvgyuguosv") + .withCountry("kfssxqukkf") + .withPreferredSupportLanguage("l"); model = BinaryData.fromObject(model).toObject(ContactProfile.class); - 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()); + Assertions.assertEquals("gnxytxhpzxbz", model.firstName()); + Assertions.assertEquals("fzab", model.lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); + Assertions.assertEquals("cuh", model.primaryEmailAddress()); + Assertions.assertEquals("ctyqik", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("bovpl", model.phoneNumber()); + Assertions.assertEquals("zbhvgyuguosv", model.preferredTimeZone()); + Assertions.assertEquals("kfssxqukkf", model.country()); + Assertions.assertEquals("l", model.preferredSupportLanguage()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/DirectConnectEscalationTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/DirectConnectEscalationTests.java new file mode 100644 index 000000000000..bc2cb61ac95a --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/DirectConnectEscalationTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; +import com.azure.resourcemanager.support.models.SeverityLevel; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class DirectConnectEscalationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + DirectConnectEscalation model = BinaryData.fromString( + "{\"azureEEStatus\":\"EscalationUnavailable\",\"allowedSeverities\":[\"highestcriticalimpact\",\"minimal\",\"minimal\"],\"reasonForEscalation\":\"ilovnot\"}") + .toObject(DirectConnectEscalation.class); + Assertions.assertEquals(EscalationStatus.ESCALATION_UNAVAILABLE, model.azureEEStatus()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.allowedSeverities().get(0)); + Assertions.assertEquals("ilovnot", model.reasonForEscalation()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + DirectConnectEscalation model + = new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_UNAVAILABLE) + .withAllowedSeverities( + Arrays.asList(SeverityLevel.HIGHESTCRITICALIMPACT, SeverityLevel.MINIMAL, SeverityLevel.MINIMAL)) + .withReasonForEscalation("ilovnot"); + model = BinaryData.fromObject(model).toObject(DirectConnectEscalation.class); + Assertions.assertEquals(EscalationStatus.ESCALATION_UNAVAILABLE, model.azureEEStatus()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.allowedSeverities().get(0)); + Assertions.assertEquals("ilovnot", model.reasonForEscalation()); + } +} 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 746612c56a41..19193d6ca182 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -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-11-03T20:59:21Z\",\"chunkSize\":1250108412,\"fileSize\":239999895,\"numberOfChunks\":659977632},\"id\":\"tibqdxbxwakb\",\"name\":\"gqxndlkzgxhuripl\",\"type\":\"podxunkb\"}") + "{\"properties\":{\"createdOn\":\"2021-03-05T05:10:55Z\",\"chunkSize\":938616277,\"fileSize\":988727085,\"numberOfChunks\":1662588727},\"id\":\"yzvqt\",\"name\":\"nubexk\",\"type\":\"zksmondj\"}") .toObject(FileDetailsInner.class); - Assertions.assertEquals(1250108412, model.chunkSize()); - Assertions.assertEquals(239999895, model.fileSize()); - Assertions.assertEquals(659977632, model.numberOfChunks()); + Assertions.assertEquals(938616277, model.chunkSize()); + Assertions.assertEquals(988727085, model.fileSize()); + Assertions.assertEquals(1662588727, model.numberOfChunks()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { FileDetailsInner model - = new FileDetailsInner().withChunkSize(1250108412).withFileSize(239999895).withNumberOfChunks(659977632); + = new FileDetailsInner().withChunkSize(938616277).withFileSize(988727085).withNumberOfChunks(1662588727); model = BinaryData.fromObject(model).toObject(FileDetailsInner.class); - Assertions.assertEquals(1250108412, model.chunkSize()); - Assertions.assertEquals(239999895, model.fileSize()); - Assertions.assertEquals(659977632, model.numberOfChunks()); + Assertions.assertEquals(938616277, model.chunkSize()); + Assertions.assertEquals(988727085, model.fileSize()); + Assertions.assertEquals(1662588727, 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 dbb8ef5fac88..90aaa88c3717 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,21 +12,21 @@ public final class FileDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileDetailsProperties model = BinaryData.fromString( - "{\"createdOn\":\"2021-09-11T16:48:39Z\",\"chunkSize\":1819295736,\"fileSize\":1347899854,\"numberOfChunks\":1050448020}") + "{\"createdOn\":\"2021-10-31T06:50:30Z\",\"chunkSize\":1083170526,\"fileSize\":1371154692,\"numberOfChunks\":326974416}") .toObject(FileDetailsProperties.class); - Assertions.assertEquals(1819295736, model.chunkSize()); - Assertions.assertEquals(1347899854, model.fileSize()); - Assertions.assertEquals(1050448020, model.numberOfChunks()); + Assertions.assertEquals(1083170526, model.chunkSize()); + Assertions.assertEquals(1371154692, model.fileSize()); + Assertions.assertEquals(326974416, model.numberOfChunks()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - FileDetailsProperties model = new FileDetailsProperties().withChunkSize(1819295736) - .withFileSize(1347899854) - .withNumberOfChunks(1050448020); + FileDetailsProperties model = new FileDetailsProperties().withChunkSize(1083170526) + .withFileSize(1371154692) + .withNumberOfChunks(326974416); model = BinaryData.fromObject(model).toObject(FileDetailsProperties.class); - Assertions.assertEquals(1819295736, model.chunkSize()); - Assertions.assertEquals(1347899854, model.fileSize()); - Assertions.assertEquals(1050448020, model.numberOfChunks()); + Assertions.assertEquals(1083170526, model.chunkSize()); + Assertions.assertEquals(1371154692, model.fileSize()); + Assertions.assertEquals(326974416, 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 4db2ffa9d7df..1cdca1d2d617 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,13 +11,7 @@ public final class FileWorkspaceDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileWorkspaceDetailsInner model = BinaryData.fromString( - "{\"properties\":{\"createdOn\":\"2021-11-23T06:55:57Z\",\"expirationTime\":\"2021-04-22T09:32:34Z\"},\"id\":\"hhszh\",\"name\":\"d\",\"type\":\"lvwiwubmwmbesl\"}") + "{\"properties\":{\"createdOn\":\"2021-11-05T08:24:08Z\",\"expirationTime\":\"2021-10-31T18:24:05Z\"},\"id\":\"cpdggkzzlvmbmp\",\"name\":\"xmodf\",\"type\":\"uefywsbpfvmwy\"}") .toObject(FileWorkspaceDetailsInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileWorkspaceDetailsInner model = new FileWorkspaceDetailsInner(); - model = BinaryData.fromObject(model).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 b5d400abce33..8967ff0e290f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,13 +11,7 @@ public final class FileWorkspaceDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FileWorkspaceDetailsProperties model = BinaryData - .fromString("{\"createdOn\":\"2021-09-29T12:41:57Z\",\"expirationTime\":\"2020-12-30T08:12:48Z\"}") + .fromString("{\"createdOn\":\"2021-09-11T11:11:45Z\",\"expirationTime\":\"2021-01-24T04:18:46Z\"}") .toObject(FileWorkspaceDetailsProperties.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileWorkspaceDetailsProperties model = new FileWorkspaceDetailsProperties(); - model = BinaryData.fromObject(model).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 d01c7dd6f7b6..4ee80d40a03d 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; @@ -20,17 +20,17 @@ public final class FileWorkspacesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-08-19T13:21:57Z\",\"expirationTime\":\"2021-04-19T12:51:33Z\"},\"id\":\"zqlqhyc\",\"name\":\"vodggxdbee\",\"type\":\"mieknlraria\"}"; + = "{\"properties\":{\"createdOn\":\"2021-07-13T16:54:43Z\",\"expirationTime\":\"2021-09-03T11:50:17Z\"},\"id\":\"suxswqrntvlwijp\",\"name\":\"ttexoqqpwcyyufmh\",\"type\":\"uncuw\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileWorkspaceDetails response - = manager.fileWorkspaces().createWithResponse("hnze", com.azure.core.util.Context.NONE).getValue(); + = manager.fileWorkspaces().createWithResponse("xqnrkcxk", 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 7aba8218deca..b59fb9e4911b 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; @@ -20,17 +20,17 @@ public final class FileWorkspacesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-07-04T04:35:49Z\",\"expirationTime\":\"2021-03-05T05:54Z\"},\"id\":\"ffukiscvw\",\"name\":\"zhwplefaxvxilc\",\"type\":\"tg\"}"; + = "{\"properties\":{\"createdOn\":\"2021-06-26T19:34:43Z\",\"expirationTime\":\"2021-10-06T23:10:28Z\"},\"id\":\"srzpgepqtybbww\",\"name\":\"gdakchz\",\"type\":\"vl\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileWorkspaceDetails response - = manager.fileWorkspaces().getWithResponse("jnaeois", com.azure.core.util.Context.NONE).getValue(); + = manager.fileWorkspaces().getWithResponse("svfuurutlwexxwl", 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 65d480ba1657..5c7aa6c5d177 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; @@ -20,17 +20,17 @@ public final class FileWorkspacesNoSubscriptionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-06-16T11:37:33Z\",\"expirationTime\":\"2021-03-28T18:59:19Z\"},\"id\":\"bugrj\",\"name\":\"cto\",\"type\":\"cmisofie\"}"; + = "{\"properties\":{\"createdOn\":\"2021-04-25T17:20:31Z\",\"expirationTime\":\"2021-11-30T11:24:50Z\"},\"id\":\"aubrjtloq\",\"name\":\"fuojrngif\",\"type\":\"rzpasccbiuimzdly\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileWorkspaceDetails response = manager.fileWorkspacesNoSubscriptions() - .createWithResponse("ozuxylfsbtkadpys", com.azure.core.util.Context.NONE) + .createWithResponse("qqoli", 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 a705327c1e94..05c4abc1f47b 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileWorkspaceDetails; @@ -20,17 +20,17 @@ public final class FileWorkspacesNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-09-23T05:34:47Z\",\"expirationTime\":\"2021-06-07T02:49:09Z\"},\"id\":\"iagtc\",\"name\":\"jocqwogfnzjvusf\",\"type\":\"ld\"}"; + = "{\"properties\":{\"createdOn\":\"2021-11-11T00:02:33Z\",\"expirationTime\":\"2021-04-24T08:22:39Z\"},\"id\":\"fpch\",\"name\":\"qbnj\",\"type\":\"rcgegydcwboxjum\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileWorkspaceDetails response = manager.fileWorkspacesNoSubscriptions() - .getWithResponse("wiuagydwqf", com.azure.core.util.Context.NONE) + .getWithResponse("qspkcdqzhlctd", 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 ee43ff38c599..f6376cc49327 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; @@ -21,25 +21,25 @@ public final class FilesCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-09-06T02:43:55Z\",\"chunkSize\":1964101220,\"fileSize\":527338272,\"numberOfChunks\":1341869205},\"id\":\"hyrpetogebjoxs\",\"name\":\"hvnh\",\"type\":\"abrqnkkzj\"}"; + = "{\"properties\":{\"createdOn\":\"2021-06-13T15:29:29Z\",\"chunkSize\":2099801683,\"fileSize\":1261691522,\"numberOfChunks\":1860731641},\"id\":\"qdsmexiit\",\"name\":\"fuxtyasiibmiybnn\",\"type\":\"stgnl\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileDetails response = manager.files() - .define("bgq") - .withExistingFileWorkspace("fmmfblcqcu") - .withChunkSize(1522947792) - .withFileSize(1749229509) - .withNumberOfChunks(1690066547) + .define("jrnwxacev") + .withExistingFileWorkspace("xl") + .withChunkSize(1137200728) + .withFileSize(2050950039) + .withNumberOfChunks(1175028140) .create(); - Assertions.assertEquals(1964101220, response.chunkSize()); - Assertions.assertEquals(527338272, response.fileSize()); - Assertions.assertEquals(1341869205, response.numberOfChunks()); + Assertions.assertEquals(2099801683, response.chunkSize()); + Assertions.assertEquals(1261691522, response.fileSize()); + Assertions.assertEquals(1860731641, 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 d5bbe7e00ac1..f0f86b05ab4e 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; @@ -21,20 +21,20 @@ public final class FilesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-03-09T08:38:36Z\",\"chunkSize\":966273213,\"fileSize\":1305858117,\"numberOfChunks\":272678412},\"id\":\"qovekqvgqou\",\"name\":\"ifzmpjwyivqi\",\"type\":\"f\"}"; + = "{\"properties\":{\"createdOn\":\"2021-05-05T15:09:59Z\",\"chunkSize\":539437826,\"fileSize\":617076882,\"numberOfChunks\":2030904290},\"id\":\"mdxotngfdgu\",\"name\":\"eyzihgrky\",\"type\":\"i\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileDetails response - = manager.files().getWithResponse("rgnowcjhfgm", "ecactx", com.azure.core.util.Context.NONE).getValue(); + = manager.files().getWithResponse("dfqwmkyoq", "fdvruz", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals(966273213, response.chunkSize()); - Assertions.assertEquals(1305858117, response.fileSize()); - Assertions.assertEquals(272678412, response.numberOfChunks()); + Assertions.assertEquals(539437826, response.chunkSize()); + Assertions.assertEquals(617076882, response.fileSize()); + Assertions.assertEquals(2030904290, 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 cdf6d2b17ee5..caf9adc4d09f 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; @@ -22,19 +22,19 @@ public final class FilesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-02-12T18:50:03Z\",\"chunkSize\":359045420,\"fileSize\":1283952114,\"numberOfChunks\":362693256},\"id\":\"cp\",\"name\":\"cwkhihi\",\"type\":\"lhzdsqtzb\"}]}"; + = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-11-11T00:30:43Z\",\"chunkSize\":474168225,\"fileSize\":763875657,\"numberOfChunks\":1052982888},\"id\":\"gzfc\",\"name\":\"bgomfgbegl\",\"type\":\"gleohi\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response = manager.files().list("pe", com.azure.core.util.Context.NONE); + PagedIterable response = manager.files().list("absnmfpp", com.azure.core.util.Context.NONE); - Assertions.assertEquals(359045420, response.iterator().next().chunkSize()); - Assertions.assertEquals(1283952114, response.iterator().next().fileSize()); - Assertions.assertEquals(362693256, response.iterator().next().numberOfChunks()); + Assertions.assertEquals(474168225, response.iterator().next().chunkSize()); + Assertions.assertEquals(763875657, response.iterator().next().fileSize()); + Assertions.assertEquals(1052982888, 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 769806d2f3cf..ca8b13c1e998 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 @@ -1,37 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; -import com.azure.resourcemanager.support.models.FilesListResult; -import java.util.Arrays; +import com.azure.resourcemanager.support.implementation.models.FilesListResult; import org.junit.jupiter.api.Assertions; public final class FilesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { FilesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"createdOn\":\"2021-05-13T14:02:05Z\",\"chunkSize\":799059143,\"fileSize\":1248501015,\"numberOfChunks\":712173581},\"id\":\"konzmnsik\",\"name\":\"mkqzeqqkdltfzxmh\",\"type\":\"v\"}],\"nextLink\":\"ur\"}") + "{\"nextLink\":\"kopkwhojvpajqgx\",\"value\":[{\"properties\":{\"createdOn\":\"2020-12-21T19:48:14Z\",\"chunkSize\":1861395903,\"fileSize\":1729730350,\"numberOfChunks\":484454898},\"id\":\"cxozapvhelxp\",\"name\":\"glyatddckcbcuej\",\"type\":\"jxgciqibrh\"},{\"properties\":{\"createdOn\":\"2021-01-18T20:01:11Z\",\"chunkSize\":1655789286,\"fileSize\":656063523,\"numberOfChunks\":218775906},\"id\":\"m\",\"name\":\"bmrqyibahwfl\",\"type\":\"szdtmhrkwof\"},{\"properties\":{\"createdOn\":\"2021-02-28T16:21:21Z\",\"chunkSize\":1338367817,\"fileSize\":354911524,\"numberOfChunks\":1486476697},\"id\":\"pbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}]}") .toObject(FilesListResult.class); - 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(799059143).withFileSize(1248501015).withNumberOfChunks(712173581))) - .withNextLink("ur"); - model = BinaryData.fromObject(model).toObject(FilesListResult.class); - 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()); + Assertions.assertEquals("kopkwhojvpajqgx", model.nextLink()); + Assertions.assertEquals(1861395903, model.value().get(0).chunkSize()); + Assertions.assertEquals(1729730350, model.value().get(0).fileSize()); + Assertions.assertEquals(484454898, model.value().get(0).numberOfChunks()); } } 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 05d0581360aa..f11e04915120 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.fluent.models.FileDetailsInner; @@ -22,23 +22,23 @@ public final class FilesNoSubscriptionsCreateWithResponseMockTests { @Test public void testCreateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-06-27T13:13:13Z\",\"chunkSize\":1740217746,\"fileSize\":1527837396,\"numberOfChunks\":1693425826},\"id\":\"h\",\"name\":\"immbcx\",\"type\":\"h\"}"; + = "{\"properties\":{\"createdOn\":\"2021-05-14T22:34:06Z\",\"chunkSize\":1276799323,\"fileSize\":1463060952,\"numberOfChunks\":1122650657},\"id\":\"mcdzsufcohdxbz\",\"name\":\"mcmuapc\",\"type\":\"hdbevwqqxeyskon\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileDetails response = manager.filesNoSubscriptions() - .createWithResponse("aaomylweazu", "cse", - new FileDetailsInner().withChunkSize(1128305959).withFileSize(574230298).withNumberOfChunks(307378678), + .createWithResponse("ftpmdtzfjltfv", "zcyjtot", + new FileDetailsInner().withChunkSize(340160098).withFileSize(580165383).withNumberOfChunks(369514238), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(1740217746, response.chunkSize()); - Assertions.assertEquals(1527837396, response.fileSize()); - Assertions.assertEquals(1693425826, response.numberOfChunks()); + Assertions.assertEquals(1276799323, response.chunkSize()); + Assertions.assertEquals(1463060952, response.fileSize()); + Assertions.assertEquals(1122650657, 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 9df40e1c6400..db671aff97e0 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; @@ -21,21 +21,21 @@ public final class FilesNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"createdOn\":\"2021-05-29T18:36:16Z\",\"chunkSize\":2128381794,\"fileSize\":23704541,\"numberOfChunks\":654985035},\"id\":\"ltlwtjjguktalhs\",\"name\":\"vkcdmxzr\",\"type\":\"oaimlnw\"}"; + = "{\"properties\":{\"createdOn\":\"2021-04-26T01:10:25Z\",\"chunkSize\":256597525,\"fileSize\":877094344,\"numberOfChunks\":307968762},\"id\":\"wy\",\"name\":\"undmbx\",\"type\":\"ugcmjkavlgorb\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); FileDetails response = manager.filesNoSubscriptions() - .getWithResponse("pimaqxzhemjyh", "hujswtwkozzwcul", com.azure.core.util.Context.NONE) + .getWithResponse("hnmgixhcm", "vmqfoud", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(2128381794, response.chunkSize()); - Assertions.assertEquals(23704541, response.fileSize()); - Assertions.assertEquals(654985035, response.numberOfChunks()); + Assertions.assertEquals(256597525, response.chunkSize()); + Assertions.assertEquals(877094344, response.fileSize()); + Assertions.assertEquals(307968762, 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 a424d83ee7e3..7c67072c91d4 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.FileDetails; @@ -22,20 +22,20 @@ public final class FilesNoSubscriptionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-05-20T11:54:02Z\",\"chunkSize\":732133593,\"fileSize\":1032283606,\"numberOfChunks\":2115158777},\"id\":\"xjjs\",\"name\":\"oqbeitpkxzt\",\"type\":\"oobklftidgfcwq\"}]}"; + = "{\"value\":[{\"properties\":{\"createdOn\":\"2021-02-07T07:06:51Z\",\"chunkSize\":250653832,\"fileSize\":1084063720,\"numberOfChunks\":1276136416},\"id\":\"kjjeokbz\",\"name\":\"fezrx\",\"type\":\"czurtlei\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.filesNoSubscriptions().list("jb", com.azure.core.util.Context.NONE); + = manager.filesNoSubscriptions().list("zinkfkbgbzbowxeq", com.azure.core.util.Context.NONE); - Assertions.assertEquals(732133593, response.iterator().next().chunkSize()); - Assertions.assertEquals(1032283606, response.iterator().next().fileSize()); - Assertions.assertEquals(2115158777, response.iterator().next().numberOfChunks()); + Assertions.assertEquals(250653832, response.iterator().next().chunkSize()); + Assertions.assertEquals(1084063720, response.iterator().next().fileSize()); + Assertions.assertEquals(1276136416, 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 dfbead908ff8..64649e5ec3d2 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.UploadFile; @@ -26,11 +26,11 @@ public void testUploadWithResponse() throws Exception { SupportManager manager = SupportManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.filesNoSubscriptions() - .uploadWithResponse("cporxvxcjz", "qizxfpxtgqscjavf", - new UploadFile().withContent("uhdqazk").withChunkIndex(308398935), com.azure.core.util.Context.NONE); + .uploadWithResponse("q", "bkwvzg", new UploadFile().withContent("v").withChunkIndex(2064090558), + 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 7b5594a1e244..06fc7310cb59 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.UploadFile; @@ -26,11 +26,11 @@ public void testUploadWithResponse() throws Exception { SupportManager manager = SupportManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.files() - .uploadWithResponse("cvhrfsp", "uagrttikteusqc", - new UploadFile().withContent("vyklxuby").withChunkIndex(490127820), com.azure.core.util.Context.NONE); + .uploadWithResponse("etnluankrrfx", "eebtijvacvb", + new UploadFile().withContent("z").withChunkIndex(32108213), 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 new file mode 100644 index 000000000000..1ee3680a3ef0 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdRequestTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.LookUpResourceIdRequestType; +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\":\"fbkrvrnsvs\",\"type\":\"Microsoft.Support/supportTickets\"}") + .toObject(LookUpResourceIdRequest.class); + Assertions.assertEquals("fbkrvrnsvs", model.identifier()); + Assertions.assertEquals(LookUpResourceIdRequestType.MICROSOFT_SUPPORT_SUPPORT_TICKETS, model.type()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + LookUpResourceIdRequest model = new LookUpResourceIdRequest().withIdentifier("fbkrvrnsvs") + .withType(LookUpResourceIdRequestType.MICROSOFT_SUPPORT_SUPPORT_TICKETS); + model = BinaryData.fromObject(model).toObject(LookUpResourceIdRequest.class); + Assertions.assertEquals("fbkrvrnsvs", model.identifier()); + Assertions.assertEquals(LookUpResourceIdRequestType.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 new file mode 100644 index 000000000000..c8c11402b9e3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/LookUpResourceIdResponseInnerTests.java @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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\":\"hxcr\"}").toObject(LookUpResourceIdResponseInner.class); + Assertions.assertEquals("hxcr", model.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 02a87786bd21..0a14f108f1f8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,17 +12,9 @@ public final class MessagePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { MessageProperties model = BinaryData.fromString( - "{\"communicationDirection\":\"outbound\",\"sender\":\"dsslswt\",\"body\":\"eriofzpyqs\",\"createdDate\":\"2021-06-06T05:20:48Z\"}") + "{\"contentType\":\"iwubmwmbesldnk\",\"communicationDirection\":\"inbound\",\"sender\":\"pjflcxogao\",\"body\":\"nzmnsikvm\",\"createdDate\":\"2021-05-13T18:51:38Z\"}") .toObject(MessageProperties.class); - 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("dsslswt").withBody("eriofzpyqs"); - model = BinaryData.fromObject(model).toObject(MessageProperties.class); - Assertions.assertEquals("dsslswt", model.sender()); - Assertions.assertEquals("eriofzpyqs", model.body()); + Assertions.assertEquals("pjflcxogao", model.sender()); + Assertions.assertEquals("nzmnsikvm", model.body()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationDisplayTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationDisplayTests.java index ae7c12dcf953..03f0165a919e 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationDisplayTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,13 +11,7 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"description\":\"fcqhsmyurkd\",\"operation\":\"lx\",\"provider\":\"kuksjtxukcdm\",\"resource\":\"rcryuanzwuxzdxta\"}") + "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}") .toObject(OperationDisplay.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationInnerTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationInnerTests.java index 9589f1aedd83..8797216478e8 100644 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationInnerTests.java +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationInnerTests.java @@ -1,24 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.support.fluent.models.OperationInner; -import com.azure.resourcemanager.support.models.OperationDisplay; public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"dkfo\",\"display\":{\"description\":\"ygjofjdd\",\"operation\":\"s\",\"provider\":\"eupewnwreitjz\",\"resource\":\"lusarh\"}}") + "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") .toObject(OperationInner.class); } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationListResultTests.java new file mode 100644 index 000000000000..a836facbe6c8 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationListResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.implementation.models.OperationListResult; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("kfo", model.nextLink()); + } +} 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 0dce6bff6908..2f38649e6a88 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Operation; @@ -21,14 +21,14 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"l\",\"display\":{\"description\":\"u\",\"operation\":\"auwzizxbmpgc\",\"provider\":\"fuzmuvpbtt\",\"resource\":\"morppxebmnzbtbh\"}}]}"; + = "{\"value\":[{\"name\":\"asipqiio\",\"isDataAction\":true,\"display\":{\"provider\":\"rpqlp\",\"resource\":\"cciuqgbdbutau\",\"operation\":\"btkuwhh\",\"description\":\"ykojoxafnndlpic\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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/OperationsListResultTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationsListResultTests.java deleted file mode 100644 index 7963ce9cfb4d..000000000000 --- a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/OperationsListResultTests.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.fluent.models.OperationInner; -import com.azure.resourcemanager.support.models.OperationDisplay; -import com.azure.resourcemanager.support.models.OperationsListResult; -import java.util.Arrays; - -public final class OperationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationsListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"display\":{\"description\":\"zopbsphrupidgs\",\"operation\":\"bejhphoycmsxa\",\"provider\":\"hdxbmtqio\",\"resource\":\"zehtbmu\"}},{\"name\":\"ownoizhw\",\"display\":{\"description\":\"ybqsoqijg\",\"operation\":\"mbpazlobcufpdzn\",\"provider\":\"t\",\"resource\":\"qjnqglhqgnufoooj\"}},{\"name\":\"ifsqesaagdfmg\",\"display\":{\"description\":\"hjxri\",\"operation\":\"wmrvktsizntocipa\",\"provider\":\"ajpsquc\",\"resource\":\"o\"}}]}") - .toObject(OperationsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationsListResult model = new OperationsListResult() - .withValue(Arrays.asList(new OperationInner().withDisplay(new OperationDisplay()), - new OperationInner().withDisplay(new OperationDisplay()), - new OperationInner().withDisplay(new OperationDisplay()))); - model = BinaryData.fromObject(model).toObject(OperationsListResult.class); - } -} 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 f28316705b7c..0fa3ba45b902 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 @@ -1,36 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.SecondaryConsentEnabled; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ProblemClassificationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProblemClassificationInner model = BinaryData.fromString( - "{\"id\":\"rokft\",\"name\":\"olniwpwcukjf\",\"type\":\"iawxklry\",\"properties\":{\"displayName\":\"ckbasyypndd\",\"secondaryConsentEnabled\":[{\"description\":\"bacphejko\",\"type\":\"nqgoulzndli\"},{\"description\":\"yqkgfg\",\"type\":\"madgakeqsrxyb\"},{\"description\":\"qedqytbciqfoufl\",\"type\":\"nkzsmodmglou\"}]}}") + "{\"properties\":{\"displayName\":\"cbkbfkg\",\"secondaryConsentEnabled\":[{\"description\":\"exxppofmxaxcfjp\",\"type\":\"dtocj\"},{\"description\":\"hvpmoue\",\"type\":\"dzxibqeojnxqbzvd\"},{\"description\":\"t\",\"type\":\"deicbtwnpzao\"}]},\"id\":\"uhrhcffcyddgl\",\"name\":\"jthjqkwpyei\",\"type\":\"xmqci\"}") .toObject(ProblemClassificationInner.class); - 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("ckbasyypndd") - .withSecondaryConsentEnabled( - 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("ckbasyypndd", model.displayName()); - Assertions.assertEquals("bacphejko", model.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("nqgoulzndli", model.secondaryConsentEnabled().get(0).type()); + Assertions.assertEquals("cbkbfkg", model.displayName()); + Assertions.assertEquals("exxppofmxaxcfjp", model.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("dtocj", model.secondaryConsentEnabled().get(0).type()); } } 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 index 6ada29f5493a..f3338f7ee9d3 100644 --- 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 @@ -1,34 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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\"}]}") + "{\"displayName\":\"vhkhixu\",\"secondaryConsentEnabled\":[{\"description\":\"opbobj\",\"type\":\"hm\"},{\"description\":\"u\",\"type\":\"a\"}]}") .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()); + Assertions.assertEquals("vhkhixu", model.displayName()); + Assertions.assertEquals("opbobj", model.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("hm", 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 new file mode 100644 index 000000000000..4f3d30b73c72 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationInputTests.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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\":\"algbquxigjyjg\",\"resourceId\":\"aoyfhrtxilnerkuj\"}") + .toObject(ProblemClassificationsClassificationInput.class); + Assertions.assertEquals("algbquxigjyjg", model.issueSummary()); + Assertions.assertEquals("aoyfhrtxilnerkuj", model.resourceId()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProblemClassificationsClassificationInput model + = new ProblemClassificationsClassificationInput().withIssueSummary("algbquxigjyjg") + .withResourceId("aoyfhrtxilnerkuj"); + model = BinaryData.fromObject(model).toObject(ProblemClassificationsClassificationInput.class); + Assertions.assertEquals("algbquxigjyjg", model.issueSummary()); + Assertions.assertEquals("aoyfhrtxilnerkuj", 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 new file mode 100644 index 000000000000..3788c783ab80 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationOutputInnerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.fluent.models.ProblemClassificationsClassificationOutputInner; +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\":\"eju\",\"title\":\"qawrlyxwj\",\"description\":\"prbnwbxgjvtbv\",\"serviceId\":\"sszdnru\",\"problemClassificationId\":\"guhmuouqfpr\",\"relatedService\":{\"serviceId\":\"bngui\",\"displayName\":\"wu\",\"resourceTypes\":[\"a\",\"x\"]},\"articleId\":\"izuckyfihrfidfvz\"},{\"problemId\":\"zuhtymwisdkfthwx\",\"title\":\"t\",\"description\":\"waopvkmijcmmxd\",\"serviceId\":\"fufsrpymzi\",\"problemClassificationId\":\"sezcxtb\",\"relatedService\":{\"serviceId\":\"fycc\",\"displayName\":\"ewmdw\",\"resourceTypes\":[\"iachbo\",\"sflnrosfqp\",\"eeh\",\"zvypyqrimzinp\"]},\"articleId\":\"wjdk\"},{\"problemId\":\"soodqxhcrmnoh\",\"title\":\"ckwhds\",\"description\":\"fiyipjxsqwpgrj\",\"serviceId\":\"norcjxvsnbyxqab\",\"problemClassificationId\":\"ocpcy\",\"relatedService\":{\"serviceId\":\"rzafbljjgpbtoqcj\",\"displayName\":\"ljavbqid\",\"resourceTypes\":[\"jzyulpk\",\"dj\"]},\"articleId\":\"lkhbz\"}]}") + .toObject(ProblemClassificationsClassificationOutputInner.class); + Assertions.assertEquals("a", + model.problemClassificationResults().get(0).relatedService().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 new file mode 100644 index 000000000000..58b9c6f6534a --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ProblemClassificationsClassificationResultTests.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.models.ProblemClassificationsClassificationResult; +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\":\"epgzgqexz\",\"title\":\"c\",\"description\":\"c\",\"serviceId\":\"ierhhbcsglummaj\",\"problemClassificationId\":\"aodxo\",\"relatedService\":{\"serviceId\":\"dxkqpx\",\"displayName\":\"ajionpimexgstxg\",\"resourceTypes\":[\"dg\",\"aajrm\",\"djwzrlov\",\"clwhijcoejctbz\"]},\"articleId\":\"s\"}") + .toObject(ProblemClassificationsClassificationResult.class); + Assertions.assertEquals("dg", model.relatedService().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 22c260a63961..089dc3b9b3e0 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ProblemClassification; @@ -21,21 +21,21 @@ public final class ProblemClassificationsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"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\"}]}}"; + = "{\"properties\":{\"displayName\":\"imerqfobwyznk\",\"secondaryConsentEnabled\":[{\"description\":\"t\",\"type\":\"fhpagmhrskdsnf\"},{\"description\":\"doakgtdlmkkzevdl\",\"type\":\"wpusdsttwvogv\"}]},\"id\":\"ejdcngqqmoakuf\",\"name\":\"m\",\"type\":\"zr\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); ProblemClassification response = manager.problemClassifications() - .getWithResponse("jvp", "jqg", com.azure.core.util.Context.NONE) + .getWithResponse("wtl", "nguxawqaldsy", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("dckcbc", response.displayName()); - Assertions.assertEquals("jxgciqibrh", response.secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("xsdqrhzoymibmrqy", response.secondaryConsentEnabled().get(0).type()); + Assertions.assertEquals("imerqfobwyznk", response.displayName()); + Assertions.assertEquals("t", response.secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("fhpagmhrskdsnf", 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 608193966ce0..2dab6dbbd6ad 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.ProblemClassification; @@ -22,21 +22,20 @@ public final class ProblemClassificationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"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\"}]}}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"u\",\"secondaryConsentEnabled\":[{\"description\":\"pbminr\",\"type\":\"woyuhhziuief\"},{\"description\":\"bhdmsmlmzqhof\",\"type\":\"maequiahxicslfa\"},{\"description\":\"z\",\"type\":\"yylhalnswhccsp\"}]},\"id\":\"aivwitqscywu\",\"name\":\"gwol\",\"type\":\"h\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.problemClassifications().list("d", com.azure.core.util.Context.NONE); + = manager.problemClassifications().list("rdgrtw", com.azure.core.util.Context.NONE); - Assertions.assertEquals("sluicpdggkzz", response.iterator().next().displayName()); - Assertions.assertEquals("mpaxmodfvuefywsb", - response.iterator().next().secondaryConsentEnabled().get(0).description()); - Assertions.assertEquals("vmwy", response.iterator().next().secondaryConsentEnabled().get(0).type()); + Assertions.assertEquals("u", response.iterator().next().displayName()); + Assertions.assertEquals("pbminr", response.iterator().next().secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("woyuhhziuief", 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 e39a282f36b7..0520cb2379fe 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 @@ -1,49 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.models.ProblemClassificationsListResult; -import com.azure.resourcemanager.support.models.SecondaryConsentEnabled; -import java.util.Arrays; +import com.azure.resourcemanager.support.implementation.models.ProblemClassificationsListResult; import org.junit.jupiter.api.Assertions; public final class ProblemClassificationsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ProblemClassificationsListResult model = BinaryData.fromString( - "{\"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\"}]}}]}") + "{\"nextLink\":\"otkftutqxlngx\",\"value\":[{\"properties\":{\"displayName\":\"gnxkrxdqmidtth\",\"secondaryConsentEnabled\":[{\"description\":\"drabhjybige\",\"type\":\"qfbow\"},{\"description\":\"anyktzlcuiywg\",\"type\":\"wgndrvynhzgpp\"}]},\"id\":\"cgyncocpecf\",\"name\":\"m\",\"type\":\"coofsxlzev\"},{\"properties\":{\"displayName\":\"qjqabcypmivkwl\",\"secondaryConsentEnabled\":[{\"description\":\"c\",\"type\":\"nfnbacfionlebxe\"},{\"description\":\"gtzxdpn\",\"type\":\"qqwx\"}]},\"id\":\"feallnwsu\",\"name\":\"isnjampmngnz\",\"type\":\"c\"},{\"properties\":{\"displayName\":\"wooc\",\"secondaryConsentEnabled\":[{\"description\":\"nqvpkvlrxnje\",\"type\":\"eipheoflokeyy\"},{\"description\":\"nj\",\"type\":\"lwtgrhpdj\"},{\"description\":\"umasxazjpq\",\"type\":\"gual\"},{\"description\":\"xxhejjzzvd\",\"type\":\"gwdslfhotwm\"}]},\"id\":\"npwlbjnpg\",\"name\":\"cftadeh\",\"type\":\"nltyfsoppusuesnz\"},{\"properties\":{\"displayName\":\"jbavorxzdm\",\"secondaryConsentEnabled\":[{\"description\":\"bqvudwxdndn\",\"type\":\"w\"},{\"description\":\"jjugwdkcglhslaz\",\"type\":\"yggdtjixh\"},{\"description\":\"uofqwe\",\"type\":\"hmenevfyexfwhybc\"}]},\"id\":\"vyvdcs\",\"name\":\"tynnaamdectehfi\",\"type\":\"scjeypv\"}]}") .toObject(ProblemClassificationsListResult.class); - 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("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("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()); + Assertions.assertEquals("otkftutqxlngx", model.nextLink()); + Assertions.assertEquals("gnxkrxdqmidtth", model.value().get(0).displayName()); + Assertions.assertEquals("drabhjybige", model.value().get(0).secondaryConsentEnabled().get(0).description()); + Assertions.assertEquals("qfbow", model.value().get(0).secondaryConsentEnabled().get(0).type()); } } 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 8b43677ee303..c33d8ee870d8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,17 +11,17 @@ public final class QuotaChangeRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - QuotaChangeRequest model = BinaryData.fromString("{\"region\":\"ldawkzbaliourqha\",\"payload\":\"uhashsfwx\"}") + QuotaChangeRequest model = BinaryData.fromString("{\"region\":\"scwsv\",\"payload\":\"otogtwrupqs\"}") .toObject(QuotaChangeRequest.class); - Assertions.assertEquals("ldawkzbaliourqha", model.region()); - Assertions.assertEquals("uhashsfwx", model.payload()); + Assertions.assertEquals("scwsv", model.region()); + Assertions.assertEquals("otogtwrupqs", model.payload()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaChangeRequest model = new QuotaChangeRequest().withRegion("ldawkzbaliourqha").withPayload("uhashsfwx"); + QuotaChangeRequest model = new QuotaChangeRequest().withRegion("scwsv").withPayload("otogtwrupqs"); model = BinaryData.fromObject(model).toObject(QuotaChangeRequest.class); - Assertions.assertEquals("ldawkzbaliourqha", model.region()); - Assertions.assertEquals("uhashsfwx", model.payload()); + Assertions.assertEquals("scwsv", model.region()); + Assertions.assertEquals("otogtwrupqs", 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 3c73035ca3bf..b6a575a1880d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -14,24 +14,26 @@ public final class QuotaTicketDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { QuotaTicketDetails model = BinaryData.fromString( - "{\"quotaChangeRequestSubType\":\"exq\",\"quotaChangeRequestVersion\":\"fadmws\",\"quotaChangeRequests\":[{\"region\":\"vxpvgomz\",\"payload\":\"misgwbnb\"}]}") + "{\"quotaChangeRequestSubType\":\"ighxpk\",\"quotaChangeRequestVersion\":\"zb\",\"quotaChangeRequests\":[{\"region\":\"bbaumnyquped\",\"payload\":\"jn\"},{\"region\":\"ckhsmtxpsieb\",\"payload\":\"hvpesapskrdqm\"},{\"region\":\"jdhtldwkyzxu\",\"payload\":\"kn\"}]}") .toObject(QuotaTicketDetails.class); - 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()); + Assertions.assertEquals("ighxpk", model.quotaChangeRequestSubType()); + Assertions.assertEquals("zb", model.quotaChangeRequestVersion()); + Assertions.assertEquals("bbaumnyquped", model.quotaChangeRequests().get(0).region()); + Assertions.assertEquals("jn", model.quotaChangeRequests().get(0).payload()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - QuotaTicketDetails model = new QuotaTicketDetails().withQuotaChangeRequestSubType("exq") - .withQuotaChangeRequestVersion("fadmws") + QuotaTicketDetails model = new QuotaTicketDetails().withQuotaChangeRequestSubType("ighxpk") + .withQuotaChangeRequestVersion("zb") .withQuotaChangeRequests( - Arrays.asList(new QuotaChangeRequest().withRegion("vxpvgomz").withPayload("misgwbnb"))); + Arrays.asList(new QuotaChangeRequest().withRegion("bbaumnyquped").withPayload("jn"), + new QuotaChangeRequest().withRegion("ckhsmtxpsieb").withPayload("hvpesapskrdqm"), + new QuotaChangeRequest().withRegion("jdhtldwkyzxu").withPayload("kn"))); model = BinaryData.fromObject(model).toObject(QuotaTicketDetails.class); - 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()); + Assertions.assertEquals("ighxpk", model.quotaChangeRequestSubType()); + Assertions.assertEquals("zb", model.quotaChangeRequestVersion()); + Assertions.assertEquals("bbaumnyquped", model.quotaChangeRequests().get(0).region()); + Assertions.assertEquals("jn", 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 96ef9ad92087..987a9318a7c8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,19 +11,9 @@ public final class SecondaryConsentEnabledTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - 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("bbjfddgmbmbexp").withType("htqqrolfp"); - model = BinaryData.fromObject(model).toObject(SecondaryConsentEnabled.class); - Assertions.assertEquals("bbjfddgmbmbexp", model.description()); - Assertions.assertEquals("htqqrolfp", model.type()); + SecondaryConsentEnabled model = BinaryData.fromString("{\"description\":\"rzayv\",\"type\":\"pgvdf\"}") + .toObject(SecondaryConsentEnabled.class); + Assertions.assertEquals("rzayv", model.description()); + Assertions.assertEquals("pgvdf", 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 1df2d23da65b..b024759a95f0 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -13,16 +13,16 @@ public final class SecondaryConsentTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SecondaryConsent model - = BinaryData.fromString("{\"userConsent\":\"Yes\",\"type\":\"z\"}").toObject(SecondaryConsent.class); + = BinaryData.fromString("{\"userConsent\":\"Yes\",\"type\":\"i\"}").toObject(SecondaryConsent.class); Assertions.assertEquals(UserConsent.YES, model.userConsent()); - Assertions.assertEquals("z", model.type()); + Assertions.assertEquals("i", model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SecondaryConsent model = new SecondaryConsent().withUserConsent(UserConsent.YES).withType("z"); + SecondaryConsent model = new SecondaryConsent().withUserConsent(UserConsent.YES).withType("i"); model = BinaryData.fromObject(model).toObject(SecondaryConsent.class); Assertions.assertEquals(UserConsent.YES, model.userConsent()); - Assertions.assertEquals("z", model.type()); + Assertions.assertEquals("i", 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 new file mode 100644 index 000000000000..ac1738bd0b35 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationAnswerTests.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.models.ServiceClassificationAnswer; +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\":\"xolniwpwcukjfk\",\"displayName\":\"awxklr\",\"resourceTypes\":[\"wckbasyypnd\",\"hsgcbacphejkot\",\"nqgoulzndli\",\"wyqkgfgibm\"]},\"serviceId\":\"gakeqsr\",\"displayName\":\"bzqqedqytbciq\",\"resourceTypes\":[\"flmmnk\",\"smodmgloug\"]}") + .toObject(ServiceClassificationAnswer.class); + Assertions.assertEquals("flmmnk", model.resourceTypes().get(0)); + Assertions.assertEquals("wckbasyypnd", 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 new file mode 100644 index 000000000000..67cc891b9dc1 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationOutputInnerTests.java @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.support.fluent.models.ServiceClassificationOutputInner; +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\":\"suuv\",\"displayName\":\"jozkrwfndiod\",\"resourceTypes\":[\"lwejdpv\",\"ryo\",\"psoacctazakljl\"]},\"serviceId\":\"bcryffdfd\",\"displayName\":\"ygexpaojakhmsb\",\"resourceTypes\":[\"crzevdphlx\",\"olthqtrgqjbp\"]},{\"childService\":{\"serviceId\":\"s\",\"displayName\":\"zgvfcjrwz\",\"resourceTypes\":[\"j\",\"felluwfzitonpe\",\"fpjkjlxofp\",\"vhpfxxypininmay\"]},\"serviceId\":\"ybb\",\"displayName\":\"odepoogin\",\"resourceTypes\":[\"mihe\",\"gnarxzxtheo\",\"usivye\"]},{\"childService\":{\"serviceId\":\"iqihn\",\"displayName\":\"ngbwjz\",\"resourceTypes\":[\"ygxgispemvtz\",\"kufubljo\",\"xqeofjaeqjhqjba\",\"v\"]},\"serviceId\":\"mjqulngsn\",\"displayName\":\"bybkzgcwrwclxx\",\"resourceTypes\":[\"jdous\",\"cqvkocrcjdkwtn\"]},{\"childService\":{\"serviceId\":\"njbiksqrglssain\",\"displayName\":\"jwnzlljfmp\",\"resourceTypes\":[\"bvmgxsabkyqduuji\",\"c\",\"czdzev\",\"dhkrwpdappdsbdk\"]},\"serviceId\":\"rwjfe\",\"displayName\":\"nhutjeltmrldhugj\",\"resourceTypes\":[\"atqxho\",\"dgeablgphu\",\"icndvkaozwyifty\",\"xhurok\"]}]}") + .toObject(ServiceClassificationOutputInner.class); + Assertions.assertEquals("crzevdphlx", model.serviceClassificationResults().get(0).resourceTypes().get(0)); + Assertions.assertEquals("lwejdpv", + 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 new file mode 100644 index 000000000000..23334a89d90d --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/ServiceClassificationRequestTests.java @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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\":\"jaqwixjsp\",\"resourceId\":\"zvcputegjvwmfda\",\"additionalContext\":\"cmdv\"}") + .toObject(ServiceClassificationRequest.class); + Assertions.assertEquals("jaqwixjsp", model.issueSummary()); + Assertions.assertEquals("zvcputegjvwmfda", model.resourceId()); + Assertions.assertEquals("cmdv", model.additionalContext()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceClassificationRequest model = new ServiceClassificationRequest().withIssueSummary("jaqwixjsp") + .withResourceId("zvcputegjvwmfda") + .withAdditionalContext("cmdv"); + model = BinaryData.fromObject(model).toObject(ServiceClassificationRequest.class); + Assertions.assertEquals("jaqwixjsp", model.issueSummary()); + Assertions.assertEquals("zvcputegjvwmfda", model.resourceId()); + Assertions.assertEquals("cmdv", model.additionalContext()); + } +} 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 af10e6b7d4d2..b2512dbb5ad5 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 @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.support.fluent.models.ServiceInner; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ServiceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceInner model = BinaryData.fromString( - "{\"id\":\"ctazakljlahbcryf\",\"name\":\"fdosyg\",\"type\":\"paojakhmsbzjh\",\"properties\":{\"displayName\":\"evdphlxaol\",\"resourceTypes\":[\"trg\",\"jbp\",\"zfsinzgvf\",\"jrwzox\"]}}") + "{\"properties\":{\"displayName\":\"jbpzvgnwzsymg\",\"resourceTypes\":[\"fcyzkohdbihanufh\"]},\"id\":\"bj\",\"name\":\"s\",\"type\":\"git\"}") .toObject(ServiceInner.class); - 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("evdphlxaol") - .withResourceTypes(Arrays.asList("trg", "jbp", "zfsinzgvf", "jrwzox")); - model = BinaryData.fromObject(model).toObject(ServiceInner.class); - Assertions.assertEquals("evdphlxaol", model.displayName()); - Assertions.assertEquals("trg", model.resourceTypes().get(0)); + Assertions.assertEquals("jbpzvgnwzsymg", model.displayName()); + Assertions.assertEquals("fcyzkohdbihanufh", 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 cc0cbf764991..641fa2c0ab5a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,7 +11,7 @@ public final class ServiceLevelAgreementTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ServiceLevelAgreement model = BinaryData.fromString( - "{\"startTime\":\"2021-03-01T08:49:54Z\",\"expirationTime\":\"2020-12-25T09:40:11Z\",\"slaMinutes\":1243858380}") + "{\"startTime\":\"2021-01-07T21:55:14Z\",\"expirationTime\":\"2021-10-07T01:44:34Z\",\"slaMinutes\":538990219}") .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 917ed9211faf..1bb7313e32e7 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 @@ -1,30 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.support.fluent.models.ServiceProperties; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class ServicePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - 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("tfell") - .withResourceTypes(Arrays.asList("zitonpeqfpjkjl", "ofpdvh")); - model = BinaryData.fromObject(model).toObject(ServiceProperties.class); - Assertions.assertEquals("tfell", model.displayName()); - Assertions.assertEquals("zitonpeqfpjkjl", model.resourceTypes().get(0)); + ServiceProperties model = BinaryData + .fromString( + "{\"displayName\":\"qhabifpikxwcz\",\"resourceTypes\":[\"cnpqxuhivyqniwby\",\"rkxvdum\",\"grtfwvu\"]}") + .toObject(ServiceProperties.class); + Assertions.assertEquals("qhabifpikxwcz", model.displayName()); + Assertions.assertEquals("cnpqxuhivyqniwby", 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 1fcac5942b5d..6f40051c9448 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Service; @@ -21,18 +21,18 @@ public final class ServicesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"id\":\"wdmhdlxyjrxs\",\"name\":\"afcnih\",\"type\":\"qapnedgfbcv\",\"properties\":{\"displayName\":\"q\",\"resourceTypes\":[\"eqdcv\",\"rhvoods\",\"tbobz\",\"opcjwvnhd\"]}}"; + = "{\"properties\":{\"displayName\":\"dreqnovvqf\",\"resourceTypes\":[\"jxywsuws\",\"rsndsytgadgvra\"]},\"id\":\"en\",\"name\":\"qnzarrwl\",\"type\":\"uu\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - Service response = manager.services().getWithResponse("pnppfuf", com.azure.core.util.Context.NONE).getValue(); + Service response = manager.services().getWithResponse("kcdyhbpk", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("q", response.displayName()); - Assertions.assertEquals("eqdcv", response.resourceTypes().get(0)); + Assertions.assertEquals("dreqnovvqf", response.displayName()); + Assertions.assertEquals("jxywsuws", 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 e145749ec341..36f581ccdcd7 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 @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.Service; @@ -22,18 +22,18 @@ public final class ServicesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"id\":\"glkfg\",\"name\":\"dneu\",\"type\":\"fphsdyhtozfikdow\",\"properties\":{\"displayName\":\"uvxzxclvi\",\"resourceTypes\":[\"qzonosggbhcohf\",\"dsjnka\",\"jutiiswacff\",\"dkzzewkfvhqcrail\"]}}]}"; + = "{\"value\":[{\"properties\":{\"displayName\":\"qkacewii\",\"resourceTypes\":[\"ubjibww\",\"f\"]},\"id\":\"hqkvpuvksgplsak\",\"name\":\"ynfs\",\"type\":\"n\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.services().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("uvxzxclvi", response.iterator().next().displayName()); - Assertions.assertEquals("qzonosggbhcohf", response.iterator().next().resourceTypes().get(0)); + Assertions.assertEquals("qkacewii", response.iterator().next().displayName()); + Assertions.assertEquals("ubjibww", 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 9bc84f26e8b3..e77f0ec1b1a9 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 @@ -1,37 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.ServiceInner; -import com.azure.resourcemanager.support.models.ServicesListResult; -import java.util.Arrays; +import com.azure.resourcemanager.support.implementation.models.ServicesListResult; import org.junit.jupiter.api.Assertions; 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\"]}},{\"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\"]}}]}") + "{\"nextLink\":\"gaudcc\",\"value\":[{\"properties\":{\"displayName\":\"cnyejhkryhtnapcz\",\"resourceTypes\":[\"kjyemkk\",\"ni\"]},\"id\":\"oxzjnchgejspod\",\"name\":\"ailzydehojwyahu\",\"type\":\"inpm\"}]}") .toObject(ServicesListResult.class); - Assertions.assertEquals("rtihfxtijbpz", model.value().get(0).displayName()); - Assertions.assertEquals("wzsymglzufcy", model.value().get(0).resourceTypes().get(0)); - } - - @org.junit.jupiter.api.Test - 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("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)); + Assertions.assertEquals("gaudcc", model.nextLink()); + Assertions.assertEquals("cnyejhkryhtnapcz", model.value().get(0).displayName()); + Assertions.assertEquals("kjyemkk", 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 a536b256569d..29bf77d49f2b 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -10,8 +10,7 @@ public final class SupportEngineerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SupportEngineer model - = BinaryData.fromString("{\"emailAddress\":\"mqkrhahvljuahaqu\"}").toObject(SupportEngineer.class); + SupportEngineer model = BinaryData.fromString("{\"emailAddress\":\"zkd\"}").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 bb7e1e6ec921..7575cf583c6a 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -8,6 +8,8 @@ import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.QuotaChangeRequest; import com.azure.resourcemanager.support.models.QuotaTicketDetails; @@ -25,102 +27,119 @@ public final class SupportTicketDetailsInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportTicketDetailsInner model = BinaryData.fromString( - "{\"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\"}") + "{\"properties\":{\"supportTicketId\":\"vdfwatkpn\",\"description\":\"ulexxbczwtr\",\"problemClassificationId\":\"wiqzbqjvsovmyo\",\"problemClassificationDisplayName\":\"cspkwlhzdobpxjmf\",\"severity\":\"critical\",\"enrollmentId\":\"vnchrkcci\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"qkhr\",\"supportPlanId\":\"jiwkuofoskghsau\",\"contactDetails\":{\"firstName\":\"imjm\",\"lastName\":\"xieduugidyjrr\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"y\",\"additionalEmailAddresses\":[\"v\",\"xc\",\"onpc\",\"hocohslkev\"],\"phoneNumber\":\"ggzfbu\",\"preferredTimeZone\":\"fmvfaxkffeiit\",\"country\":\"lvmezyvshxmzsbbz\",\"preferredSupportLanguage\":\"ggi\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-07-22T08:18:11Z\",\"expirationTime\":\"2021-08-02T21:26:13Z\",\"slaMinutes\":2000842411},\"supportEngineer\":{\"emailAddress\":\"xjnspy\"},\"supportPlanType\":\"tko\",\"supportPlanDisplayName\":\"kouknvudwtiu\",\"title\":\"bldngkpoc\",\"problemStartTime\":\"2021-05-19T00:57:25Z\",\"serviceId\":\"z\",\"serviceDisplayName\":\"o\",\"status\":\"ukgjnpiucgygevq\",\"createdDate\":\"2021-05-23T07:03:19Z\",\"modifiedDate\":\"2021-02-02T09:27:42Z\",\"fileWorkspaceName\":\"rbpizc\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"dpydn\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"xdeoejzic\",\"quotaChangeRequestVersion\":\"fsj\",\"quotaChangeRequests\":[{\"region\":\"fbishcbkha\",\"payload\":\"eyeam\"},{\"region\":\"hagalpbuxwgipwh\",\"payload\":\"ow\"},{\"region\":\"shwankixzbinje\",\"payload\":\"ttmrywnuzoqf\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"n\"},{\"userConsent\":\"No\",\"type\":\"yx\"},{\"userConsent\":\"Yes\",\"type\":\"lsicohoqqnwv\"},{\"userConsent\":\"Yes\",\"type\":\"vwhheunmmqhgyx\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationProcessed\",\"allowedSeverities\":[\"minimal\",\"moderate\",\"critical\",\"critical\"],\"reasonForEscalation\":\"yaxuconuqszfkb\"},\"communityForumPost\":\"pewr\",\"supportChannel\":\"Web\",\"chatConversationStatus\":\"Closed\"},\"id\":\"jektcxsenh\",\"name\":\"lrsf\",\"type\":\"rzpwvlqdqgbiq\"}") .toObject(SupportTicketDetailsInner.class); - Assertions.assertEquals("hwankixzbinjepu", model.supportTicketId()); - Assertions.assertEquals("tmryw", model.description()); - Assertions.assertEquals("uzoqft", model.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); - Assertions.assertEquals("cohoq", model.enrollmentId()); - Assertions.assertEquals(false, model.require24X7Response()); - Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); - 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("vdfwatkpn", model.supportTicketId()); + Assertions.assertEquals("ulexxbczwtr", model.description()); + Assertions.assertEquals("wiqzbqjvsovmyo", model.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.CRITICAL, model.severity()); + Assertions.assertEquals("vnchrkcci", model.enrollmentId()); + Assertions.assertTrue(model.require24X7Response()); + Assertions.assertEquals(Consent.YES, model.advancedDiagnosticConsent()); + Assertions.assertEquals("qkhr", model.problemScopingQuestions()); + Assertions.assertEquals("jiwkuofoskghsau", model.supportPlanId()); + Assertions.assertEquals("imjm", model.contactDetails().firstName()); + Assertions.assertEquals("xieduugidyjrr", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("y", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("v", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("ggzfbu", model.contactDetails().phoneNumber()); + Assertions.assertEquals("fmvfaxkffeiit", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("lvmezyvshxmzsbbz", model.contactDetails().country()); + Assertions.assertEquals("ggi", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("bldngkpoc", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T00:57:25Z"), model.problemStartTime()); + Assertions.assertEquals("z", model.serviceId()); + Assertions.assertEquals("rbpizc", model.fileWorkspaceName()); + Assertions.assertEquals("dpydn", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("xdeoejzic", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("fsj", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("fbishcbkha", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("eyeam", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("xttd", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("n", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_PROCESSED, model.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MINIMAL, model.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("yaxuconuqszfkb", model.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("pewr", model.communityForumPost()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - 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")) + SupportTicketDetailsInner model = new SupportTicketDetailsInner().withSupportTicketId("vdfwatkpn") + .withDescription("ulexxbczwtr") + .withProblemClassificationId("wiqzbqjvsovmyo") + .withSeverity(SeverityLevel.CRITICAL) + .withEnrollmentId("vnchrkcci") + .withRequire24X7Response(true) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions("qkhr") + .withSupportPlanId("jiwkuofoskghsau") + .withContactDetails(new ContactProfile().withFirstName("imjm") + .withLastName("xieduugidyjrr") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("y") + .withAdditionalEmailAddresses(Arrays.asList("v", "xc", "onpc", "hocohslkev")) + .withPhoneNumber("ggzfbu") + .withPreferredTimeZone("fmvfaxkffeiit") + .withCountry("lvmezyvshxmzsbbz") + .withPreferredSupportLanguage("ggi")) .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") + .withTitle("bldngkpoc") + .withProblemStartTime(OffsetDateTime.parse("2021-05-19T00:57:25Z")) + .withServiceId("z") + .withFileWorkspaceName("rbpizc") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("dpydn")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("xdeoejzic") + .withQuotaChangeRequestVersion("fsj") .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"))); + Arrays.asList(new QuotaChangeRequest().withRegion("fbishcbkha").withPayload("eyeam"), + new QuotaChangeRequest().withRegion("hagalpbuxwgipwh").withPayload("ow"), + new QuotaChangeRequest().withRegion("shwankixzbinje").withPayload("ttmrywnuzoqf")))) + .withSecondaryConsent(Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("n"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("yx"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("lsicohoqqnwv"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("vwhheunmmqhgyx"))) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_PROCESSED) + .withAllowedSeverities(Arrays.asList(SeverityLevel.MINIMAL, SeverityLevel.MODERATE, + SeverityLevel.CRITICAL, SeverityLevel.CRITICAL)) + .withReasonForEscalation("yaxuconuqszfkb")) + .withCommunityForumPost("pewr"); model = BinaryData.fromObject(model).toObject(SupportTicketDetailsInner.class); - Assertions.assertEquals("hwankixzbinjepu", model.supportTicketId()); - Assertions.assertEquals("tmryw", model.description()); - Assertions.assertEquals("uzoqft", model.problemClassificationId()); - Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); - Assertions.assertEquals("cohoq", model.enrollmentId()); - Assertions.assertEquals(false, model.require24X7Response()); - Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); - 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("vdfwatkpn", model.supportTicketId()); + Assertions.assertEquals("ulexxbczwtr", model.description()); + Assertions.assertEquals("wiqzbqjvsovmyo", model.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.CRITICAL, model.severity()); + Assertions.assertEquals("vnchrkcci", model.enrollmentId()); + Assertions.assertTrue(model.require24X7Response()); + Assertions.assertEquals(Consent.YES, model.advancedDiagnosticConsent()); + Assertions.assertEquals("qkhr", model.problemScopingQuestions()); + Assertions.assertEquals("jiwkuofoskghsau", model.supportPlanId()); + Assertions.assertEquals("imjm", model.contactDetails().firstName()); + Assertions.assertEquals("xieduugidyjrr", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("y", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("v", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("ggzfbu", model.contactDetails().phoneNumber()); + Assertions.assertEquals("fmvfaxkffeiit", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("lvmezyvshxmzsbbz", model.contactDetails().country()); + Assertions.assertEquals("ggi", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("bldngkpoc", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-19T00:57:25Z"), model.problemStartTime()); + Assertions.assertEquals("z", model.serviceId()); + Assertions.assertEquals("rbpizc", model.fileWorkspaceName()); + Assertions.assertEquals("dpydn", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("xdeoejzic", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("fsj", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("fbishcbkha", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("eyeam", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("xttd", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("n", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_PROCESSED, model.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MINIMAL, model.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("yaxuconuqszfkb", model.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("pewr", model.communityForumPost()); } } 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 f4f578ea6685..a9c3997227c8 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -8,6 +8,8 @@ import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsProperties; import com.azure.resourcemanager.support.models.Consent; import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.QuotaChangeRequest; import com.azure.resourcemanager.support.models.QuotaTicketDetails; @@ -25,106 +27,118 @@ public final class SupportTicketDetailsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportTicketDetailsProperties model = BinaryData.fromString( - "{\"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\"}]}") + "{\"supportTicketId\":\"ihkaetcktvfc\",\"description\":\"vf\",\"problemClassificationId\":\"nkymuctqhjfbebrj\",\"problemClassificationDisplayName\":\"erfuwuttt\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"jrbirphxepcyv\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"jky\",\"supportPlanId\":\"j\",\"contactDetails\":{\"firstName\":\"uujqgidokgjljyo\",\"lastName\":\"gvcl\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"gsncghkjeszz\",\"additionalEmailAddresses\":[\"jhtxfvgxbfsmxne\",\"mpvecxgodebfqk\"],\"phoneNumber\":\"bmpukgriwflz\",\"preferredTimeZone\":\"fbxzpuzycisp\",\"country\":\"qzahmgkbrp\",\"preferredSupportLanguage\":\"y\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-09-29T11:13:32Z\",\"expirationTime\":\"2021-06-21T11:41:57Z\",\"slaMinutes\":2043148337},\"supportEngineer\":{\"emailAddress\":\"ik\"},\"supportPlanType\":\"rgvtqag\",\"supportPlanDisplayName\":\"uynhijg\",\"title\":\"mebf\",\"problemStartTime\":\"2021-09-24T19:25:12Z\",\"serviceId\":\"rbu\",\"serviceDisplayName\":\"cvpnazzmhjrunmpx\",\"status\":\"dbhrbnlankxm\",\"createdDate\":\"2021-04-18T12:12:20Z\",\"modifiedDate\":\"2021-10-25T15:37:51Z\",\"fileWorkspaceName\":\"enbtkcxywny\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"nlqidybyxczf\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"aaxdbabphlwrq\",\"quotaChangeRequestVersion\":\"ktsthsucocmny\",\"quotaChangeRequests\":[{\"region\":\"t\",\"payload\":\"wwrq\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"zywbiex\"},{\"userConsent\":\"No\",\"type\":\"ue\"},{\"userConsent\":\"Yes\",\"type\":\"xujwbhqwalmuzyo\"},{\"userConsent\":\"Yes\",\"type\":\"dkzjancuxrh\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationUnsupported\",\"allowedSeverities\":[\"moderate\",\"moderate\"],\"reasonForEscalation\":\"wd\"},\"communityForumPost\":\"wz\",\"supportChannel\":\"Web\",\"chatConversationStatus\":\"Active\"}") .toObject(SupportTicketDetailsProperties.class); - 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("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("udxytlmoyrx", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("ihkaetcktvfc", model.supportTicketId()); + Assertions.assertEquals("vf", model.description()); + Assertions.assertEquals("nkymuctqhjfbebrj", model.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); + Assertions.assertEquals("jrbirphxepcyv", model.enrollmentId()); + Assertions.assertFalse(model.require24X7Response()); + Assertions.assertEquals(Consent.YES, model.advancedDiagnosticConsent()); + Assertions.assertEquals("jky", model.problemScopingQuestions()); + Assertions.assertEquals("j", model.supportPlanId()); + Assertions.assertEquals("uujqgidokgjljyo", model.contactDetails().firstName()); + Assertions.assertEquals("gvcl", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("gsncghkjeszz", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("jhtxfvgxbfsmxne", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("bmpukgriwflz", model.contactDetails().phoneNumber()); + Assertions.assertEquals("fbxzpuzycisp", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("qzahmgkbrp", model.contactDetails().country()); + Assertions.assertEquals("y", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("mebf", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T19:25:12Z"), model.problemStartTime()); + Assertions.assertEquals("rbu", model.serviceId()); + Assertions.assertEquals("enbtkcxywny", model.fileWorkspaceName()); + Assertions.assertEquals("nlqidybyxczf", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("aaxdbabphlwrq", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("ktsthsucocmny", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("t", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("wwrq", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("zywbiex", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_UNSUPPORTED, + model.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MODERATE, model.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("wd", model.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("wz", model.communityForumPost()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - 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"))); + SupportTicketDetailsProperties model = new SupportTicketDetailsProperties().withSupportTicketId("ihkaetcktvfc") + .withDescription("vf") + .withProblemClassificationId("nkymuctqhjfbebrj") + .withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) + .withEnrollmentId("jrbirphxepcyv") + .withRequire24X7Response(false) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions("jky") + .withSupportPlanId("j") + .withContactDetails(new ContactProfile().withFirstName("uujqgidokgjljyo") + .withLastName("gvcl") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("gsncghkjeszz") + .withAdditionalEmailAddresses(Arrays.asList("jhtxfvgxbfsmxne", "mpvecxgodebfqk")) + .withPhoneNumber("bmpukgriwflz") + .withPreferredTimeZone("fbxzpuzycisp") + .withCountry("qzahmgkbrp") + .withPreferredSupportLanguage("y")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("mebf") + .withProblemStartTime(OffsetDateTime.parse("2021-09-24T19:25:12Z")) + .withServiceId("rbu") + .withFileWorkspaceName("enbtkcxywny") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("nlqidybyxczf")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("aaxdbabphlwrq") + .withQuotaChangeRequestVersion("ktsthsucocmny") + .withQuotaChangeRequests(Arrays.asList(new QuotaChangeRequest().withRegion("t").withPayload("wwrq")))) + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("zywbiex"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("ue"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("xujwbhqwalmuzyo"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("dkzjancuxrh"))) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_UNSUPPORTED) + .withAllowedSeverities(Arrays.asList(SeverityLevel.MODERATE, SeverityLevel.MODERATE)) + .withReasonForEscalation("wd")) + .withCommunityForumPost("wz"); model = BinaryData.fromObject(model).toObject(SupportTicketDetailsProperties.class); - 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("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("udxytlmoyrx", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("ihkaetcktvfc", model.supportTicketId()); + Assertions.assertEquals("vf", model.description()); + Assertions.assertEquals("nkymuctqhjfbebrj", model.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, model.severity()); + Assertions.assertEquals("jrbirphxepcyv", model.enrollmentId()); + Assertions.assertFalse(model.require24X7Response()); + Assertions.assertEquals(Consent.YES, model.advancedDiagnosticConsent()); + Assertions.assertEquals("jky", model.problemScopingQuestions()); + Assertions.assertEquals("j", model.supportPlanId()); + Assertions.assertEquals("uujqgidokgjljyo", model.contactDetails().firstName()); + Assertions.assertEquals("gvcl", model.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod()); + Assertions.assertEquals("gsncghkjeszz", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("jhtxfvgxbfsmxne", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("bmpukgriwflz", model.contactDetails().phoneNumber()); + Assertions.assertEquals("fbxzpuzycisp", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("qzahmgkbrp", model.contactDetails().country()); + Assertions.assertEquals("y", model.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("mebf", model.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-24T19:25:12Z"), model.problemStartTime()); + Assertions.assertEquals("rbu", model.serviceId()); + Assertions.assertEquals("enbtkcxywny", model.fileWorkspaceName()); + Assertions.assertEquals("nlqidybyxczf", model.technicalTicketDetails().resourceId()); + Assertions.assertEquals("aaxdbabphlwrq", model.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("ktsthsucocmny", model.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("t", model.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("wwrq", model.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, model.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("zywbiex", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_UNSUPPORTED, + model.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MODERATE, model.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("wd", model.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("wz", model.communityForumPost()); } } 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 8f65d71e1df1..3d67f209aa9f 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; @@ -21,18 +21,18 @@ public final class SupportTicketsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":true,\"reason\":\"wcciuqgbdbu\",\"message\":\"uvfbtkuwh\"}"; + String responseStr = "{\"nameAvailable\":true,\"reason\":\"jxyfwnylrcoolstt\",\"message\":\"iwkkbn\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityOutput response = manager.supportTickets() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("qiiobyuqer") + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("ypelmcu") .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 274a54544f09..72ce0812390e 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 @@ -1,17 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.QuotaChangeRequest; import com.azure.resourcemanager.support.models.QuotaTicketDetails; @@ -33,84 +35,93 @@ public final class SupportTicketsCreateMockTests { @Test public void testCreate() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"supportTicketId\":\"a\",\"description\":\"pqjlihhyusps\",\"problemClassificationId\":\"asdvl\",\"problemClassificationDisplayName\":\"wdgzxulucv\",\"severity\":\"critical\",\"enrollmentId\":\"rsre\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"risjnhnytxifqjz\",\"supportPlanId\":\"mrhublwpc\",\"contactDetails\":{\"firstName\":\"sutrgjup\",\"lastName\":\"uutpwoqhih\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"qg\",\"additionalEmailAddresses\":[\"nfqn\",\"cypsxjv\",\"oimwkslirc\"],\"phoneNumber\":\"jxv\",\"preferredTimeZone\":\"dfcea\",\"country\":\"vlhv\",\"preferredSupportLanguage\":\"gdyftumrtwna\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-05-19T08:56:06Z\",\"expirationTime\":\"2021-04-17T03:14:05Z\",\"slaMinutes\":171945561},\"supportEngineer\":{\"emailAddress\":\"gcyztsfmznbae\"},\"supportPlanType\":\"hchqnrnrpx\",\"supportPlanDisplayName\":\"uwrykqgaifmvikl\",\"title\":\"ydv\",\"problemStartTime\":\"2021-08-31T10:25:05Z\",\"serviceId\":\"ejd\",\"serviceDisplayName\":\"xcv\",\"status\":\"rhnj\",\"createdDate\":\"2021-07-29T19:50:27Z\",\"modifiedDate\":\"2020-12-31T10:30:45Z\",\"fileWorkspaceName\":\"novqfzge\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"uljltduceamtmcz\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"ejwcwwqiok\",\"quotaChangeRequestVersion\":\"sx\",\"quotaChangeRequests\":[{\"region\":\"sv\",\"payload\":\"jpr\"},{\"region\":\"wcfzqljyxgt\",\"payload\":\"heyd\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"kx\"},{\"userConsent\":\"No\",\"type\":\"vbbxuripl\"},{\"userConsent\":\"Yes\",\"type\":\"tbaxk\"},{\"userConsent\":\"Yes\",\"type\":\"rc\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationInitiated\",\"allowedSeverities\":[\"highestcriticalimpact\",\"moderate\",\"minimal\",\"moderate\"],\"reasonForEscalation\":\"dpvruud\"},\"communityForumPost\":\"zibt\",\"supportChannel\":\"Chat\",\"chatConversationStatus\":\"Closed\"},\"id\":\"tstvdxeclzedq\",\"name\":\"cvhzlhp\",\"type\":\"odqkdlwwqfb\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); 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") + .define("jrywvtylbfpnc") + .withDescription("thtywub") + .withProblemClassificationId("cbihwqk") + .withSeverity(SeverityLevel.CRITICAL) + .withAdvancedDiagnosticConsent(Consent.YES) + .withContactDetails(new ContactProfile().withFirstName("nqfiufxqknpi") + .withLastName("gnepttwqmsni") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("cdm") + .withAdditionalEmailAddresses(Arrays.asList("ojlpijnkrxf")) + .withPhoneNumber("dhcrati") + .withPreferredTimeZone("zronasxift") + .withCountry("zq") + .withPreferredSupportLanguage("zh")) + .withTitle("gf") + .withServiceId("sofbshrn") + .withSupportTicketId("doiwi") + .withEnrollmentId("umwctondz") + .withRequire24X7Response(false) + .withProblemScopingQuestions("fdlwg") + .withSupportPlanId("tsbwtovvtgse") .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") + .withProblemStartTime(OffsetDateTime.parse("2021-06-30T13:21:57Z")) + .withFileWorkspaceName("opqgikyzirtxdyux") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("psew")) + .withQuotaTicketDetails(new QuotaTicketDetails().withQuotaChangeRequestSubType("ilqu") + .withQuotaChangeRequestVersion("ydxtqm") .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")))) + Arrays.asList(new QuotaChangeRequest().withRegion("orgguf").withPayload("aomtbghhavgrvkff")))) .withSecondaryConsent( - 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"))) + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("jbibg"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("umvfclu"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("xnbkfezzxscyhwzd"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("jbzbomvzzbtdcq"))) + .withDirectConnectEscalation(new DirectConnectEscalation() + .withAzureEEStatus(EscalationStatus.ESCALATION_INITIATED) + .withAllowedSeverities( + Arrays.asList(SeverityLevel.CRITICAL, SeverityLevel.HIGHESTCRITICALIMPACT, SeverityLevel.CRITICAL)) + .withReasonForEscalation("l")) + .withCommunityForumPost("shfssnrbgyef") .create(); - 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("a", response.supportTicketId()); + Assertions.assertEquals("pqjlihhyusps", response.description()); + Assertions.assertEquals("asdvl", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.CRITICAL, response.severity()); + Assertions.assertEquals("rsre", response.enrollmentId()); + Assertions.assertTrue(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("risjnhnytxifqjz", response.problemScopingQuestions()); + Assertions.assertEquals("mrhublwpc", response.supportPlanId()); + Assertions.assertEquals("sutrgjup", response.contactDetails().firstName()); + Assertions.assertEquals("uutpwoqhih", 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("j", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("qg", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("nfqn", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("jxv", response.contactDetails().phoneNumber()); + Assertions.assertEquals("dfcea", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("vlhv", response.contactDetails().country()); + Assertions.assertEquals("gdyftumrtwna", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("ydv", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-31T10:25:05Z"), response.problemStartTime()); + Assertions.assertEquals("ejd", response.serviceId()); + Assertions.assertEquals("novqfzge", response.fileWorkspaceName()); + Assertions.assertEquals("uljltduceamtmcz", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("ejwcwwqiok", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("sx", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("sv", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("jpr", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("kx", response.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_INITIATED, + response.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, + response.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("dpvruud", response.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("zibt", response.communityForumPost()); } } 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 9efbaa789035..d5079d4969cd 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 @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; @@ -25,46 +26,51 @@ public final class SupportTicketsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"supportTicketId\":\"r\",\"description\":\"t\",\"problemClassificationId\":\"dgmfpgvmpipasl\",\"problemClassificationDisplayName\":\"aqfxss\",\"severity\":\"critical\",\"enrollmentId\":\"twbdsrezpdrhn\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"q\",\"supportPlanId\":\"wyt\",\"contactDetails\":{\"firstName\":\"sibircgpi\",\"lastName\":\"pzimejzanlfzxi\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"rmbzo\",\"additionalEmailAddresses\":[\"i\",\"rjqc\"],\"phoneNumber\":\"gzpfrla\",\"preferredTimeZone\":\"szrnwo\",\"country\":\"indfpwpjyl\",\"preferredSupportLanguage\":\"bt\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-07-25T09:51:01Z\",\"expirationTime\":\"2021-08-09T06:27:36Z\",\"slaMinutes\":1612307116},\"supportEngineer\":{\"emailAddress\":\"zfjvfbgofe\"},\"supportPlanType\":\"a\",\"supportPlanDisplayName\":\"qmqhldvriii\",\"title\":\"jnalghf\",\"problemStartTime\":\"2021-04-12T00:35:59Z\",\"serviceId\":\"vsexsowuelu\",\"serviceDisplayName\":\"hahhxvrhmzkwpj\",\"status\":\"wspughftqsxhqx\",\"createdDate\":\"2021-01-21T16:10:27Z\",\"modifiedDate\":\"2021-06-04T22:03:42Z\",\"fileWorkspaceName\":\"dxdigr\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"zdmsyqtfi\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"botzingamvppho\",\"quotaChangeRequestVersion\":\"qzudphq\",\"quotaChangeRequests\":[{\"region\":\"kfwynw\",\"payload\":\"tbvkayhmtnvyq\"},{\"region\":\"tkzwpcnpwzc\",\"payload\":\"esgvvsccyaj\"},{\"region\":\"qfhwyg\",\"payload\":\"vdnkfxusem\"},{\"region\":\"zrmuhapfcqdps\",\"payload\":\"qvpsvuoymg\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"zrypqlmfeokerqw\"},{\"userConsent\":\"No\",\"type\":\"ob\"},{\"userConsent\":\"Yes\",\"type\":\"edkowepbqpcrfk\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationAvailable\",\"allowedSeverities\":[\"critical\"],\"reasonForEscalation\":\"cdwxlpq\"},\"communityForumPost\":\"ftnkhtj\",\"supportChannel\":\"Chat\",\"chatConversationStatus\":\"Active\"},\"id\":\"fq\",\"name\":\"tmtdhtmdvypgik\",\"type\":\"gszywk\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SupportTicketDetails response - = manager.supportTickets().getWithResponse("elpcirelsfeaenwa", com.azure.core.util.Context.NONE).getValue(); + = manager.supportTickets().getWithResponse("ikayuhqlbjbsybb", com.azure.core.util.Context.NONE).getValue(); - 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("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("r", response.supportTicketId()); + Assertions.assertEquals("t", response.description()); + Assertions.assertEquals("dgmfpgvmpipasl", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.CRITICAL, response.severity()); + Assertions.assertEquals("twbdsrezpdrhn", response.enrollmentId()); + Assertions.assertTrue(response.require24X7Response()); + Assertions.assertEquals(Consent.NO, response.advancedDiagnosticConsent()); + Assertions.assertEquals("q", response.problemScopingQuestions()); + Assertions.assertEquals("wyt", response.supportPlanId()); + Assertions.assertEquals("sibircgpi", response.contactDetails().firstName()); + Assertions.assertEquals("pzimejzanlfzxi", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("rmbzo", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("i", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("gzpfrla", response.contactDetails().phoneNumber()); + Assertions.assertEquals("szrnwo", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("indfpwpjyl", response.contactDetails().country()); + Assertions.assertEquals("bt", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("jnalghf", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T00:35:59Z"), response.problemStartTime()); + Assertions.assertEquals("vsexsowuelu", response.serviceId()); + Assertions.assertEquals("dxdigr", response.fileWorkspaceName()); + Assertions.assertEquals("zdmsyqtfi", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("botzingamvppho", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("qzudphq", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("kfwynw", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("tbvkayhmtnvyq", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("aojkniodk", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("zrypqlmfeokerqw", response.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_AVAILABLE, + response.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.CRITICAL, response.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("cdwxlpq", response.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("ftnkhtj", response.communityForumPost()); } } 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 51750adb04fe..d9da096ae077 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; @@ -26,53 +27,59 @@ public final class SupportTicketsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"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\"}]}"; + = "{\"value\":[{\"properties\":{\"supportTicketId\":\"vqqaatjinrvgo\",\"description\":\"pmfi\",\"problemClassificationId\":\"bfggjioolvr\",\"problemClassificationDisplayName\":\"kvtkkg\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"wjygvjayvblmhvk\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"vvyhg\",\"supportPlanId\":\"pbyrqufegxu\",\"contactDetails\":{\"firstName\":\"wz\",\"lastName\":\"bnhlmc\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"p\",\"additionalEmailAddresses\":[\"itvgbmhrixkwm\",\"ijejvegrhbpn\"],\"phoneNumber\":\"xexccbdreaxhcexd\",\"preferredTimeZone\":\"rvqahqkghtpwi\",\"country\":\"nhyjsv\",\"preferredSupportLanguage\":\"ycxzbfvoo\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-01-29T00:13:03Z\",\"expirationTime\":\"2021-01-07T18:49:34Z\",\"slaMinutes\":1542323889},\"supportEngineer\":{\"emailAddress\":\"pyostronzmyhgfi\"},\"supportPlanType\":\"sxkm\",\"supportPlanDisplayName\":\"a\",\"title\":\"krrjrea\",\"problemStartTime\":\"2021-04-06T12:16:17Z\",\"serviceId\":\"sgumhjglikkxwsl\",\"serviceDisplayName\":\"bq\",\"status\":\"uzlm\",\"createdDate\":\"2021-08-06T01:26:51Z\",\"modifiedDate\":\"2021-03-10T07:17:47Z\",\"fileWorkspaceName\":\"tgp\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"jxeznoigbrnjwmw\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"bsazejjoqka\",\"quotaChangeRequestVersion\":\"hsxttaugzxnf\",\"quotaChangeRequests\":[{\"region\":\"xdtnkdmkqjjlw\",\"payload\":\"nvrk\"},{\"region\":\"ou\",\"payload\":\"bre\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"j\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationUnsupported\",\"allowedSeverities\":[\"highestcriticalimpact\",\"moderate\"],\"reasonForEscalation\":\"ezl\"},\"communityForumPost\":\"ffiakp\",\"supportChannel\":\"Web\",\"chatConversationStatus\":\"Active\"},\"id\":\"edltmmjihyeozp\",\"name\":\"vwau\",\"type\":\"qncygupkvi\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.supportTickets().list(1424566562, "hykojoxafnndlpic", com.azure.core.util.Context.NONE); + = manager.supportTickets().list(257648591, "rryuzhlhkjo", com.azure.core.util.Context.NONE); - 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("vqqaatjinrvgo", response.iterator().next().supportTicketId()); + Assertions.assertEquals("pmfi", response.iterator().next().description()); + Assertions.assertEquals("bfggjioolvr", response.iterator().next().problemClassificationId()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, response.iterator().next().severity()); + Assertions.assertEquals("wjygvjayvblmhvk", response.iterator().next().enrollmentId()); + Assertions.assertTrue(response.iterator().next().require24X7Response()); 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, + Assertions.assertEquals("vvyhg", response.iterator().next().problemScopingQuestions()); + Assertions.assertEquals("pbyrqufegxu", response.iterator().next().supportPlanId()); + Assertions.assertEquals("wz", response.iterator().next().contactDetails().firstName()); + Assertions.assertEquals("bnhlmc", response.iterator().next().contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, response.iterator().next().contactDetails().preferredContactMethod()); - Assertions.assertEquals("aknynfsynljphuop", response.iterator().next().contactDetails().primaryEmailAddress()); - Assertions.assertEquals("lqiyntorzihl", + Assertions.assertEquals("p", response.iterator().next().contactDetails().primaryEmailAddress()); + Assertions.assertEquals("itvgbmhrixkwm", response.iterator().next().contactDetails().additionalEmailAddresses().get(0)); - 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"), + Assertions.assertEquals("xexccbdreaxhcexd", response.iterator().next().contactDetails().phoneNumber()); + Assertions.assertEquals("rvqahqkghtpwi", response.iterator().next().contactDetails().preferredTimeZone()); + Assertions.assertEquals("nhyjsv", response.iterator().next().contactDetails().country()); + Assertions.assertEquals("ycxzbfvoo", response.iterator().next().contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("krrjrea", response.iterator().next().title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-06T12:16:17Z"), response.iterator().next().problemStartTime()); - 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", + Assertions.assertEquals("sgumhjglikkxwsl", response.iterator().next().serviceId()); + Assertions.assertEquals("tgp", response.iterator().next().fileWorkspaceName()); + Assertions.assertEquals("jxeznoigbrnjwmw", response.iterator().next().technicalTicketDetails().resourceId()); + Assertions.assertEquals("bsazejjoqka", response.iterator().next().quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("rdvstkwqqtch", + Assertions.assertEquals("hsxttaugzxnf", response.iterator().next().quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("fmtdaaygdvwvgp", + Assertions.assertEquals("xdtnkdmkqjjlw", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("hgwxrtfudx", + Assertions.assertEquals("nvrk", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).payload()); - Assertions.assertEquals(UserConsent.YES, response.iterator().next().secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("wmszkk", response.iterator().next().secondaryConsent().get(0).type()); + Assertions.assertEquals(UserConsent.NO, response.iterator().next().secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("j", response.iterator().next().secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_UNSUPPORTED, + response.iterator().next().directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, + response.iterator().next().directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("ezl", response.iterator().next().directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("ffiakp", response.iterator().next().communityForumPost()); } } 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 6dea880f9753..ef71f768d263 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 @@ -1,228 +1,59 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; +import com.azure.resourcemanager.support.implementation.models.SupportTicketsListResult; import com.azure.resourcemanager.support.models.Consent; -import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; -import com.azure.resourcemanager.support.models.QuotaChangeRequest; -import com.azure.resourcemanager.support.models.QuotaTicketDetails; -import com.azure.resourcemanager.support.models.SecondaryConsent; -import com.azure.resourcemanager.support.models.ServiceLevelAgreement; import com.azure.resourcemanager.support.models.SeverityLevel; -import com.azure.resourcemanager.support.models.SupportEngineer; -import com.azure.resourcemanager.support.models.SupportTicketsListResult; -import com.azure.resourcemanager.support.models.TechnicalTicketDetails; import com.azure.resourcemanager.support.models.UserConsent; import java.time.OffsetDateTime; -import java.util.Arrays; import org.junit.jupiter.api.Assertions; public final class SupportTicketsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SupportTicketsListResult model = BinaryData.fromString( - "{\"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\"}") + "{\"nextLink\":\"crgvxpvgom\",\"value\":[{\"properties\":{\"supportTicketId\":\"isgwbnbbeldawkz\",\"description\":\"ali\",\"problemClassificationId\":\"urqhaka\",\"problemClassificationDisplayName\":\"ashsfwxos\",\"severity\":\"minimal\",\"enrollmentId\":\"xcug\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"xdje\",\"supportPlanId\":\"pucwwfvovbvme\",\"contactDetails\":{\"firstName\":\"ecivyh\",\"lastName\":\"ce\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"jgjrwjueiotwm\",\"additionalEmailAddresses\":[\"tdx\",\"it\"],\"phoneNumber\":\"rjaw\",\"preferredTimeZone\":\"qwgxhniskx\",\"country\":\"bkpyc\",\"preferredSupportLanguage\":\"klwndnhjdauwhv\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-03-16T04:14:44Z\",\"expirationTime\":\"2021-04-23T07:32:01Z\",\"slaMinutes\":138354171},\"supportEngineer\":{\"emailAddress\":\"jznb\"},\"supportPlanType\":\"ow\",\"supportPlanDisplayName\":\"przqlveu\",\"title\":\"lupj\",\"problemStartTime\":\"2021-04-21T08:53:38Z\",\"serviceId\":\"fxobbcsws\",\"serviceDisplayName\":\"jriplrbpbewtghf\",\"status\":\"lcgwxzvlvqh\",\"createdDate\":\"2021-07-04T10:03:04Z\",\"modifiedDate\":\"2021-03-30T00:52:16Z\",\"fileWorkspaceName\":\"btn\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"wwaloayqcgwrt\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"zg\",\"quotaChangeRequestVersion\":\"zmh\",\"quotaChangeRequests\":[{},{}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"avjcbpwx\"},{\"userConsent\":\"No\",\"type\":\"knftguvriuh\"},{\"userConsent\":\"No\",\"type\":\"dyvxqtayriww\"},{\"userConsent\":\"No\",\"type\":\"bexrmcq\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationInitiated\",\"allowedSeverities\":[\"minimal\",\"minimal\",\"minimal\",\"highestcriticalimpact\"],\"reasonForEscalation\":\"e\"},\"communityForumPost\":\"sgzvahapjyzhpv\",\"supportChannel\":\"Web\",\"chatConversationStatus\":\"Active\"},\"id\":\"vxdjzlmwlxkvugf\",\"name\":\"zovawjvz\",\"type\":\"nluthnnp\"},{\"properties\":{\"supportTicketId\":\"xipeilpjzuaejx\",\"description\":\"ultskzbbtdz\",\"problemClassificationId\":\"mv\",\"problemClassificationDisplayName\":\"kgpwoz\",\"severity\":\"moderate\",\"enrollmentId\":\"fpbsjyofdxl\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"touwaboekqv\",\"supportPlanId\":\"lns\",\"contactDetails\":{\"firstName\":\"vbxwyjsflhh\",\"lastName\":\"aalnjixi\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"yaw\",\"additionalEmailAddresses\":[\"aq\",\"slyjpkiid\",\"yexz\",\"eli\"],\"phoneNumber\":\"nr\",\"preferredTimeZone\":\"tfolhbnx\",\"country\":\"nalaulppg\",\"preferredSupportLanguage\":\"dtpnapnyiropuhp\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-09-29T22:32:55Z\",\"expirationTime\":\"2021-05-18T16:57:02Z\",\"slaMinutes\":1573909011},\"supportEngineer\":{\"emailAddress\":\"itxmedjvcslynqww\"},\"supportPlanType\":\"wzz\",\"supportPlanDisplayName\":\"gktrmgucnapkte\",\"title\":\"ellwptfdy\",\"problemStartTime\":\"2020-12-31T02:22:45Z\",\"serviceId\":\"qbuaceopzfqr\",\"serviceDisplayName\":\"uaopppcqeq\",\"status\":\"lzdahzxctobgbkdm\",\"createdDate\":\"2021-01-29T19:09:38Z\",\"modifiedDate\":\"2021-09-15T16:01:55Z\",\"fileWorkspaceName\":\"tmgrcfbun\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"hhkxbp\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"mjh\",\"quotaChangeRequestVersion\":\"j\",\"quotaChangeRequests\":[{},{},{},{}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"r\"},{\"userConsent\":\"No\",\"type\":\"xqzvszjfa\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationInitiated\",\"allowedSeverities\":[\"moderate\",\"moderate\"],\"reasonForEscalation\":\"e\"},\"communityForumPost\":\"t\",\"supportChannel\":\"Web\",\"chatConversationStatus\":\"Active\"},\"id\":\"oqmcbxvwvxyslq\",\"name\":\"hsfxoblytkb\",\"type\":\"mpew\"}]}") .toObject(SupportTicketsListResult.class); - 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("uouq", model.value().get(0).enrollmentId()); - Assertions.assertEquals(false, model.value().get(0).require24X7Response()); + Assertions.assertEquals("crgvxpvgom", model.nextLink()); + Assertions.assertEquals("isgwbnbbeldawkz", model.value().get(0).supportTicketId()); + Assertions.assertEquals("ali", model.value().get(0).description()); + Assertions.assertEquals("urqhaka", model.value().get(0).problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MINIMAL, model.value().get(0).severity()); + Assertions.assertEquals("xcug", model.value().get(0).enrollmentId()); + Assertions.assertTrue(model.value().get(0).require24X7Response()); 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, + Assertions.assertEquals("xdje", model.value().get(0).problemScopingQuestions()); + Assertions.assertEquals("pucwwfvovbvme", model.value().get(0).supportPlanId()); + Assertions.assertEquals("ecivyh", model.value().get(0).contactDetails().firstName()); + Assertions.assertEquals("ce", model.value().get(0).contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, model.value().get(0).contactDetails().preferredContactMethod()); - 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("jgjrwjueiotwm", model.value().get(0).contactDetails().primaryEmailAddress()); + Assertions.assertEquals("tdx", model.value().get(0).contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("rjaw", model.value().get(0).contactDetails().phoneNumber()); + Assertions.assertEquals("qwgxhniskx", model.value().get(0).contactDetails().preferredTimeZone()); + Assertions.assertEquals("bkpyc", model.value().get(0).contactDetails().country()); + Assertions.assertEquals("klwndnhjdauwhv", model.value().get(0).contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("lupj", model.value().get(0).title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T08:53:38Z"), model.value().get(0).problemStartTime()); + Assertions.assertEquals("fxobbcsws", model.value().get(0).serviceId()); + Assertions.assertEquals("btn", model.value().get(0).fileWorkspaceName()); + Assertions.assertEquals("wwaloayqcgwrt", model.value().get(0).technicalTicketDetails().resourceId()); + Assertions.assertEquals("zg", model.value().get(0).quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("zmh", 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("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.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("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.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("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("uouq", model.value().get(0).enrollmentId()); - Assertions.assertEquals(false, model.value().get(0).require24X7Response()); - 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("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()); + Assertions.assertEquals("avjcbpwx", model.value().get(0).secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_INITIATED, + model.value().get(0).directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MINIMAL, + model.value().get(0).directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("e", model.value().get(0).directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).communityForumPost()); } } diff --git a/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsLookUpResourceIdWithResponseMockTests.java b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsLookUpResourceIdWithResponseMockTests.java new file mode 100644 index 000000000000..9386f2904e0c --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/test/java/com/azure/resourcemanager/support/generated/SupportTicketsLookUpResourceIdWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.credential.AccessToken; +import com.azure.core.http.HttpClient; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; +import com.azure.core.test.http.MockHttpResponse; +import com.azure.resourcemanager.support.SupportManager; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequest; +import com.azure.resourcemanager.support.models.LookUpResourceIdRequestType; +import com.azure.resourcemanager.support.models.LookUpResourceIdResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SupportTicketsLookUpResourceIdWithResponseMockTests { + @Test + public void testLookUpResourceIdWithResponse() throws Exception { + String responseStr = "{\"resourceId\":\"xhojuj\"}"; + + 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("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + LookUpResourceIdResponse response = manager.supportTickets() + .lookUpResourceIdWithResponse( + new LookUpResourceIdRequest().withIdentifier("dscwxqupevzhf") + .withType(LookUpResourceIdRequestType.MICROSOFT_SUPPORT_SUPPORT_TICKETS), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("xhojuj", response.resourceId()); + } +} 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 00ae701aee83..4e80a3836bd7 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 @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.support.SupportManager; import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; @@ -21,18 +21,19 @@ public final class SupportTicketsNoSubscriptionsCheckNameAvailabilityWithResponseMockTests { @Test public void testCheckNameAvailabilityWithResponse() throws Exception { - String responseStr = "{\"nameAvailable\":false,\"reason\":\"zbzkdvncjabudurg\",\"message\":\"kmokz\"}"; + String responseStr = "{\"nameAvailable\":true,\"reason\":\"jqnv\",\"message\":\"oylaxxul\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); CheckNameAvailabilityOutput response = manager.supportTicketsNoSubscriptions() - .checkNameAvailabilityWithResponse(new CheckNameAvailabilityInput().withName("ystawfsdjpvkvp") - .withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), com.azure.core.util.Context.NONE) + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityInput().withName("nok").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 6cfecae02c8e..5401f766ed25 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 @@ -1,18 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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; import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.QuotaChangeRequest; import com.azure.resourcemanager.support.models.QuotaTicketDetails; @@ -34,80 +36,95 @@ public final class SupportTicketsNoSubscriptionsCreateMockTests { @Test public void testCreate() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"supportTicketId\":\"a\",\"description\":\"ysdzhez\",\"problemClassificationId\":\"wva\",\"problemClassificationDisplayName\":\"yuvvfonkp\",\"severity\":\"moderate\",\"enrollmentId\":\"yik\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"yavluwmncstt\",\"supportPlanId\":\"fybvpoek\",\"contactDetails\":{\"firstName\":\"sgsgbdhu\",\"lastName\":\"qgnjdgkynscli\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"zvhxnk\",\"additionalEmailAddresses\":[\"kubotppnvdxz\",\"hihfrbbcevqagtlt\",\"hlfkqojpy\"],\"phoneNumber\":\"gtrd\",\"preferredTimeZone\":\"nifmzzsdymbrnysu\",\"country\":\"m\",\"preferredSupportLanguage\":\"rafwgckhocxvdf\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-09-25T16:54:36Z\",\"expirationTime\":\"2021-08-24T21:11:13Z\",\"slaMinutes\":1487295222},\"supportEngineer\":{\"emailAddress\":\"aspavehhr\"},\"supportPlanType\":\"bunzozudh\",\"supportPlanDisplayName\":\"gkmoyxcdyuibhmfd\",\"title\":\"bzydvfvfcj\",\"problemStartTime\":\"2021-04-11T21:14:02Z\",\"serviceId\":\"oisrvhmgorffu\",\"serviceDisplayName\":\"scvwmzhwplef\",\"status\":\"vxilcbt\",\"createdDate\":\"2021-07-10T04:29:21Z\",\"modifiedDate\":\"2021-08-01T15:50:57Z\",\"fileWorkspaceName\":\"yqxtjjfzql\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"vodggxdbee\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"eknlra\",\"quotaChangeRequestVersion\":\"aawiuagydwqfb\",\"quotaChangeRequests\":[{\"region\":\"fgiagtcojocqwo\",\"payload\":\"nzjvusfzldm\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"fsbtkad\"},{\"userConsent\":\"Yes\",\"type\":\"wn\"},{\"userConsent\":\"No\",\"type\":\"bugrj\"},{\"userConsent\":\"Yes\",\"type\":\"jc\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationUnavailable\",\"allowedSeverities\":[\"critical\",\"highestcriticalimpact\"],\"reasonForEscalation\":\"efojyqdhcupl\"},\"communityForumPost\":\"lcwkhihihlhz\",\"supportChannel\":\"Chat\",\"chatConversationStatus\":\"Closed\"},\"id\":\"s\",\"name\":\"gnowcjhfgmveca\",\"type\":\"txmwoteyow\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - 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("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); + SupportTicketDetails response + = manager.supportTicketsNoSubscriptions() + .create("iogsjkmnwq", + new SupportTicketDetailsInner().withSupportTicketId("obaiyhddviaceg") + .withDescription("n") + .withProblemClassificationId("ntfpmvmemfnc") + .withSeverity(SeverityLevel.CRITICAL) + .withEnrollmentId("lllchpodb") + .withRequire24X7Response(true) + .withAdvancedDiagnosticConsent(Consent.YES) + .withProblemScopingQuestions("dnhfuk") + .withSupportPlanId("sjcswsmystuluqyp") + .withContactDetails(new ContactProfile().withFirstName("cvlerchpqbmfpjba") + .withLastName("widf") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("sspuunnoxyhkx") + .withAdditionalEmailAddresses(Arrays.asList("drihpfhoqcaaewda", "mdjvlpj")) + .withPhoneNumber("kzbrmsgeivsiy") + .withPreferredTimeZone("zkdnc") + .withCountry("dxonbzoggculap") + .withPreferredSupportLanguage("wyrpgogtqxepnyl")) + .withServiceLevelAgreement(new ServiceLevelAgreement()) + .withSupportEngineer(new SupportEngineer()) + .withTitle("dwxf") + .withProblemStartTime(OffsetDateTime.parse("2021-09-25T09:52:18Z")) + .withServiceId("vwzjbhyz") + .withFileWorkspaceName("flvestmjlxrrilo") + .withTechnicalTicketDetails(new TechnicalTicketDetails().withResourceId("wchpxlk")) + .withQuotaTicketDetails( + new QuotaTicketDetails().withQuotaChangeRequestSubType("uziycsl") + .withQuotaChangeRequestVersion("ufuztcktyhjtq") + .withQuotaChangeRequests(Arrays.asList( + new QuotaChangeRequest().withRegion("zulwmmrqzzrrj").withPayload("gl"), + new QuotaChangeRequest().withRegion("zgkrvqe").withPayload("toepryu"), + new QuotaChangeRequest().withRegion("wytpzdmovz").withPayload("va"), + new QuotaChangeRequest().withRegion("zqadf").withPayload("z")))) + .withSecondaryConsent( + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.NO).withType("ecxn"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("okpvzm"))) + .withDirectConnectEscalation(new DirectConnectEscalation() + .withAzureEEStatus(EscalationStatus.ESCALATION_PROCESSED) + .withAllowedSeverities( + Arrays.asList(SeverityLevel.CRITICAL, SeverityLevel.MINIMAL, SeverityLevel.CRITICAL)) + .withReasonForEscalation("firclnpkciayz")) + .withCommunityForumPost("ykhyawfvjlboxqvk"), + com.azure.core.util.Context.NONE); - 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("qfqjbvleorfm", response.problemScopingQuestions()); - Assertions.assertEquals("iqtqzfavyvnq", response.supportPlanId()); - Assertions.assertEquals("ybar", response.contactDetails().firstName()); - Assertions.assertEquals("euayjkqabqgzsles", response.contactDetails().lastName()); + Assertions.assertEquals("a", response.supportTicketId()); + Assertions.assertEquals("ysdzhez", response.description()); + Assertions.assertEquals("wva", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MODERATE, response.severity()); + Assertions.assertEquals("yik", response.enrollmentId()); + Assertions.assertFalse(response.require24X7Response()); + Assertions.assertEquals(Consent.YES, response.advancedDiagnosticConsent()); + Assertions.assertEquals("yavluwmncstt", response.problemScopingQuestions()); + Assertions.assertEquals("fybvpoek", response.supportPlanId()); + Assertions.assertEquals("sgsgbdhu", response.contactDetails().firstName()); + Assertions.assertEquals("qgnjdgkynscli", 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()); + Assertions.assertEquals("zvhxnk", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("kubotppnvdxz", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("gtrd", response.contactDetails().phoneNumber()); + Assertions.assertEquals("nifmzzsdymbrnysu", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("m", response.contactDetails().country()); + Assertions.assertEquals("rafwgckhocxvdf", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("bzydvfvfcj", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-11T21:14:02Z"), response.problemStartTime()); + Assertions.assertEquals("oisrvhmgorffu", response.serviceId()); + Assertions.assertEquals("yqxtjjfzql", response.fileWorkspaceName()); + Assertions.assertEquals("vodggxdbee", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("eknlra", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("aawiuagydwqfb", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("fgiagtcojocqwo", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("nzjvusfzldm", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.YES, response.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("fsbtkad", response.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_UNAVAILABLE, + response.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.CRITICAL, response.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("efojyqdhcupl", response.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("lcwkhihihlhz", response.communityForumPost()); } } 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 bb6be7bfd60f..a4c6b70877bb 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 @@ -1,16 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; @@ -25,47 +26,52 @@ public final class SupportTicketsNoSubscriptionsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"supportTicketId\":\"nhxmsi\",\"description\":\"fomiloxgg\",\"problemClassificationId\":\"ufiqndieuzaof\",\"problemClassificationDisplayName\":\"hvcyyysfg\",\"severity\":\"moderate\",\"enrollmentId\":\"cubiipuipw\",\"require24X7Response\":true,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"acjekni\",\"supportPlanId\":\"hqvcimpevfgmblr\",\"contactDetails\":{\"firstName\":\"ilbywdxsm\",\"lastName\":\"ccwr\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"scjfnyns\",\"additionalEmailAddresses\":[\"jizdvoqyt\"],\"phoneNumber\":\"yo\",\"preferredTimeZone\":\"bblgyavut\",\"country\":\"thjoxoism\",\"preferredSupportLanguage\":\"ksbpimlqoljx\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-06-15T17:46:12Z\",\"expirationTime\":\"2021-11-16T19:42:43Z\",\"slaMinutes\":640904651},\"supportEngineer\":{\"emailAddress\":\"gcvizqzdwlvwlyou\"},\"supportPlanType\":\"gfbkjubdyh\",\"supportPlanDisplayName\":\"fminsgowzf\",\"title\":\"tsttktlahbq\",\"problemStartTime\":\"2021-11-02T05:48:24Z\",\"serviceId\":\"xtgzukxitmmqtgqq\",\"serviceDisplayName\":\"hrnxrxc\",\"status\":\"uisavokq\",\"createdDate\":\"2021-02-26T22:01:53Z\",\"modifiedDate\":\"2021-02-04T21:35:57Z\",\"fileWorkspaceName\":\"ivjlfrqttbajlka\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"iopid\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"fku\",\"quotaChangeRequestVersion\":\"cxkdmligovi\",\"quotaChangeRequests\":[{\"region\":\"pmloazuruoc\",\"payload\":\"oorb\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"hjxa\"},{\"userConsent\":\"Yes\",\"type\":\"gslordilmyww\"},{\"userConsent\":\"No\",\"type\":\"xnyed\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationProcessed\",\"allowedSeverities\":[\"minimal\",\"critical\",\"highestcriticalimpact\"],\"reasonForEscalation\":\"ewbcihxuuw\"},\"communityForumPost\":\"j\",\"supportChannel\":\"Chat\",\"chatConversationStatus\":\"Active\"},\"id\":\"vpayakkudzpx\",\"name\":\"wjplma\",\"type\":\"stcyohpfkyrkdbd\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SupportTicketDetails response = manager.supportTicketsNoSubscriptions() - .getWithResponse("semdwzrmu", com.azure.core.util.Context.NONE) + .getWithResponse("lywjhh", com.azure.core.util.Context.NONE) .getValue(); - 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("nhxmsi", response.supportTicketId()); + Assertions.assertEquals("fomiloxgg", response.description()); + Assertions.assertEquals("ufiqndieuzaof", response.problemClassificationId()); + Assertions.assertEquals(SeverityLevel.MODERATE, response.severity()); + Assertions.assertEquals("cubiipuipw", response.enrollmentId()); + Assertions.assertTrue(response.require24X7Response()); Assertions.assertEquals(Consent.YES, response.advancedDiagnosticConsent()); - 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("acjekni", response.problemScopingQuestions()); + Assertions.assertEquals("hqvcimpevfgmblr", response.supportPlanId()); + Assertions.assertEquals("ilbywdxsm", response.contactDetails().firstName()); + Assertions.assertEquals("ccwr", response.contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, response.contactDetails().preferredContactMethod()); + Assertions.assertEquals("scjfnyns", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("jizdvoqyt", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("yo", response.contactDetails().phoneNumber()); + Assertions.assertEquals("bblgyavut", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("thjoxoism", response.contactDetails().country()); + Assertions.assertEquals("ksbpimlqoljx", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("tsttktlahbq", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T05:48:24Z"), response.problemStartTime()); + Assertions.assertEquals("xtgzukxitmmqtgqq", response.serviceId()); + Assertions.assertEquals("ivjlfrqttbajlka", response.fileWorkspaceName()); + Assertions.assertEquals("iopid", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("fku", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("cxkdmligovi", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("pmloazuruoc", response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("oorb", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); Assertions.assertEquals(UserConsent.NO, response.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("reafxtsgumhjg", response.secondaryConsent().get(0).type()); + Assertions.assertEquals("hjxa", response.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_PROCESSED, + response.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MINIMAL, response.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("ewbcihxuuw", response.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("j", response.communityForumPost()); } } 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 bf38054f5766..8ca88deed16f 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 @@ -1,17 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec 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.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SeverityLevel; import com.azure.resourcemanager.support.models.SupportTicketDetails; @@ -26,53 +27,59 @@ public final class SupportTicketsNoSubscriptionsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"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\"}]}"; + = "{\"value\":[{\"properties\":{\"supportTicketId\":\"ilaxhn\",\"description\":\"hqlyvijo\",\"problemClassificationId\":\"wivkxo\",\"problemClassificationDisplayName\":\"un\",\"severity\":\"critical\",\"enrollmentId\":\"xrtikvcpwpgclr\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"Yes\",\"problemScopingQuestions\":\"oxfrkenxpmyyefr\",\"supportPlanId\":\"pdnqqskawaoqvmmb\",\"contactDetails\":{\"firstName\":\"pqfrtqlkz\",\"lastName\":\"egnitg\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"xlzyqd\",\"additionalEmailAddresses\":[\"gcealzxwh\"],\"phoneNumber\":\"nsymoyqhlwigd\",\"preferredTimeZone\":\"vbkbxgomf\",\"country\":\"juwasqvdaeyyguxa\",\"preferredSupportLanguage\":\"jsqzhzbezk\"},\"serviceLevelAgreement\":{\"startTime\":\"2021-11-26T20:56:36Z\",\"expirationTime\":\"2021-06-24T15:18:16Z\",\"slaMinutes\":547751510},\"supportEngineer\":{\"emailAddress\":\"cddyvvjsk\"},\"supportPlanType\":\"mocwa\",\"supportPlanDisplayName\":\"qgatjeaahhvjhhn\",\"title\":\"kzyb\",\"problemStartTime\":\"2021-11-17T05:23:09Z\",\"serviceId\":\"idjks\",\"serviceDisplayName\":\"kyxvxevblbjedn\",\"status\":\"lageuaulxun\",\"createdDate\":\"2021-09-13T05:23:50Z\",\"modifiedDate\":\"2021-09-27T06:19:05Z\",\"fileWorkspaceName\":\"ppxynenls\",\"isTemporaryTicket\":\"Yes\",\"technicalTicketDetails\":{\"resourceId\":\"zg\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"nsrmffeycx\",\"quotaChangeRequestVersion\":\"tpiymerteea\",\"quotaChangeRequests\":[{\"region\":\"iekkkzddrtkgdojb\",\"payload\":\"vavrefdees\"},{\"region\":\"cuijpxt\",\"payload\":\"uwprtujwsawd\"},{\"region\":\"ibabxvititvtzeex\",\"payload\":\"oxtfglecdmdqbwp\"},{\"region\":\"q\",\"payload\":\"sfj\"}]},\"secondaryConsent\":[{\"userConsent\":\"No\",\"type\":\"hxudbxvodht\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationInitiated\",\"allowedSeverities\":[\"moderate\",\"minimal\",\"minimal\"],\"reasonForEscalation\":\"es\"},\"communityForumPost\":\"dlpagzrcxfail\",\"supportChannel\":\"Chat\",\"chatConversationStatus\":\"Active\"},\"id\":\"boxdfgsftufq\",\"name\":\"brjlnacgcckknhxk\",\"type\":\"zvytnrzvuljraaer\"}]}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.supportTicketsNoSubscriptions().list(1557744046, "jk", com.azure.core.util.Context.NONE); + = manager.supportTicketsNoSubscriptions().list(1753734199, "fwqzdz", com.azure.core.util.Context.NONE); - Assertions.assertEquals("fhmouwq", response.iterator().next().supportTicketId()); - Assertions.assertEquals("gzrf", response.iterator().next().description()); - Assertions.assertEquals("eeyebi", response.iterator().next().problemClassificationId()); + Assertions.assertEquals("ilaxhn", response.iterator().next().supportTicketId()); + Assertions.assertEquals("hqlyvijo", response.iterator().next().description()); + Assertions.assertEquals("wivkxo", 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("xrtikvcpwpgclr", response.iterator().next().enrollmentId()); + Assertions.assertFalse(response.iterator().next().require24X7Response()); Assertions.assertEquals(Consent.YES, response.iterator().next().advancedDiagnosticConsent()); - 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, + Assertions.assertEquals("oxfrkenxpmyyefr", response.iterator().next().problemScopingQuestions()); + Assertions.assertEquals("pdnqqskawaoqvmmb", response.iterator().next().supportPlanId()); + Assertions.assertEquals("pqfrtqlkz", response.iterator().next().contactDetails().firstName()); + Assertions.assertEquals("egnitg", response.iterator().next().contactDetails().lastName()); + Assertions.assertEquals(PreferredContactMethod.PHONE, response.iterator().next().contactDetails().preferredContactMethod()); - Assertions.assertEquals("i", response.iterator().next().contactDetails().primaryEmailAddress()); - Assertions.assertEquals("ircgpikpz", + Assertions.assertEquals("xlzyqd", response.iterator().next().contactDetails().primaryEmailAddress()); + Assertions.assertEquals("gcealzxwh", response.iterator().next().contactDetails().additionalEmailAddresses().get(0)); - 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"), + Assertions.assertEquals("nsymoyqhlwigd", response.iterator().next().contactDetails().phoneNumber()); + Assertions.assertEquals("vbkbxgomf", response.iterator().next().contactDetails().preferredTimeZone()); + Assertions.assertEquals("juwasqvdaeyyguxa", response.iterator().next().contactDetails().country()); + Assertions.assertEquals("jsqzhzbezk", response.iterator().next().contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("kzyb", response.iterator().next().title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-17T05:23:09Z"), response.iterator().next().problemStartTime()); - 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", + Assertions.assertEquals("idjks", response.iterator().next().serviceId()); + Assertions.assertEquals("ppxynenls", response.iterator().next().fileWorkspaceName()); + Assertions.assertEquals("zg", response.iterator().next().technicalTicketDetails().resourceId()); + Assertions.assertEquals("nsrmffeycx", response.iterator().next().quotaTicketDetails().quotaChangeRequestSubType()); - Assertions.assertEquals("hwhbotzingamv", + Assertions.assertEquals("tpiymerteea", response.iterator().next().quotaTicketDetails().quotaChangeRequestVersion()); - Assertions.assertEquals("szqzudphqamv", + Assertions.assertEquals("iekkkzddrtkgdojb", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).region()); - Assertions.assertEquals("fwynwcvtbvkay", + Assertions.assertEquals("vavrefdees", response.iterator().next().quotaTicketDetails().quotaChangeRequests().get(0).payload()); - Assertions.assertEquals(UserConsent.YES, response.iterator().next().secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("qiatkzwpcnp", response.iterator().next().secondaryConsent().get(0).type()); + Assertions.assertEquals(UserConsent.NO, response.iterator().next().secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("hxudbxvodht", response.iterator().next().secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_INITIATED, + response.iterator().next().directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MODERATE, + response.iterator().next().directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("es", response.iterator().next().directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("dlpagzrcxfail", response.iterator().next().communityForumPost()); } } 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 e35488ac1fc3..30c6e91aedf3 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 @@ -1,16 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; 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.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SecondaryConsent; import com.azure.resourcemanager.support.models.SeverityLevel; @@ -30,65 +32,74 @@ public final class SupportTicketsNoSubscriptionsUpdateWithResponseMockTests { @Test public void testUpdateWithResponse() throws Exception { String responseStr - = "{\"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\"}"; + = "{\"properties\":{\"supportTicketId\":\"gaehvvibrxjjst\",\"description\":\"qbeitpkxztmoob\",\"problemClassificationId\":\"lftidgfcwqmpim\",\"problemClassificationDisplayName\":\"xzhemjyh\",\"severity\":\"highestcriticalimpact\",\"enrollmentId\":\"jswtwkozzwc\",\"require24X7Response\":false,\"advancedDiagnosticConsent\":\"No\",\"problemScopingQuestions\":\"wpfaj\",\"supportPlanId\":\"wltlwtjjguktalh\",\"contactDetails\":{\"firstName\":\"nvkcdmxzrpoa\",\"lastName\":\"mlnwiaaomylweazu\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"sethwwn\",\"additionalEmailAddresses\":[\"l\"],\"phoneNumber\":\"swpchwahfbousn\",\"preferredTimeZone\":\"epgfew\",\"country\":\"twly\",\"preferredSupportLanguage\":\"gncxykxhdj\"},\"serviceLevelAgreement\":{\"startTime\":\"2020-12-24T16:01:24Z\",\"expirationTime\":\"2021-01-08T22:33:24Z\",\"slaMinutes\":122728116},\"supportEngineer\":{\"emailAddress\":\"bcporxvxcjzhqizx\"},\"supportPlanType\":\"xtgqscjavftjuh\",\"supportPlanDisplayName\":\"azkmtgguwp\",\"title\":\"jrajcivm\",\"problemStartTime\":\"2021-05-22T22:25:38Z\",\"serviceId\":\"f\",\"serviceDisplayName\":\"iwrxgkn\",\"status\":\"vyi\",\"createdDate\":\"2021-01-25T20:49:17Z\",\"modifiedDate\":\"2021-01-28T01:28:40Z\",\"fileWorkspaceName\":\"vpgshoxgsgbp\",\"isTemporaryTicket\":\"No\",\"technicalTicketDetails\":{\"resourceId\":\"tx\"},\"quotaTicketDetails\":{\"quotaChangeRequestSubType\":\"lbqvgaqvlgafcqu\",\"quotaChangeRequestVersion\":\"dvetnws\",\"quotaChangeRequests\":[{\"region\":\"nwlduycvuzhyrmew\",\"payload\":\"mvekdxukuqgsjj\"}]},\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"ketwzhhzjhfjmhv\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationInitiated\",\"allowedSeverities\":[\"minimal\",\"critical\"],\"reasonForEscalation\":\"eqsx\"},\"communityForumPost\":\"hfbuzjyihsasbhud\",\"supportChannel\":\"Web\",\"chatConversationStatus\":\"Active\"},\"id\":\"emslynsqyrp\",\"name\":\"oobrlttyms\",\"type\":\"nygq\"}"; 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)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SupportTicketDetails response = manager.supportTicketsNoSubscriptions() - .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")) + .updateWithResponse("luqovekqvg", + new UpdateSupportTicket().withSeverity(SeverityLevel.CRITICAL) + .withStatus(Status.CLOSED) + .withContactDetails(new UpdateContactProfile().withFirstName("mpjw") + .withLastName("vqikfxcvhrfsphu") + .withPreferredContactMethod(PreferredContactMethod.PHONE) + .withPrimaryEmailAddress("tikteusqczkvykl") + .withAdditionalEmailAddresses(Arrays.asList("yja", "fmmfblcqcu", "bgq")) + .withPhoneNumber("rtalmet") + .withPreferredTimeZone("wgdsl") + .withCountry("ihhrmo") + .withPreferredSupportLanguage("z")) .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"))), + .withSecondaryConsent(Arrays.asList( + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("tcxapzhyrpetogeb"), + new SecondaryConsent().withUserConsent(UserConsent.NO).withType("lhvnhlab"))) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_AVAILABLE) + .withAllowedSeverities( + Arrays.asList(SeverityLevel.MODERATE, SeverityLevel.HIGHESTCRITICALIMPACT)) + .withReasonForEscalation("b")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("dscwxqupevzhf", response.supportTicketId()); - Assertions.assertEquals("totxhojujb", response.description()); - Assertions.assertEquals("pelmcuvhixbjxyf", response.problemClassificationId()); + Assertions.assertEquals("gaehvvibrxjjst", response.supportTicketId()); + Assertions.assertEquals("qbeitpkxztmoob", response.description()); + Assertions.assertEquals("lftidgfcwqmpim", response.problemClassificationId()); Assertions.assertEquals(SeverityLevel.HIGHESTCRITICALIMPACT, response.severity()); - Assertions.assertEquals("o", response.enrollmentId()); - Assertions.assertEquals(true, response.require24X7Response()); + Assertions.assertEquals("jswtwkozzwc", response.enrollmentId()); + Assertions.assertFalse(response.require24X7Response()); 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("wpfaj", response.problemScopingQuestions()); + Assertions.assertEquals("wltlwtjjguktalh", response.supportPlanId()); + Assertions.assertEquals("nvkcdmxzrpoa", response.contactDetails().firstName()); + Assertions.assertEquals("mlnwiaaomylweazu", 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()); + Assertions.assertEquals("sethwwn", response.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("l", response.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("swpchwahfbousn", response.contactDetails().phoneNumber()); + Assertions.assertEquals("epgfew", response.contactDetails().preferredTimeZone()); + Assertions.assertEquals("twly", response.contactDetails().country()); + Assertions.assertEquals("gncxykxhdj", response.contactDetails().preferredSupportLanguage()); + Assertions.assertEquals("jrajcivm", response.title()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-22T22:25:38Z"), response.problemStartTime()); + Assertions.assertEquals("f", response.serviceId()); + Assertions.assertEquals("vpgshoxgsgbp", response.fileWorkspaceName()); + Assertions.assertEquals("tx", response.technicalTicketDetails().resourceId()); + Assertions.assertEquals("lbqvgaqvlgafcqu", response.quotaTicketDetails().quotaChangeRequestSubType()); + Assertions.assertEquals("dvetnws", response.quotaTicketDetails().quotaChangeRequestVersion()); + Assertions.assertEquals("nwlduycvuzhyrmew", + response.quotaTicketDetails().quotaChangeRequests().get(0).region()); + Assertions.assertEquals("mvekdxukuqgsjj", response.quotaTicketDetails().quotaChangeRequests().get(0).payload()); + Assertions.assertEquals(UserConsent.YES, response.secondaryConsent().get(0).userConsent()); + Assertions.assertEquals("ketwzhhzjhfjmhv", response.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_INITIATED, + response.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MINIMAL, response.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("eqsx", response.directConnectEscalation().reasonForEscalation()); + Assertions.assertEquals("hfbuzjyihsasbhud", response.communityForumPost()); } } 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 e481e9da077c..c2ee4895f134 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -12,14 +12,14 @@ public final class TechnicalTicketDetailsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TechnicalTicketDetails model - = BinaryData.fromString("{\"resourceId\":\"dhmdua\"}").toObject(TechnicalTicketDetails.class); - Assertions.assertEquals("dhmdua", model.resourceId()); + = BinaryData.fromString("{\"resourceId\":\"lpvlopw\"}").toObject(TechnicalTicketDetails.class); + Assertions.assertEquals("lpvlopw", model.resourceId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TechnicalTicketDetails model = new TechnicalTicketDetails().withResourceId("dhmdua"); + TechnicalTicketDetails model = new TechnicalTicketDetails().withResourceId("lpvlopw"); model = BinaryData.fromObject(model).toObject(TechnicalTicketDetails.class); - Assertions.assertEquals("dhmdua", model.resourceId()); + Assertions.assertEquals("lpvlopw", 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 3a93b7c429ea..0f857df594ac 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -14,39 +14,39 @@ public final class UpdateContactProfileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateContactProfile model = BinaryData.fromString( - "{\"firstName\":\"eualupjmkhf\",\"lastName\":\"bbcswsrtjri\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"pbewtghfgblcgwx\",\"additionalEmailAddresses\":[\"v\",\"hjkbegibtnmxieb\",\"waloayqcgwr\",\"zjuzgwyz\"],\"phoneNumber\":\"txon\",\"preferredTimeZone\":\"ts\",\"country\":\"jcbpwxqpsrknft\",\"preferredSupportLanguage\":\"vriuhprwmdyvx\"}") + "{\"firstName\":\"rxsbkyvp\",\"lastName\":\"anuzbpzkafkuw\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"wbme\",\"additionalEmailAddresses\":[\"eyvjusrtslhspkde\",\"maofmxagkv\"],\"phoneNumber\":\"elmqk\",\"preferredTimeZone\":\"ahvljuaha\",\"country\":\"hcdhmdual\",\"preferredSupportLanguage\":\"xqpvfadmw\"}") .toObject(UpdateContactProfile.class); - Assertions.assertEquals("eualupjmkhf", model.firstName()); - Assertions.assertEquals("bbcswsrtjri", model.lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); - 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()); + Assertions.assertEquals("rxsbkyvp", model.firstName()); + Assertions.assertEquals("anuzbpzkafkuw", model.lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.preferredContactMethod()); + Assertions.assertEquals("wbme", model.primaryEmailAddress()); + Assertions.assertEquals("eyvjusrtslhspkde", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("elmqk", model.phoneNumber()); + Assertions.assertEquals("ahvljuaha", model.preferredTimeZone()); + Assertions.assertEquals("hcdhmdual", model.country()); + Assertions.assertEquals("xqpvfadmw", model.preferredSupportLanguage()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - 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"); + UpdateContactProfile model = new UpdateContactProfile().withFirstName("rxsbkyvp") + .withLastName("anuzbpzkafkuw") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("wbme") + .withAdditionalEmailAddresses(Arrays.asList("eyvjusrtslhspkde", "maofmxagkv")) + .withPhoneNumber("elmqk") + .withPreferredTimeZone("ahvljuaha") + .withCountry("hcdhmdual") + .withPreferredSupportLanguage("xqpvfadmw"); model = BinaryData.fromObject(model).toObject(UpdateContactProfile.class); - Assertions.assertEquals("eualupjmkhf", model.firstName()); - Assertions.assertEquals("bbcswsrtjri", model.lastName()); - Assertions.assertEquals(PreferredContactMethod.PHONE, model.preferredContactMethod()); - 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()); + Assertions.assertEquals("rxsbkyvp", model.firstName()); + Assertions.assertEquals("anuzbpzkafkuw", model.lastName()); + Assertions.assertEquals(PreferredContactMethod.EMAIL, model.preferredContactMethod()); + Assertions.assertEquals("wbme", model.primaryEmailAddress()); + Assertions.assertEquals("eyvjusrtslhspkde", model.additionalEmailAddresses().get(0)); + Assertions.assertEquals("elmqk", model.phoneNumber()); + Assertions.assertEquals("ahvljuaha", model.preferredTimeZone()); + Assertions.assertEquals("hcdhmdual", model.country()); + Assertions.assertEquals("xqpvfadmw", 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 042c765bbd81..94a892eae575 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 @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.support.models.Consent; +import com.azure.resourcemanager.support.models.DirectConnectEscalation; +import com.azure.resourcemanager.support.models.EscalationStatus; import com.azure.resourcemanager.support.models.PreferredContactMethod; import com.azure.resourcemanager.support.models.SecondaryConsent; import com.azure.resourcemanager.support.models.SeverityLevel; @@ -20,54 +22,66 @@ public final class UpdateSupportTicketTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UpdateSupportTicket model = BinaryData.fromString( - "{\"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\"}]}") + "{\"severity\":\"minimal\",\"status\":\"closed\",\"contactDetails\":{\"firstName\":\"bkc\",\"lastName\":\"dhbt\",\"preferredContactMethod\":\"email\",\"primaryEmailAddress\":\"ywpnvjt\",\"additionalEmailAddresses\":[\"ermclfplphoxuscr\",\"abgy\"],\"phoneNumber\":\"sbj\",\"preferredTimeZone\":\"zq\",\"country\":\"xywpmueefjzwfqkq\",\"preferredSupportLanguage\":\"ids\"},\"advancedDiagnosticConsent\":\"No\",\"secondaryConsent\":[{\"userConsent\":\"Yes\",\"type\":\"aocqxtccmgy\"},{\"userConsent\":\"Yes\",\"type\":\"tlmoyrx\"},{\"userConsent\":\"Yes\",\"type\":\"dw\"}],\"directConnectEscalation\":{\"azureEEStatus\":\"EscalationInitiated\",\"allowedSeverities\":[\"moderate\",\"moderate\"],\"reasonForEscalation\":\"lrqjbhckfr\"}}") .toObject(UpdateSupportTicket.class); - 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(SeverityLevel.MINIMAL, model.severity()); + Assertions.assertEquals(Status.CLOSED, model.status()); + Assertions.assertEquals("bkc", model.contactDetails().firstName()); + Assertions.assertEquals("dhbt", 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("ywpnvjt", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ermclfplphoxuscr", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("sbj", model.contactDetails().phoneNumber()); + Assertions.assertEquals("zq", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("xywpmueefjzwfqkq", model.contactDetails().country()); + Assertions.assertEquals("ids", model.contactDetails().preferredSupportLanguage()); Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("znbmpowuwprzq", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("aocqxtccmgy", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_INITIATED, model.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MODERATE, model.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("lrqjbhckfr", model.directConnectEscalation().reasonForEscalation()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UpdateSupportTicket model = new UpdateSupportTicket().withSeverity(SeverityLevel.HIGHESTCRITICALIMPACT) - .withStatus(Status.OPEN) - .withContactDetails(new UpdateContactProfile().withFirstName("ooxdjebwpuc") - .withLastName("fvovbvmeuecivy") + UpdateSupportTicket model = new UpdateSupportTicket().withSeverity(SeverityLevel.MINIMAL) + .withStatus(Status.CLOSED) + .withContactDetails(new UpdateContactProfile().withFirstName("bkc") + .withLastName("dhbt") .withPreferredContactMethod(PreferredContactMethod.EMAIL) - .withPrimaryEmailAddress("uojgj") - .withAdditionalEmailAddresses(Arrays.asList("ueiotwmcdyt", "x", "it", "nrjawgqwg")) - .withPhoneNumber("ni") - .withPreferredTimeZone("x") - .withCountry("kpycgklwndnhjd") - .withPreferredSupportLanguage("whvylw")) + .withPrimaryEmailAddress("ywpnvjt") + .withAdditionalEmailAddresses(Arrays.asList("ermclfplphoxuscr", "abgy")) + .withPhoneNumber("sbj") + .withPreferredTimeZone("zq") + .withCountry("xywpmueefjzwfqkq") + .withPreferredSupportLanguage("ids")) .withAdvancedDiagnosticConsent(Consent.NO) .withSecondaryConsent( - Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("znbmpowuwprzq"))); + Arrays.asList(new SecondaryConsent().withUserConsent(UserConsent.YES).withType("aocqxtccmgy"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("tlmoyrx"), + new SecondaryConsent().withUserConsent(UserConsent.YES).withType("dw"))) + .withDirectConnectEscalation( + new DirectConnectEscalation().withAzureEEStatus(EscalationStatus.ESCALATION_INITIATED) + .withAllowedSeverities(Arrays.asList(SeverityLevel.MODERATE, SeverityLevel.MODERATE)) + .withReasonForEscalation("lrqjbhckfr")); model = BinaryData.fromObject(model).toObject(UpdateSupportTicket.class); - 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(SeverityLevel.MINIMAL, model.severity()); + Assertions.assertEquals(Status.CLOSED, model.status()); + Assertions.assertEquals("bkc", model.contactDetails().firstName()); + Assertions.assertEquals("dhbt", 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("ywpnvjt", model.contactDetails().primaryEmailAddress()); + Assertions.assertEquals("ermclfplphoxuscr", model.contactDetails().additionalEmailAddresses().get(0)); + Assertions.assertEquals("sbj", model.contactDetails().phoneNumber()); + Assertions.assertEquals("zq", model.contactDetails().preferredTimeZone()); + Assertions.assertEquals("xywpmueefjzwfqkq", model.contactDetails().country()); + Assertions.assertEquals("ids", model.contactDetails().preferredSupportLanguage()); Assertions.assertEquals(Consent.NO, model.advancedDiagnosticConsent()); Assertions.assertEquals(UserConsent.YES, model.secondaryConsent().get(0).userConsent()); - Assertions.assertEquals("znbmpowuwprzq", model.secondaryConsent().get(0).type()); + Assertions.assertEquals("aocqxtccmgy", model.secondaryConsent().get(0).type()); + Assertions.assertEquals(EscalationStatus.ESCALATION_INITIATED, model.directConnectEscalation().azureEEStatus()); + Assertions.assertEquals(SeverityLevel.MODERATE, model.directConnectEscalation().allowedSeverities().get(0)); + Assertions.assertEquals("lrqjbhckfr", model.directConnectEscalation().reasonForEscalation()); } } 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 f477ffaa56d3..6ac7cc85aa69 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.support.generated; @@ -11,17 +11,17 @@ public final class UploadFileTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UploadFile model = BinaryData.fromString("{\"content\":\"wlrbqtkoievseo\",\"chunkIndex\":143823433}") + UploadFile model = BinaryData.fromString("{\"content\":\"cnqxwbpokulpi\",\"chunkIndex\":1590380030}") .toObject(UploadFile.class); - Assertions.assertEquals("wlrbqtkoievseo", model.content()); - Assertions.assertEquals(143823433, model.chunkIndex()); + Assertions.assertEquals("cnqxwbpokulpi", model.content()); + Assertions.assertEquals(1590380030, model.chunkIndex()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UploadFile model = new UploadFile().withContent("wlrbqtkoievseo").withChunkIndex(143823433); + UploadFile model = new UploadFile().withContent("cnqxwbpokulpi").withChunkIndex(1590380030); model = BinaryData.fromObject(model).toObject(UploadFile.class); - Assertions.assertEquals("wlrbqtkoievseo", model.content()); - Assertions.assertEquals(143823433, model.chunkIndex()); + Assertions.assertEquals("cnqxwbpokulpi", model.content()); + Assertions.assertEquals(1590380030, model.chunkIndex()); } } diff --git a/sdk/support/azure-resourcemanager-support/tsp-location.yaml b/sdk/support/azure-resourcemanager-support/tsp-location.yaml new file mode 100644 index 000000000000..3ce8e587157c --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/support/resource-manager/Microsoft.Support/Support +commit: a9aeac67ba49c60fccbbc6d0ba4e805970160372 +repo: Azure/azure-rest-api-specs +additionalDirectories: