diff --git a/sdk/support/azure-resourcemanager-support/CHANGELOG.md b/sdk/support/azure-resourcemanager-support/CHANGELOG.md index e7d423fef45d..86fa6b3df6df 100644 --- a/sdk/support/azure-resourcemanager-support/CHANGELOG.md +++ b/sdk/support/azure-resourcemanager-support/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-03-15) +- 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-2020-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-04-19) diff --git a/sdk/support/azure-resourcemanager-support/README.md b/sdk/support/azure-resourcemanager-support/README.md index 38ac9977e2ba..a28a123f42cd 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-2020-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 tag package-2020-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-support - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/support/azure-resourcemanager-support/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/support/azure-resourcemanager-support/SAMPLE.md b/sdk/support/azure-resourcemanager-support/SAMPLE.md new file mode 100644 index 000000000000..a0ec338523a1 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/SAMPLE.md @@ -0,0 +1,1106 @@ +# Code snippets and samples + + +## Communications + +- [CheckNameAvailability](#communications_checknameavailability) +- [Create](#communications_create) +- [Get](#communications_get) +- [List](#communications_list) + +## Operations + +- [List](#operations_list) + +## ProblemClassifications + +- [Get](#problemclassifications_get) +- [List](#problemclassifications_list) + +## Services + +- [Get](#services_get) +- [List](#services_list) + +## SupportTickets + +- [CheckNameAvailability](#supporttickets_checknameavailability) +- [Create](#supporttickets_create) +- [Get](#supporttickets_get) +- [List](#supporttickets_list) +- [Update](#supporttickets_update) +### Communications_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.support.models.Type; + +/** Samples for Communications CheckNameAvailability. */ +public final class CommunicationsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json + */ + /** + * Sample code: Checks whether name is available for Communication resource. + * + * @param manager Entry point to SupportManager. + */ + public static void checksWhetherNameIsAvailableForCommunicationResource( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .communications() + .checkNameAvailabilityWithResponse( + "testticket", + new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + Context.NONE); + } +} +``` + +### Communications_Create + +```java +/** Samples for Communications Create. */ +public final class CommunicationsCreateSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json + */ + /** + * Sample code: AddCommunicationToSubscriptionTicket. + * + * @param manager Entry point to SupportManager. + */ + public static void addCommunicationToSubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { + manager + .communications() + .define("testcommunication") + .withExistingSupportTicket("testticket") + .withSender("user@contoso.com") + .withSubject("This is a test message from a customer!") + .withBody("This is a test message from a customer!") + .create(); + } +} +``` + +### Communications_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Communications Get. */ +public final class CommunicationsGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json + */ + /** + * Sample code: Get communication details for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void getCommunicationDetailsForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager.communications().getWithResponse("testticket", "testmessage", Context.NONE); + } +} +``` + +### Communications_List + +```java +import com.azure.core.util.Context; + +/** Samples for Communications List. */ +public final class CommunicationsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json + */ + /** + * Sample code: List communications for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void listCommunicationsForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager.communications().list("testticket", null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json + */ + /** + * Sample code: List web communications for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void listWebCommunicationsForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager.communications().list("testticket", null, "communicationType eq 'web'", Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + */ + /** + * Sample code: List web communication created on or after a specific date for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .communications() + .list( + "testticket", null, "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", Context.NONE); + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json + */ + /** + * Sample code: Get all operations. + * + * @param manager Entry point to SupportManager. + */ + public static void getAllOperations(com.azure.resourcemanager.support.SupportManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + +### ProblemClassifications_Get + +```java +import com.azure.core.util.Context; + +/** Samples for ProblemClassifications Get. */ +public final class ProblemClassificationsGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json + */ + /** + * Sample code: Gets details of problemClassification for Azure service. + * + * @param manager Entry point to SupportManager. + */ + public static void getsDetailsOfProblemClassificationForAzureService( + com.azure.resourcemanager.support.SupportManager manager) { + manager.problemClassifications().getWithResponse("service_guid", "problemClassification_guid", Context.NONE); + } +} +``` + +### ProblemClassifications_List + +```java +import com.azure.core.util.Context; + +/** Samples for ProblemClassifications List. */ +public final class ProblemClassificationsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json + */ + /** + * Sample code: Gets list of problemClassifications for a service for which a support ticket can be created. + * + * @param manager Entry point to SupportManager. + */ + public static void getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated( + com.azure.resourcemanager.support.SupportManager manager) { + manager.problemClassifications().list("service_guid", Context.NONE); + } +} +``` + +### Services_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Services Get. */ +public final class ServicesGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json + */ + /** + * Sample code: Gets details of the Azure service. + * + * @param manager Entry point to SupportManager. + */ + public static void getsDetailsOfTheAzureService(com.azure.resourcemanager.support.SupportManager manager) { + manager.services().getWithResponse("service_guid", Context.NONE); + } +} +``` + +### Services_List + +```java +import com.azure.core.util.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json + */ + /** + * Sample code: Gets list of services for which a support ticket can be created. + * + * @param manager Entry point to SupportManager. + */ + public static void getsListOfServicesForWhichASupportTicketCanBeCreated( + com.azure.resourcemanager.support.SupportManager manager) { + manager.services().list(Context.NONE); + } +} +``` + +### SupportTickets_CheckNameAvailability + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.support.models.Type; + +/** Samples for SupportTickets CheckNameAvailability. */ +public final class SupportTicketsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json + */ + /** + * Sample code: Checks whether name is available for SupportTicket resource. + * + * @param manager Entry point to SupportManager. + */ + public static void checksWhetherNameIsAvailableForSupportTicketResource( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityInput() + .withName("sampleName") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), + Context.NONE); + } +} +``` + +### SupportTickets_Create + +```java +import com.azure.resourcemanager.support.models.ContactProfile; +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.SeverityLevel; +import com.azure.resourcemanager.support.models.TechnicalTicketDetails; +import java.util.Arrays; + +/** Samples for SupportTickets Create. */ +public final class SupportTicketsCreateSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json + */ + /** + * Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForDTUsForAzureSynapseAnalytics( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("DTUs") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("BatchAml") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Subscription") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json + */ + /** + * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("DTUs") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json + */ + /** + * 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 + createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload( + "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("SQLMI") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Pools for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload( + "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Servers for SQL Database. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForServersForSQLDatabase( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Servers") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Billing related issues. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/billing_service_guid") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Subscription Management related issues. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForSubscriptionManagementRelatedIssues( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Technical issue related to a specific resource. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForTechnicalIssueRelatedToASpecificResource( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withTechnicalTicketDetails( + new TechnicalTicketDetails() + .withResourceId( + "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("BatchAml") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload( + "{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Servers") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Compute VM Cores. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForComputeVMCores( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}")))) + .create(); + } +} +``` + +### SupportTickets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for SupportTickets Get. */ +public final class SupportTicketsGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json + */ + /** + * Sample code: Get details of a subscription ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void getDetailsOfASubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().getWithResponse("testticket", Context.NONE); + } +} +``` + +### SupportTickets_List + +```java +import com.azure.core.util.Context; + +/** Samples for SupportTickets List. */ +public final class SupportTicketsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + */ + /** + * Sample code: List support tickets created on or after a certain date and in open state for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json + */ + /** + * Sample code: List support tickets for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void listSupportTicketsForASubscription(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().list(null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json + */ + /** + * Sample code: List support tickets in open state for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void listSupportTicketsInOpenStateForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().list(null, "status eq 'Open'", Context.NONE); + } +} +``` + +### SupportTickets_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.support.models.PreferredContactMethod; +import com.azure.resourcemanager.support.models.SeverityLevel; +import com.azure.resourcemanager.support.models.Status; +import com.azure.resourcemanager.support.models.SupportTicketDetails; +import com.azure.resourcemanager.support.models.UpdateContactProfile; +import java.util.Arrays; + +/** Samples for SupportTickets Update. */ +public final class SupportTicketsUpdateSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update severity of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void updateSeverityOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", Context.NONE).getValue(); + resource.update().withSeverity(SeverityLevel.CRITICAL).apply(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update status of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void updateStatusOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", Context.NONE).getValue(); + resource.update().withStatus(Status.CLOSED).apply(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update contact details of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void updateContactDetailsOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", Context.NONE).getValue(); + resource + .update() + .withContactDetails( + new UpdateContactProfile() + .withFirstName("first name") + .withLastName("last name") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("test.name@contoso.com") + .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) + .withPhoneNumber("123-456-7890") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("USA") + .withPreferredSupportLanguage("en-US")) + .apply(); + } +} +``` + diff --git a/sdk/support/azure-resourcemanager-support/pom.xml b/sdk/support/azure-resourcemanager-support/pom.xml index 178d58a3e07e..53545aa3e8a0 100644 --- a/sdk/support/azure-resourcemanager-support/pom.xml +++ b/sdk/support/azure-resourcemanager-support/pom.xml @@ -1,55 +1,55 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-support - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-support + 1.0.0-beta.2 + 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-2020-04. - https://github.com/Azure/azure-sdk-for-java + 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-2020-04. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - true - - - - com.azure - azure-core - 1.26.0 - - - com.azure - azure-core-management - 1.5.3 - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.26.0 + + + com.azure + azure-core-management + 1.5.3 + + 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 740d2efe9f0f..f00202e85b19 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 @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +17,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -37,6 +38,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to SupportManager. Microsoft Azure Support Resource Provider. */ public final class SupportManager { @@ -65,11 +67,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."); @@ -88,11 +90,12 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -132,6 +135,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -150,19 +164,21 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } /** - * 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."); @@ -188,20 +204,33 @@ public SupportManager authenticate(TokenCredential credential, AzureProfile prof userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = 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 2a9fb2ab6b44..68c175cee777 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 @@ -42,7 +42,7 @@ CheckNameAvailabilityOutputInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( @@ -60,7 +60,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of Communication resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String supportTicketName); @@ -83,7 +83,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of Communication resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( @@ -111,7 +111,7 @@ PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -126,9 +126,9 @@ Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CommunicationDetailsInner> beginCreate( String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters); @@ -142,9 +142,9 @@ SyncPoller, CommunicationDetailsInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CommunicationDetailsInner> beginCreate( String supportTicketName, String communicationName, 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 7dd1b2036500..7295a892d43a 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 @@ -17,7 +17,8 @@ public interface OperationsClient { * * @throws com.azure.core.management.exception.ManagementException 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. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +30,8 @@ public interface OperationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); 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 5dbfeddbff52..a3c2b59d2a9d 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 @@ -22,7 +22,7 @@ public interface ProblemClassificationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String serviceName); @@ -37,7 +37,7 @@ public interface ProblemClassificationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String serviceName, Context context); @@ -64,7 +64,7 @@ public interface ProblemClassificationsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 problem classification details for a specific Azure service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( 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 0aa7a64863d9..877542b8341a 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 @@ -23,7 +23,7 @@ public interface ServicesClient { * * @throws com.azure.core.management.exception.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. + * @return collection of Service resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -40,7 +40,7 @@ public interface ServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of Service resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -65,7 +65,7 @@ public interface ServicesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a specific Azure service for support ticket creation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String serviceName, Context context); 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 b20dbf1e716e..25d07edd9563 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 @@ -40,7 +40,7 @@ public interface SupportTicketsClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response checkNameAvailabilityWithResponse( @@ -54,7 +54,8 @@ Response checkNameAvailabilityWithResponse( * * @throws com.azure.core.management.exception.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. + * @return object that represents a collection of SupportTicket resources as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -74,7 +75,8 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @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); @@ -101,7 +103,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 ticket details for an Azure subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String supportTicketName, Context context); @@ -138,7 +140,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 object that represents SupportTicketDetails resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -168,9 +170,9 @@ Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SupportTicketDetailsInner> beginCreate( String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters); @@ -199,9 +201,9 @@ SyncPoller, SupportTicketDetailsInner> beg * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, SupportTicketDetailsInner> beginCreate( String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context); 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 b67f0d0065c6..9e278a1bf5f5 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Output of check name availability API. */ @Immutable public final class CheckNameAvailabilityOutputInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityOutputInner.class); - /* * Indicates whether the name is available. */ 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 f6d00fae517b..94ddd6ef303c 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 @@ -5,57 +5,29 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.models.CommunicationDirection; import com.azure.resourcemanager.support.models.CommunicationType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Object that represents a Communication resource. */ -@JsonFlatten @Fluent -public class CommunicationDetailsInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CommunicationDetailsInner.class); - +public final class CommunicationDetailsInner extends ProxyResource { /* - * Communication type. + * Properties of the resource. */ - @JsonProperty(value = "properties.communicationType", access = JsonProperty.Access.WRITE_ONLY) - private CommunicationType communicationType; + @JsonProperty(value = "properties") + private CommunicationDetailsProperties innerProperties; - /* - * Direction of communication. - */ - @JsonProperty(value = "properties.communicationDirection", access = JsonProperty.Access.WRITE_ONLY) - private CommunicationDirection communicationDirection; - - /* - * Email address of the sender. This property is required if called by a - * service principal. - */ - @JsonProperty(value = "properties.sender") - private String sender; - - /* - * Subject of the communication. - */ - @JsonProperty(value = "properties.subject") - private String subject; - - /* - * Body of the communication. - */ - @JsonProperty(value = "properties.body") - private String body; - - /* - * Time in UTC (ISO 8601 format) when the communication was created. + /** + * Get the innerProperties property: Properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + private CommunicationDetailsProperties innerProperties() { + return this.innerProperties; + } /** * Get the communicationType property: Communication type. @@ -63,7 +35,7 @@ public class CommunicationDetailsInner extends ProxyResource { * @return the communicationType value. */ public CommunicationType communicationType() { - return this.communicationType; + return this.innerProperties() == null ? null : this.innerProperties().communicationType(); } /** @@ -72,7 +44,7 @@ public CommunicationType communicationType() { * @return the communicationDirection value. */ public CommunicationDirection communicationDirection() { - return this.communicationDirection; + return this.innerProperties() == null ? null : this.innerProperties().communicationDirection(); } /** @@ -81,7 +53,7 @@ public CommunicationDirection communicationDirection() { * @return the sender value. */ public String sender() { - return this.sender; + return this.innerProperties() == null ? null : this.innerProperties().sender(); } /** @@ -91,7 +63,10 @@ public String sender() { * @return the CommunicationDetailsInner object itself. */ public CommunicationDetailsInner withSender(String sender) { - this.sender = sender; + if (this.innerProperties() == null) { + this.innerProperties = new CommunicationDetailsProperties(); + } + this.innerProperties().withSender(sender); return this; } @@ -101,7 +76,7 @@ public CommunicationDetailsInner withSender(String sender) { * @return the subject value. */ public String subject() { - return this.subject; + return this.innerProperties() == null ? null : this.innerProperties().subject(); } /** @@ -111,7 +86,10 @@ public String subject() { * @return the CommunicationDetailsInner object itself. */ public CommunicationDetailsInner withSubject(String subject) { - this.subject = subject; + if (this.innerProperties() == null) { + this.innerProperties = new CommunicationDetailsProperties(); + } + this.innerProperties().withSubject(subject); return this; } @@ -121,7 +99,7 @@ public CommunicationDetailsInner withSubject(String subject) { * @return the body value. */ public String body() { - return this.body; + return this.innerProperties() == null ? null : this.innerProperties().body(); } /** @@ -131,7 +109,10 @@ public String body() { * @return the CommunicationDetailsInner object itself. */ public CommunicationDetailsInner withBody(String body) { - this.body = body; + if (this.innerProperties() == null) { + this.innerProperties = new CommunicationDetailsProperties(); + } + this.innerProperties().withBody(body); return this; } @@ -141,7 +122,7 @@ public CommunicationDetailsInner withBody(String body) { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -150,5 +131,8 @@ public OffsetDateTime createdDate() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..8264644a1e3e --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/CommunicationDetailsProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.support.models.CommunicationDirection; +import com.azure.resourcemanager.support.models.CommunicationType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a communication resource. */ +@Fluent +public final class CommunicationDetailsProperties { + /* + * Communication type. + */ + @JsonProperty(value = "communicationType", access = JsonProperty.Access.WRITE_ONLY) + private CommunicationType communicationType; + + /* + * Direction of communication. + */ + @JsonProperty(value = "communicationDirection", access = JsonProperty.Access.WRITE_ONLY) + private CommunicationDirection communicationDirection; + + /* + * Email address of the sender. This property is required if called by a + * service principal. + */ + @JsonProperty(value = "sender") + private String sender; + + /* + * Subject of the communication. + */ + @JsonProperty(value = "subject", required = true) + private String subject; + + /* + * Body of the communication. + */ + @JsonProperty(value = "body", required = true) + private String body; + + /* + * Time in UTC (ISO 8601 format) when the communication was created. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /** + * Get the communicationType property: Communication type. + * + * @return the communicationType value. + */ + public CommunicationType communicationType() { + return this.communicationType; + } + + /** + * Get the communicationDirection property: Direction of communication. + * + * @return the communicationDirection value. + */ + public CommunicationDirection communicationDirection() { + return this.communicationDirection; + } + + /** + * Get the sender property: Email address of the sender. This property is required if called by a service principal. + * + * @return the sender value. + */ + public String sender() { + return this.sender; + } + + /** + * Set the sender property: Email address of the sender. This property is required if called by a service principal. + * + * @param sender the sender value to set. + * @return the CommunicationDetailsProperties object itself. + */ + public CommunicationDetailsProperties withSender(String sender) { + this.sender = sender; + return this; + } + + /** + * Get the subject property: Subject of the communication. + * + * @return the subject value. + */ + public String subject() { + return this.subject; + } + + /** + * Set the subject property: Subject of the communication. + * + * @param subject the subject value to set. + * @return the CommunicationDetailsProperties object itself. + */ + public CommunicationDetailsProperties withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get the body property: Body of the communication. + * + * @return the body value. + */ + public String body() { + return this.body; + } + + /** + * Set the body property: Body of the communication. + * + * @param body the body value to set. + * @return the CommunicationDetailsProperties object itself. + */ + public CommunicationDetailsProperties withBody(String body) { + this.body = body; + return this; + } + + /** + * Get the createdDate property: Time in UTC (ISO 8601 format) when the communication was created. + * + * @return the createdDate value. + */ + 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 + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property subject in model CommunicationDetailsProperties")); + } + if (body() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property body in model CommunicationDetailsProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommunicationDetailsProperties.class); +} 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 3528d17b955a..3ab6153648f3 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The operation supported by Microsoft Support resource provider. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * Operation name: {provider}/{resource}/{operation}. */ 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 f1fb36bff133..4eafe1b2ca3a 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 @@ -5,17 +5,11 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** ProblemClassification resource object. */ -@JsonFlatten @Fluent -public class ProblemClassificationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProblemClassificationInner.class); - +public final class ProblemClassificationInner { /* * Id of the resource. */ @@ -35,10 +29,10 @@ public class ProblemClassificationInner { private String type; /* - * Localized name of problem classification. + * Properties of the resource. */ - @JsonProperty(value = "properties.displayName") - private String displayName; + @JsonProperty(value = "properties") + private ProblemClassificationProperties innerProperties; /** * Get the id property: Id of the resource. @@ -67,13 +61,22 @@ public String type() { return this.type; } + /** + * Get the innerProperties property: Properties of the resource. + * + * @return the innerProperties value. + */ + private ProblemClassificationProperties innerProperties() { + return this.innerProperties; + } + /** * Get the displayName property: Localized name of problem classification. * * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -83,7 +86,10 @@ public String displayName() { * @return the ProblemClassificationInner object itself. */ public ProblemClassificationInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new ProblemClassificationProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -93,5 +99,8 @@ public ProblemClassificationInner withDisplayName(String displayName) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..67272994e2cf --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ProblemClassificationProperties.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Details about a problem classification available for an Azure service. */ +@Fluent +public final class ProblemClassificationProperties { + /* + * Localized name of problem classification. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the displayName property: Localized name of problem classification. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: Localized name of problem classification. + * + * @param displayName the displayName value to set. + * @return the ProblemClassificationProperties object itself. + */ + public ProblemClassificationProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/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 eef990a4edc8..f89efa8c3ff2 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 @@ -5,18 +5,12 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Object that represents a Service resource. */ -@JsonFlatten @Fluent -public class ServiceInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceInner.class); - +public final class ServiceInner { /* * Id of the resource. */ @@ -36,16 +30,10 @@ public class ServiceInner { private String type; /* - * Localized name of the Azure service. + * Properties of the resource. */ - @JsonProperty(value = "properties.displayName") - private String displayName; - - /* - * ARM Resource types. - */ - @JsonProperty(value = "properties.resourceTypes") - private List resourceTypes; + @JsonProperty(value = "properties") + private ServiceProperties innerProperties; /** * Get the id property: Id of the resource. @@ -74,13 +62,22 @@ public String type() { return this.type; } + /** + * Get the innerProperties property: Properties of the resource. + * + * @return the innerProperties value. + */ + private ServiceProperties innerProperties() { + return this.innerProperties; + } + /** * Get the displayName property: Localized name of the Azure service. * * @return the displayName value. */ public String displayName() { - return this.displayName; + return this.innerProperties() == null ? null : this.innerProperties().displayName(); } /** @@ -90,7 +87,10 @@ public String displayName() { * @return the ServiceInner object itself. */ public ServiceInner withDisplayName(String displayName) { - this.displayName = displayName; + if (this.innerProperties() == null) { + this.innerProperties = new ServiceProperties(); + } + this.innerProperties().withDisplayName(displayName); return this; } @@ -100,7 +100,7 @@ public ServiceInner withDisplayName(String displayName) { * @return the resourceTypes value. */ public List resourceTypes() { - return this.resourceTypes; + return this.innerProperties() == null ? null : this.innerProperties().resourceTypes(); } /** @@ -110,7 +110,10 @@ public List resourceTypes() { * @return the ServiceInner object itself. */ public ServiceInner withResourceTypes(List resourceTypes) { - this.resourceTypes = resourceTypes; + if (this.innerProperties() == null) { + this.innerProperties = new ServiceProperties(); + } + this.innerProperties().withResourceTypes(resourceTypes); return this; } @@ -120,5 +123,8 @@ public ServiceInner withResourceTypes(List resourceTypes) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } 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 new file mode 100644 index 000000000000..a743216fb57f --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/ServiceProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Details about an Azure service available for support ticket creation. */ +@Fluent +public final class ServiceProperties { + /* + * Localized name of the Azure service. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /* + * ARM Resource types. + */ + @JsonProperty(value = "resourceTypes") + private List resourceTypes; + + /** + * 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 ServiceProperties object itself. + */ + public ServiceProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the resourceTypes property: ARM Resource types. + * + * @return the resourceTypes value. + */ + public List 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() { + } +} 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 177b396f1146..2d4a8289297a 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 @@ -5,153 +5,33 @@ package com.azure.resourcemanager.support.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.models.ContactProfile; import com.azure.resourcemanager.support.models.QuotaTicketDetails; 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.TechnicalTicketDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Object that represents SupportTicketDetails resource. */ -@JsonFlatten @Fluent -public class SupportTicketDetailsInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportTicketDetailsInner.class); - - /* - * System generated support ticket Id that is unique. - */ - @JsonProperty(value = "properties.supportTicketId") - private String supportTicketId; - - /* - * Detailed description of the question or issue. - */ - @JsonProperty(value = "properties.description") - private String description; - - /* - * Each Azure service has its own set of issue categories, also known as - * problem classification. This parameter is the unique Id for the type of - * problem you are experiencing. - */ - @JsonProperty(value = "properties.problemClassificationId") - private String problemClassificationId; - - /* - * Localized name of problem classification. - */ - @JsonProperty(value = "properties.problemClassificationDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String problemClassificationDisplayName; - - /* - * A value that indicates the urgency of the case, which in turn determines - * the response time according to the service level agreement of the - * technical support plan you have with Azure. Note: 'Highest critical - * impact', also known as the 'Emergency - Severe impact' level in the - * Azure portal is reserved only for our Premium customers. - */ - @JsonProperty(value = "properties.severity") - private SeverityLevel severity; - - /* - * Enrollment Id associated with the support ticket. - */ - @JsonProperty(value = "properties.enrollmentId", access = JsonProperty.Access.WRITE_ONLY) - private String enrollmentId; - - /* - * Indicates if this requires a 24x7 response from Azure. - */ - @JsonProperty(value = "properties.require24X7Response") - private Boolean require24X7Response; - - /* - * Contact information of the user requesting to create a support ticket. - */ - @JsonProperty(value = "properties.contactDetails") - private ContactProfile contactDetails; - - /* - * Service Level Agreement information for this support ticket. - */ - @JsonProperty(value = "properties.serviceLevelAgreement") - private ServiceLevelAgreement serviceLevelAgreement; - - /* - * Information about the support engineer working on this support ticket. - */ - @JsonProperty(value = "properties.supportEngineer") - private SupportEngineer supportEngineer; - - /* - * Support plan type associated with the support ticket. - */ - @JsonProperty(value = "properties.supportPlanType", access = JsonProperty.Access.WRITE_ONLY) - private String supportPlanType; - - /* - * Title of the support ticket. - */ - @JsonProperty(value = "properties.title") - private String title; - - /* - * Time in UTC (ISO 8601 format) when the problem started. - */ - @JsonProperty(value = "properties.problemStartTime") - private OffsetDateTime problemStartTime; - - /* - * This is the resource Id of the Azure service resource associated with - * the support ticket. - */ - @JsonProperty(value = "properties.serviceId") - private String serviceId; - - /* - * Localized name of the Azure service. - */ - @JsonProperty(value = "properties.serviceDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String serviceDisplayName; - - /* - * Status of the support ticket. - */ - @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - +public final class SupportTicketDetailsInner extends ProxyResource { /* - * Time in UTC (ISO 8601 format) when the support ticket was created. + * Properties of the resource. */ - @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDate; + @JsonProperty(value = "properties") + private SupportTicketDetailsProperties innerProperties; - /* - * Time in UTC (ISO 8601 format) when the support ticket was last modified. - */ - @JsonProperty(value = "properties.modifiedDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime modifiedDate; - - /* - * Additional ticket details associated with a technical support ticket - * request. - */ - @JsonProperty(value = "properties.technicalTicketDetails") - private TechnicalTicketDetails technicalTicketDetails; - - /* - * Additional ticket details associated with a quota support ticket - * request. + /** + * Get the innerProperties property: Properties of the resource. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.quotaTicketDetails") - private QuotaTicketDetails quotaTicketDetails; + private SupportTicketDetailsProperties innerProperties() { + return this.innerProperties; + } /** * Get the supportTicketId property: System generated support ticket Id that is unique. @@ -159,7 +39,7 @@ public class SupportTicketDetailsInner extends ProxyResource { * @return the supportTicketId value. */ public String supportTicketId() { - return this.supportTicketId; + return this.innerProperties() == null ? null : this.innerProperties().supportTicketId(); } /** @@ -169,7 +49,10 @@ public String supportTicketId() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withSupportTicketId(String supportTicketId) { - this.supportTicketId = supportTicketId; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withSupportTicketId(supportTicketId); return this; } @@ -179,7 +62,7 @@ public SupportTicketDetailsInner withSupportTicketId(String supportTicketId) { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -189,7 +72,10 @@ public String description() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withDescription(String description) { - this.description = description; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withDescription(description); return this; } @@ -200,7 +86,7 @@ public SupportTicketDetailsInner withDescription(String description) { * @return the problemClassificationId value. */ public String problemClassificationId() { - return this.problemClassificationId; + return this.innerProperties() == null ? null : this.innerProperties().problemClassificationId(); } /** @@ -211,7 +97,10 @@ public String problemClassificationId() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withProblemClassificationId(String problemClassificationId) { - this.problemClassificationId = problemClassificationId; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withProblemClassificationId(problemClassificationId); return this; } @@ -221,7 +110,7 @@ public SupportTicketDetailsInner withProblemClassificationId(String problemClass * @return the problemClassificationDisplayName value. */ public String problemClassificationDisplayName() { - return this.problemClassificationDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().problemClassificationDisplayName(); } /** @@ -233,7 +122,7 @@ public String problemClassificationDisplayName() { * @return the severity value. */ public SeverityLevel severity() { - return this.severity; + return this.innerProperties() == null ? null : this.innerProperties().severity(); } /** @@ -246,7 +135,10 @@ public SeverityLevel severity() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withSeverity(SeverityLevel severity) { - this.severity = severity; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withSeverity(severity); return this; } @@ -256,7 +148,7 @@ public SupportTicketDetailsInner withSeverity(SeverityLevel severity) { * @return the enrollmentId value. */ public String enrollmentId() { - return this.enrollmentId; + return this.innerProperties() == null ? null : this.innerProperties().enrollmentId(); } /** @@ -265,7 +157,7 @@ public String enrollmentId() { * @return the require24X7Response value. */ public Boolean require24X7Response() { - return this.require24X7Response; + return this.innerProperties() == null ? null : this.innerProperties().require24X7Response(); } /** @@ -275,7 +167,10 @@ public Boolean require24X7Response() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withRequire24X7Response(Boolean require24X7Response) { - this.require24X7Response = require24X7Response; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withRequire24X7Response(require24X7Response); return this; } @@ -285,7 +180,7 @@ public SupportTicketDetailsInner withRequire24X7Response(Boolean require24X7Resp * @return the contactDetails value. */ public ContactProfile contactDetails() { - return this.contactDetails; + return this.innerProperties() == null ? null : this.innerProperties().contactDetails(); } /** @@ -295,7 +190,10 @@ public ContactProfile contactDetails() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withContactDetails(ContactProfile contactDetails) { - this.contactDetails = contactDetails; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withContactDetails(contactDetails); return this; } @@ -305,7 +203,7 @@ public SupportTicketDetailsInner withContactDetails(ContactProfile contactDetail * @return the serviceLevelAgreement value. */ public ServiceLevelAgreement serviceLevelAgreement() { - return this.serviceLevelAgreement; + return this.innerProperties() == null ? null : this.innerProperties().serviceLevelAgreement(); } /** @@ -315,7 +213,10 @@ public ServiceLevelAgreement serviceLevelAgreement() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withServiceLevelAgreement(ServiceLevelAgreement serviceLevelAgreement) { - this.serviceLevelAgreement = serviceLevelAgreement; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withServiceLevelAgreement(serviceLevelAgreement); return this; } @@ -325,7 +226,7 @@ public SupportTicketDetailsInner withServiceLevelAgreement(ServiceLevelAgreement * @return the supportEngineer value. */ public SupportEngineer supportEngineer() { - return this.supportEngineer; + return this.innerProperties() == null ? null : this.innerProperties().supportEngineer(); } /** @@ -335,7 +236,10 @@ public SupportEngineer supportEngineer() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withSupportEngineer(SupportEngineer supportEngineer) { - this.supportEngineer = supportEngineer; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withSupportEngineer(supportEngineer); return this; } @@ -345,7 +249,7 @@ public SupportTicketDetailsInner withSupportEngineer(SupportEngineer supportEngi * @return the supportPlanType value. */ public String supportPlanType() { - return this.supportPlanType; + return this.innerProperties() == null ? null : this.innerProperties().supportPlanType(); } /** @@ -354,7 +258,7 @@ public String supportPlanType() { * @return the title value. */ public String title() { - return this.title; + return this.innerProperties() == null ? null : this.innerProperties().title(); } /** @@ -364,7 +268,10 @@ public String title() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withTitle(String title) { - this.title = title; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withTitle(title); return this; } @@ -374,7 +281,7 @@ public SupportTicketDetailsInner withTitle(String title) { * @return the problemStartTime value. */ public OffsetDateTime problemStartTime() { - return this.problemStartTime; + return this.innerProperties() == null ? null : this.innerProperties().problemStartTime(); } /** @@ -384,7 +291,10 @@ public OffsetDateTime problemStartTime() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withProblemStartTime(OffsetDateTime problemStartTime) { - this.problemStartTime = problemStartTime; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withProblemStartTime(problemStartTime); return this; } @@ -395,7 +305,7 @@ public SupportTicketDetailsInner withProblemStartTime(OffsetDateTime problemStar * @return the serviceId value. */ public String serviceId() { - return this.serviceId; + return this.innerProperties() == null ? null : this.innerProperties().serviceId(); } /** @@ -406,7 +316,10 @@ public String serviceId() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withServiceId(String serviceId) { - this.serviceId = serviceId; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withServiceId(serviceId); return this; } @@ -416,7 +329,7 @@ public SupportTicketDetailsInner withServiceId(String serviceId) { * @return the serviceDisplayName value. */ public String serviceDisplayName() { - return this.serviceDisplayName; + return this.innerProperties() == null ? null : this.innerProperties().serviceDisplayName(); } /** @@ -425,7 +338,7 @@ public String serviceDisplayName() { * @return the status value. */ public String status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -434,7 +347,7 @@ public String status() { * @return the createdDate value. */ public OffsetDateTime createdDate() { - return this.createdDate; + return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } /** @@ -443,7 +356,7 @@ public OffsetDateTime createdDate() { * @return the modifiedDate value. */ public OffsetDateTime modifiedDate() { - return this.modifiedDate; + return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } /** @@ -453,7 +366,7 @@ public OffsetDateTime modifiedDate() { * @return the technicalTicketDetails value. */ public TechnicalTicketDetails technicalTicketDetails() { - return this.technicalTicketDetails; + return this.innerProperties() == null ? null : this.innerProperties().technicalTicketDetails(); } /** @@ -464,7 +377,10 @@ public TechnicalTicketDetails technicalTicketDetails() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withTechnicalTicketDetails(TechnicalTicketDetails technicalTicketDetails) { - this.technicalTicketDetails = technicalTicketDetails; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withTechnicalTicketDetails(technicalTicketDetails); return this; } @@ -474,7 +390,7 @@ public SupportTicketDetailsInner withTechnicalTicketDetails(TechnicalTicketDetai * @return the quotaTicketDetails value. */ public QuotaTicketDetails quotaTicketDetails() { - return this.quotaTicketDetails; + return this.innerProperties() == null ? null : this.innerProperties().quotaTicketDetails(); } /** @@ -484,7 +400,10 @@ public QuotaTicketDetails quotaTicketDetails() { * @return the SupportTicketDetailsInner object itself. */ public SupportTicketDetailsInner withQuotaTicketDetails(QuotaTicketDetails quotaTicketDetails) { - this.quotaTicketDetails = quotaTicketDetails; + if (this.innerProperties() == null) { + this.innerProperties = new SupportTicketDetailsProperties(); + } + this.innerProperties().withQuotaTicketDetails(quotaTicketDetails); return this; } @@ -494,20 +413,8 @@ public SupportTicketDetailsInner withQuotaTicketDetails(QuotaTicketDetails quota * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (contactDetails() != null) { - contactDetails().validate(); - } - if (serviceLevelAgreement() != null) { - serviceLevelAgreement().validate(); - } - if (supportEngineer() != null) { - supportEngineer().validate(); - } - if (technicalTicketDetails() != null) { - technicalTicketDetails().validate(); - } - if (quotaTicketDetails() != null) { - quotaTicketDetails().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } 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 new file mode 100644 index 000000000000..a8dacf3a7363 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/fluent/models/SupportTicketDetailsProperties.java @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.support.models.ContactProfile; +import com.azure.resourcemanager.support.models.QuotaTicketDetails; +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.TechnicalTicketDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Describes the properties of a support ticket. */ +@Fluent +public final class SupportTicketDetailsProperties { + /* + * System generated support ticket Id that is unique. + */ + @JsonProperty(value = "supportTicketId") + private String supportTicketId; + + /* + * Detailed description of the question or issue. + */ + @JsonProperty(value = "description", required = true) + private String description; + + /* + * Each Azure service has its own set of issue categories, also known as + * problem classification. This parameter is the unique Id for the type of + * problem you are experiencing. + */ + @JsonProperty(value = "problemClassificationId", required = true) + private String problemClassificationId; + + /* + * Localized name of problem classification. + */ + @JsonProperty(value = "problemClassificationDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String problemClassificationDisplayName; + + /* + * A value that indicates the urgency of the case, which in turn determines + * the response time according to the service level agreement of the + * technical support plan you have with Azure. Note: 'Highest critical + * impact', also known as the 'Emergency - Severe impact' level in the + * Azure portal is reserved only for our Premium customers. + */ + @JsonProperty(value = "severity", required = true) + private SeverityLevel severity; + + /* + * Enrollment Id associated with the support ticket. + */ + @JsonProperty(value = "enrollmentId", access = JsonProperty.Access.WRITE_ONLY) + private String enrollmentId; + + /* + * Indicates if this requires a 24x7 response from Azure. + */ + @JsonProperty(value = "require24X7Response") + private Boolean require24X7Response; + + /* + * Contact information of the user requesting to create a support ticket. + */ + @JsonProperty(value = "contactDetails", required = true) + private ContactProfile contactDetails; + + /* + * Service Level Agreement information for this support ticket. + */ + @JsonProperty(value = "serviceLevelAgreement") + private ServiceLevelAgreement serviceLevelAgreement; + + /* + * Information about the support engineer working on this support ticket. + */ + @JsonProperty(value = "supportEngineer") + private SupportEngineer supportEngineer; + + /* + * Support plan type associated with the support ticket. + */ + @JsonProperty(value = "supportPlanType", access = JsonProperty.Access.WRITE_ONLY) + private String supportPlanType; + + /* + * Title of the support ticket. + */ + @JsonProperty(value = "title", required = true) + private String title; + + /* + * Time in UTC (ISO 8601 format) when the problem started. + */ + @JsonProperty(value = "problemStartTime") + private OffsetDateTime problemStartTime; + + /* + * This is the resource Id of the Azure service resource associated with + * the support ticket. + */ + @JsonProperty(value = "serviceId", required = true) + private String serviceId; + + /* + * Localized name of the Azure service. + */ + @JsonProperty(value = "serviceDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String serviceDisplayName; + + /* + * Status of the support ticket. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /* + * Time in UTC (ISO 8601 format) when the support ticket was created. + */ + @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdDate; + + /* + * Time in UTC (ISO 8601 format) when the support ticket was last modified. + */ + @JsonProperty(value = "modifiedDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime modifiedDate; + + /* + * Additional ticket details associated with a technical support ticket + * request. + */ + @JsonProperty(value = "technicalTicketDetails") + private TechnicalTicketDetails technicalTicketDetails; + + /* + * Additional ticket details associated with a quota support ticket + * request. + */ + @JsonProperty(value = "quotaTicketDetails") + private QuotaTicketDetails quotaTicketDetails; + + /** + * Get the supportTicketId property: System generated support ticket Id that is unique. + * + * @return the supportTicketId value. + */ + public String supportTicketId() { + return this.supportTicketId; + } + + /** + * Set the supportTicketId property: System generated support ticket Id that is unique. + * + * @param supportTicketId the supportTicketId value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withSupportTicketId(String supportTicketId) { + this.supportTicketId = supportTicketId; + return this; + } + + /** + * Get the description property: Detailed description of the question or issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Detailed description of the question or issue. + * + * @param description the description value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the problemClassificationId property: Each Azure service has its own set of issue categories, also known as + * problem classification. This parameter is the unique Id for the type of problem you are experiencing. + * + * @return the problemClassificationId value. + */ + public String problemClassificationId() { + return this.problemClassificationId; + } + + /** + * Set the problemClassificationId property: Each Azure service has its own set of issue categories, also known as + * problem classification. This parameter is the unique Id for the type of problem you are experiencing. + * + * @param problemClassificationId the problemClassificationId value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withProblemClassificationId(String problemClassificationId) { + this.problemClassificationId = problemClassificationId; + return this; + } + + /** + * Get the problemClassificationDisplayName property: Localized name of problem classification. + * + * @return the problemClassificationDisplayName value. + */ + public String problemClassificationDisplayName() { + return this.problemClassificationDisplayName; + } + + /** + * Get the severity property: A value that indicates the urgency of the case, which in turn determines the response + * time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest + * critical impact', also known as the 'Emergency - Severe impact' level in the Azure portal is reserved only for + * our Premium customers. + * + * @return the severity value. + */ + public SeverityLevel severity() { + return this.severity; + } + + /** + * Set the severity property: A value that indicates the urgency of the case, which in turn determines the response + * time according to the service level agreement of the technical support plan you have with Azure. Note: 'Highest + * critical impact', also known as the 'Emergency - Severe impact' level in the Azure portal is reserved only for + * our Premium customers. + * + * @param severity the severity value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withSeverity(SeverityLevel severity) { + this.severity = severity; + return this; + } + + /** + * Get the enrollmentId property: Enrollment Id associated with the support ticket. + * + * @return the enrollmentId value. + */ + public String enrollmentId() { + return this.enrollmentId; + } + + /** + * Get the require24X7Response property: Indicates if this requires a 24x7 response from Azure. + * + * @return the require24X7Response value. + */ + public Boolean require24X7Response() { + return this.require24X7Response; + } + + /** + * Set the require24X7Response property: Indicates if this requires a 24x7 response from Azure. + * + * @param require24X7Response the require24X7Response value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withRequire24X7Response(Boolean require24X7Response) { + this.require24X7Response = require24X7Response; + return this; + } + + /** + * Get the contactDetails property: Contact information of the user requesting to create a support ticket. + * + * @return the contactDetails value. + */ + public ContactProfile contactDetails() { + return this.contactDetails; + } + + /** + * Set the contactDetails property: Contact information of the user requesting to create a support ticket. + * + * @param contactDetails the contactDetails value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withContactDetails(ContactProfile contactDetails) { + this.contactDetails = contactDetails; + return this; + } + + /** + * Get the serviceLevelAgreement property: Service Level Agreement information for this support ticket. + * + * @return the serviceLevelAgreement value. + */ + public ServiceLevelAgreement serviceLevelAgreement() { + return this.serviceLevelAgreement; + } + + /** + * Set the serviceLevelAgreement property: Service Level Agreement information for this support ticket. + * + * @param serviceLevelAgreement the serviceLevelAgreement value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withServiceLevelAgreement(ServiceLevelAgreement serviceLevelAgreement) { + this.serviceLevelAgreement = serviceLevelAgreement; + return this; + } + + /** + * Get the supportEngineer property: Information about the support engineer working on this support ticket. + * + * @return the supportEngineer value. + */ + public SupportEngineer supportEngineer() { + return this.supportEngineer; + } + + /** + * Set the supportEngineer property: Information about the support engineer working on this support ticket. + * + * @param supportEngineer the supportEngineer value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withSupportEngineer(SupportEngineer supportEngineer) { + this.supportEngineer = supportEngineer; + return this; + } + + /** + * Get the supportPlanType property: Support plan type associated with the support ticket. + * + * @return the supportPlanType value. + */ + public String supportPlanType() { + return this.supportPlanType; + } + + /** + * Get the title property: Title of the support ticket. + * + * @return the title value. + */ + public String title() { + return this.title; + } + + /** + * Set the title property: Title of the support ticket. + * + * @param title the title value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get the problemStartTime property: Time in UTC (ISO 8601 format) when the problem started. + * + * @return the problemStartTime value. + */ + public OffsetDateTime problemStartTime() { + return this.problemStartTime; + } + + /** + * Set the problemStartTime property: Time in UTC (ISO 8601 format) when the problem started. + * + * @param problemStartTime the problemStartTime value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withProblemStartTime(OffsetDateTime problemStartTime) { + this.problemStartTime = problemStartTime; + return this; + } + + /** + * Get the serviceId property: This is the resource Id of the Azure service resource associated with the support + * ticket. + * + * @return the serviceId value. + */ + public String serviceId() { + return this.serviceId; + } + + /** + * Set the serviceId property: This is the resource Id of the Azure service resource associated with the support + * ticket. + * + * @param serviceId the serviceId value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Get the serviceDisplayName property: Localized name of the Azure service. + * + * @return the serviceDisplayName value. + */ + public String serviceDisplayName() { + return this.serviceDisplayName; + } + + /** + * Get the status property: Status of the support ticket. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the createdDate property: Time in UTC (ISO 8601 format) when the support ticket was created. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the modifiedDate property: Time in UTC (ISO 8601 format) when the support ticket was last modified. + * + * @return the modifiedDate value. + */ + public OffsetDateTime modifiedDate() { + return this.modifiedDate; + } + + /** + * Get the technicalTicketDetails property: Additional ticket details associated with a technical support ticket + * request. + * + * @return the technicalTicketDetails value. + */ + public TechnicalTicketDetails technicalTicketDetails() { + return this.technicalTicketDetails; + } + + /** + * Set the technicalTicketDetails property: Additional ticket details associated with a technical support ticket + * request. + * + * @param technicalTicketDetails the technicalTicketDetails value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withTechnicalTicketDetails(TechnicalTicketDetails technicalTicketDetails) { + this.technicalTicketDetails = technicalTicketDetails; + return this; + } + + /** + * Get the quotaTicketDetails property: Additional ticket details associated with a quota support ticket request. + * + * @return the quotaTicketDetails value. + */ + public QuotaTicketDetails quotaTicketDetails() { + return this.quotaTicketDetails; + } + + /** + * Set the quotaTicketDetails property: Additional ticket details associated with a quota support ticket request. + * + * @param quotaTicketDetails the quotaTicketDetails value to set. + * @return the SupportTicketDetailsProperties object itself. + */ + public SupportTicketDetailsProperties withQuotaTicketDetails(QuotaTicketDetails quotaTicketDetails) { + this.quotaTicketDetails = quotaTicketDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (description() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property description in model SupportTicketDetailsProperties")); + } + if (problemClassificationId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property problemClassificationId in model SupportTicketDetailsProperties")); + } + if (severity() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property severity in model SupportTicketDetailsProperties")); + } + if (contactDetails() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property contactDetails in model SupportTicketDetailsProperties")); + } else { + contactDetails().validate(); + } + if (serviceLevelAgreement() != null) { + serviceLevelAgreement().validate(); + } + if (supportEngineer() != null) { + supportEngineer().validate(); + } + if (title() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property title in model SupportTicketDetailsProperties")); + } + if (serviceId() == null) { + throw LOGGER + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property serviceId in model SupportTicketDetailsProperties")); + } + if (technicalTicketDetails() != null) { + technicalTicketDetails().validate(); + } + if (quotaTicketDetails() != null) { + quotaTicketDetails().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SupportTicketDetailsProperties.class); +} 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 103694f16187..76d29c747b2e 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 @@ -29,7 +29,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.support.fluent.CommunicationsClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in CommunicationsClient. */ public final class CommunicationsClientImpl implements CommunicationsClient { - private final ClientLogger logger = new ClientLogger(CommunicationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final CommunicationsService service; @@ -151,7 +148,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -206,7 +204,8 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -257,7 +256,7 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( @@ -300,7 +299,7 @@ public CheckNameAvailabilityOutputInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -325,7 +324,8 @@ public Response checkNameAvailabilityWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of Communication resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -390,7 +390,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of Communication resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -451,7 +452,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of Communication resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String supportTicketName, Integer top, String filter) { @@ -471,7 +472,7 @@ 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. + * @return collection of Communication resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String supportTicketName) { @@ -499,7 +500,7 @@ 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. + * @return collection of Communication resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -521,7 +522,7 @@ 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 Communication resources. + * @return collection of Communication resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String supportTicketName) { @@ -548,7 +549,7 @@ 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. + * @return collection of Communication resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -564,7 +565,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -614,7 +616,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -660,7 +663,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String supportTicketName, String communicationName) { @@ -699,7 +702,7 @@ public CommunicationDetailsInner get(String supportTicketName, String communicat * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -716,7 +719,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -776,7 +780,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -835,9 +840,9 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link PollerFlux} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CommunicationDetailsInner> beginCreateAsync( String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { Mono>> mono = @@ -849,7 +854,7 @@ private PollerFlux, CommunicationDetailsIn this.client.getHttpPipeline(), CommunicationDetailsInner.class, CommunicationDetailsInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -862,9 +867,9 @@ private PollerFlux, CommunicationDetailsIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link PollerFlux} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CommunicationDetailsInner> beginCreateAsync( String supportTicketName, String communicationName, @@ -892,9 +897,9 @@ private PollerFlux, CommunicationDetailsIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CommunicationDetailsInner> beginCreate( String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { return beginCreateAsync(supportTicketName, communicationName, createCommunicationParameters).getSyncPoller(); @@ -910,9 +915,9 @@ public SyncPoller, CommunicationDetailsInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link SyncPoller} for polling of object that represents a Communication resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CommunicationDetailsInner> beginCreate( String supportTicketName, String communicationName, @@ -931,7 +936,7 @@ public SyncPoller, CommunicationDetailsInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -951,7 +956,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents a Communication resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -1009,7 +1014,8 @@ public CommunicationDetailsInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of Communication resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1045,7 +1051,8 @@ 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. + * @return collection of Communication resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 e7b1d33b8472..0eaa1f28abb2 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 @@ -16,10 +16,9 @@ import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; import com.azure.resourcemanager.support.models.CommunicationDetails; import com.azure.resourcemanager.support.models.Communications; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class CommunicationsImpl implements Communications { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CommunicationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(CommunicationsImpl.class); private final CommunicationsClient innerClient; @@ -98,7 +97,7 @@ public Response getWithResponse( public CommunicationDetails getById(String id) { String supportTicketName = Utils.getValueFromIdByName(id, "supportTickets"); if (supportTicketName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -106,7 +105,7 @@ public CommunicationDetails getById(String id) { } String communicationName = Utils.getValueFromIdByName(id, "communications"); if (communicationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -118,7 +117,7 @@ public CommunicationDetails getById(String id) { public Response getByIdWithResponse(String id, Context context) { String supportTicketName = Utils.getValueFromIdByName(id, "supportTickets"); if (supportTicketName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -126,7 +125,7 @@ public Response getByIdWithResponse(String id, Context con } String communicationName = Utils.getValueFromIdByName(id, "communications"); if (communicationName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java index 30d9e141c573..00530f86c72d 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/implementation/MicrosoftSupportImpl.java @@ -40,8 +40,6 @@ /** Initializes a new instance of the MicrosoftSupportImpl type. */ @ServiceClient(builder = MicrosoftSupportBuilder.class) public final class MicrosoftSupportImpl implements MicrosoftSupport { - private final ClientLogger logger = new ClientLogger(MicrosoftSupportImpl.class); - /** Azure subscription Id. */ private final String subscriptionId; @@ -287,7 +285,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -346,4 +344,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(MicrosoftSupportImpl.class); } 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 b97ba975a4d3..0a91fa82ccda 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 @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.OperationsClient; import com.azure.resourcemanager.support.fluent.models.OperationInner; import com.azure.resourcemanager.support.models.OperationsListResult; @@ -32,8 +31,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -74,7 +71,8 @@ Mono> list( * * @throws ManagementException 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. + * @return the list of operations supported by Microsoft Support resource provider along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -102,7 +100,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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. + * @return the list of operations supported by Microsoft Support resource provider along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -127,7 +126,8 @@ 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 the list of operations supported by Microsoft Support resource provider. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -141,7 +141,8 @@ 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 the list of operations supported by Microsoft Support resource provider. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -153,7 +154,8 @@ private PagedFlux listAsync(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 the list of operations supported by Microsoft Support resource provider. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -167,7 +169,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { 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 60ac39712b7f..f9f1a93c4767 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 @@ -11,10 +11,9 @@ import com.azure.resourcemanager.support.fluent.models.OperationInner; import com.azure.resourcemanager.support.models.Operation; import com.azure.resourcemanager.support.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; 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 13093371f498..c1152501709f 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.ProblemClassificationsClient; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; import com.azure.resourcemanager.support.models.ProblemClassificationsListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in ProblemClassificationsClient. */ public final class ProblemClassificationsClientImpl implements ProblemClassificationsClient { - private final ClientLogger logger = new ClientLogger(ProblemClassificationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ProblemClassificationsService service; @@ -93,7 +90,8 @@ Mono> get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of ProblemClassification resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String serviceName) { @@ -128,7 +126,8 @@ private Mono> listSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of ProblemClassification resources along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String serviceName, Context context) { @@ -160,7 +159,7 @@ private Mono> listSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String serviceName) { @@ -177,7 +176,7 @@ private PagedFlux listAsync(String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String serviceName, Context context) { @@ -193,7 +192,7 @@ private PagedFlux listAsync(String serviceName, Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String serviceName) { @@ -210,7 +209,7 @@ public PagedIterable list(String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String serviceName, Context context) { @@ -225,7 +224,8 @@ public PagedIterable list(String serviceName, Contex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 problem classification details for a specific Azure service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -269,7 +269,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 problem classification details for a specific Azure service along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -309,7 +310,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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) { @@ -348,7 +349,7 @@ public ProblemClassificationInner get(String serviceName, String problemClassifi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 problem classification details for a specific Azure service along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( 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 219446b4d0a1..1469b6d78c57 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; import com.azure.resourcemanager.support.models.ProblemClassification; import com.azure.resourcemanager.support.models.ProblemClassifications; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ProblemClassificationsImpl implements ProblemClassifications { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProblemClassificationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ProblemClassificationsImpl.class); private final ProblemClassificationsClient innerClient; 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 5f9c104bd7cc..df16a43bb4ea 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.ServicesClient; import com.azure.resourcemanager.support.fluent.models.ServiceInner; import com.azure.resourcemanager.support.models.ServicesListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in ServicesClient. */ public final class ServicesClientImpl implements ServicesClient { - private final ClientLogger logger = new ClientLogger(ServicesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ServicesService service; @@ -90,7 +87,8 @@ Mono> get( * * @throws 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. + * @return collection of Service resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -123,7 +121,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of Service resources along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -153,7 +152,7 @@ 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. + * @return collection of Service resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -172,7 +171,7 @@ 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. + * @return collection of Service resources as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -189,7 +188,7 @@ private PagedFlux listAsync(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. + * @return collection of Service resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -208,7 +207,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return collection of Service resources as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -222,7 +221,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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) { @@ -251,7 +251,8 @@ private Mono> getWithResponseAsync(String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 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, Context context) { @@ -276,7 +277,7 @@ private Mono> getWithResponseAsync(String serviceName, Co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 a specific Azure service for support ticket creation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String serviceName) { @@ -313,7 +314,7 @@ public ServiceInner get(String serviceName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 a specific Azure service for support ticket creation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String serviceName, Context context) { 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 c7527bc97432..26e41b0f078c 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 @@ -13,10 +13,9 @@ import com.azure.resourcemanager.support.fluent.models.ServiceInner; import com.azure.resourcemanager.support.models.Service; import com.azure.resourcemanager.support.models.Services; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ServicesImpl implements Services { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ServicesImpl.class); private final ServicesClient innerClient; 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 aee64218d0d0..7e21de7e7f09 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 @@ -30,7 +30,6 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.support.fluent.SupportTicketsClient; @@ -45,8 +44,6 @@ /** An instance of this class provides access to all the operations defined in SupportTicketsClient. */ public final class SupportTicketsClientImpl implements SupportTicketsClient { - private final ClientLogger logger = new ClientLogger(SupportTicketsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final SupportTicketsService service; @@ -153,7 +150,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -202,7 +200,8 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> checkNameAvailabilityWithResponseAsync( @@ -247,7 +246,7 @@ private Mono> checkNameAvailabilityWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono checkNameAvailabilityAsync( @@ -288,7 +287,7 @@ public CheckNameAvailabilityOutputInner checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 output of check name availability API along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response checkNameAvailabilityWithResponse( @@ -310,7 +309,8 @@ public Response checkNameAvailabilityWithRespo * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Integer top, String filter) { @@ -366,7 +366,8 @@ private Mono> listSinglePageAsync(Integ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -419,7 +420,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @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) { @@ -434,7 +436,8 @@ private PagedFlux listAsync(Integer top, String filte * * @throws 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. + * @return object that represents a collection of SupportTicket resources as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -458,7 +461,8 @@ 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 object that represents a collection of SupportTicket resources. + * @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) { @@ -474,7 +478,8 @@ private PagedFlux listAsync(Integer top, String filte * * @throws 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. + * @return object that represents a collection of SupportTicket resources as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -498,7 +503,8 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @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) { @@ -513,7 +519,8 @@ public PagedIterable list(Integer top, String filter, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ticket details for an Azure subscription along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String supportTicketName) { @@ -557,7 +564,8 @@ private Mono> getWithResponseAsync(String su * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ticket details for an Azure subscription along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String supportTicketName, Context context) { @@ -597,7 +605,7 @@ private Mono> getWithResponseAsync(String su * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 ticket details for an Azure subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String supportTicketName) { @@ -636,7 +644,7 @@ public SupportTicketDetailsInner get(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 ticket details for an Azure subscription. + * @return ticket details for an Azure subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String supportTicketName, Context context) { @@ -656,7 +664,8 @@ public Response getWithResponse(String supportTicketN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -713,7 +722,8 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -766,7 +776,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -816,7 +826,7 @@ public SupportTicketDetailsInner update(String supportTicketName, UpdateSupportT * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -848,7 +858,8 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -918,7 +929,8 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( @@ -984,9 +996,9 @@ private Mono>> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SupportTicketDetailsInner> beginCreateAsync( String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { Mono>> mono = @@ -998,7 +1010,7 @@ private PollerFlux, SupportTicketDetailsIn this.client.getHttpPipeline(), SupportTicketDetailsInner.class, SupportTicketDetailsInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1026,9 +1038,9 @@ private PollerFlux, SupportTicketDetailsIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link PollerFlux} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, SupportTicketDetailsInner> beginCreateAsync( String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { context = this.client.mergeContext(context); @@ -1068,9 +1080,9 @@ private PollerFlux, SupportTicketDetailsIn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SupportTicketDetailsInner> beginCreate( String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { return beginCreateAsync(supportTicketName, createSupportTicketParameters).getSyncPoller(); @@ -1101,9 +1113,9 @@ public SyncPoller, SupportTicketDetailsInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 the {@link SyncPoller} for polling of object that represents SupportTicketDetails resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, SupportTicketDetailsInner> beginCreate( String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, Context context) { return beginCreateAsync(supportTicketName, createSupportTicketParameters, context).getSyncPoller(); @@ -1133,7 +1145,7 @@ public SyncPoller, SupportTicketDetailsInn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -1168,7 +1180,7 @@ private Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 object that represents SupportTicketDetails resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -1250,7 +1262,8 @@ public SupportTicketDetailsInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1286,7 +1299,8 @@ 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. + * @return object that represents a collection of SupportTicket resources along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { 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 f34957c7656e..0871e70d6f68 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 @@ -16,10 +16,9 @@ import com.azure.resourcemanager.support.models.CheckNameAvailabilityOutput; import com.azure.resourcemanager.support.models.SupportTicketDetails; import com.azure.resourcemanager.support.models.SupportTickets; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class SupportTicketsImpl implements SupportTickets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportTicketsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(SupportTicketsImpl.class); private final SupportTicketsClient innerClient; @@ -90,7 +89,7 @@ public Response getWithResponse(String supportTicketName, public SupportTicketDetails getById(String id) { String supportTicketName = Utils.getValueFromIdByName(id, "supportTickets"); if (supportTicketName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String @@ -102,7 +101,7 @@ public SupportTicketDetails getById(String id) { public Response getByIdWithResponse(String id, Context context) { String supportTicketName = Utils.getValueFromIdByName(id, "supportTickets"); if (supportTicketName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String 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 7e23bf586706..964ff11c228a 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 @@ -6,14 +6,11 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Input of CheckNameAvailability API. */ @Fluent public final class CheckNameAvailabilityInput { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityInput.class); - /* * The resource name to validate. */ @@ -73,14 +70,16 @@ public CheckNameAvailabilityInput withType(Type type) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model CheckNameAvailabilityInput")); } if (type() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property type in model CheckNameAvailabilityInput")); } } + + private static final ClientLogger LOGGER = new ClientLogger(CheckNameAvailabilityInput.class); } 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 7bb5a62d30d3..921cd996f327 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 @@ -34,7 +34,7 @@ CheckNameAvailabilityOutput checkNameAvailability( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 output of check name availability API along with {@link Response}. */ Response checkNameAvailabilityWithResponse( String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); @@ -51,7 +51,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of Communication resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String supportTicketName); @@ -73,7 +73,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of Communication resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String supportTicketName, Integer top, String filter, Context context); @@ -98,7 +98,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 object that represents a Communication resource along with {@link Response}. */ Response getWithResponse(String supportTicketName, String communicationName, Context context); @@ -109,7 +109,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 object that represents a Communication resource along with {@link Response}. */ CommunicationDetails getById(String id); @@ -121,7 +121,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 object that represents a Communication resource along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); 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/models/CommunicationsListResult.java index ab3c5242ce0d..bc12de3dfb94 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/models/CommunicationsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.models.CommunicationDetailsInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Collection of Communication resources. */ @Fluent public final class CommunicationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CommunicationsListResult.class); - /* * List of Communication resources. */ 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 72acd5e4950e..824ee1fcf669 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 @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Contact information associated with the support ticket. */ @Fluent public final class ContactProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ContactProfile.class); - /* * First name. */ @@ -281,43 +278,45 @@ public ContactProfile withPreferredSupportLanguage(String preferredSupportLangua */ public void validate() { if (firstName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property firstName in model ContactProfile")); } if (lastName() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property lastName in model ContactProfile")); } if (preferredContactMethod() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property preferredContactMethod in model ContactProfile")); } if (primaryEmailAddress() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property primaryEmailAddress in model ContactProfile")); } if (preferredTimeZone() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property preferredTimeZone in model ContactProfile")); } if (country() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property country in model ContactProfile")); } if (preferredSupportLanguage() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property preferredSupportLanguage in model ContactProfile")); } } + + private static final ClientLogger LOGGER = new ClientLogger(ContactProfile.class); } diff --git a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationDisplay.java b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationDisplay.java index 8fa64719664a..90e4f05a9f13 100644 --- a/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationDisplay.java +++ b/sdk/support/azure-resourcemanager-support/src/main/java/com/azure/resourcemanager/support/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The object that describes the operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * The description of the operation. */ 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 c71ec1968449..a72a5d03fcf0 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 @@ -14,7 +14,8 @@ public interface Operations { * * @throws com.azure.core.management.exception.ManagementException 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. + * @return the list of operations supported by Microsoft Support resource provider as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -25,7 +26,8 @@ public interface Operations { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException 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. + * @return the list of operations supported by Microsoft Support 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 index b2be02e8d78d..86c025badd5b 100644 --- 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The list of operations supported by Microsoft Support resource provider. */ @Fluent public final class OperationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsListResult.class); - /* * The list of operations supported by Microsoft Support resource provider. */ 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 feed89edb1d9..a80f4e3b05fa 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 @@ -19,7 +19,7 @@ public interface ProblemClassifications { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String serviceName); @@ -33,7 +33,7 @@ public interface ProblemClassifications { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of ProblemClassification resources as paginated response with {@link PagedIterable}. */ PagedIterable list(String serviceName, Context context); @@ -58,7 +58,7 @@ public interface ProblemClassifications { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 problem classification details for a specific Azure service along with {@link Response}. */ Response getWithResponse( String serviceName, String problemClassificationName, Context context); 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/models/ProblemClassificationsListResult.java index 1a7e22ba95b4..038e5e0991a9 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/models/ProblemClassificationsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.models.ProblemClassificationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Collection of ProblemClassification resources. */ @Fluent public final class ProblemClassificationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ProblemClassificationsListResult.class); - /* * List of ProblemClassification resources. */ 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 4f942e2338e2..0b173b831ff6 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** This property is required for providing the region and new quota limits. */ @Fluent public final class QuotaChangeRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaChangeRequest.class); - /* * Region for which the quota increase request is being made. */ 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 74c62294c54f..baef875ba4b7 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 @@ -5,8 +5,6 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Fluent public final class QuotaTicketDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaTicketDetails.class); - /* * Required for certain quota types when there is a sub type, such as * Batch, for which you are requesting a quota increase. 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 6b278e8a39ad..177985a5ad35 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** Service Level Agreement details for a support ticket. */ @Immutable public final class ServiceLevelAgreement { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceLevelAgreement.class); - /* * Time in UTC (ISO 8601 format) when the service level agreement starts. */ 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 dfb9a99bffae..f67450ac0c3b 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 @@ -20,7 +20,7 @@ public interface Services { * * @throws com.azure.core.management.exception.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. + * @return collection of Service resources as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -36,7 +36,7 @@ public interface Services { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return collection of Service resources as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -59,7 +59,7 @@ public interface Services { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a specific Azure service for support ticket creation along with {@link Response}. */ Response getWithResponse(String serviceName, Context context); } 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/models/ServicesListResult.java index 676678a87a4f..d1270ff061e3 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/models/ServicesListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.models.ServiceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Collection of Service resources. */ @Fluent public final class ServicesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServicesListResult.class); - /* * List of Service resources. */ 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 ae2a63de31a5..356c5b85595e 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Support engineer information. */ @Immutable public final class SupportEngineer { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportEngineer.class); - /* * Email address of the Azure Support engineer assigned to the support * ticket. 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 f248ebe7d2d2..8bbb89db64ff 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 @@ -31,7 +31,7 @@ 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 output of check name availability API. + * @return output of check name availability API along with {@link Response}. */ Response checkNameAvailabilityWithResponse( CheckNameAvailabilityInput checkNameAvailabilityInput, Context context); @@ -44,7 +44,8 @@ Response checkNameAvailabilityWithResponse( * * @throws com.azure.core.management.exception.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. + * @return object that represents a collection of SupportTicket resources as paginated response with {@link + * PagedIterable}. */ PagedIterable list(); @@ -63,7 +64,8 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return object that represents a collection of SupportTicket resources as paginated response with {@link + * PagedIterable}. */ PagedIterable list(Integer top, String filter, Context context); @@ -88,7 +90,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 ticket details for an Azure subscription along with {@link Response}. */ Response getWithResponse(String supportTicketName, Context context); @@ -100,7 +102,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 ticket details for an Azure subscription along with {@link Response}. */ SupportTicketDetails getById(String id); @@ -113,7 +115,7 @@ Response checkNameAvailabilityWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 ticket details for an Azure subscription along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); 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/models/SupportTicketsListResult.java index 9d6e3bc7b72e..c416a7a6d0c6 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/models/SupportTicketsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.support.fluent.models.SupportTicketDetailsInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Object that represents a collection of SupportTicket resources. */ @Fluent public final class SupportTicketsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SupportTicketsListResult.class); - /* * List of SupportTicket resources. */ 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 af4c33480c88..b4cf04c1648a 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Additional information for technical support ticket. */ @Fluent public final class TechnicalTicketDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TechnicalTicketDetails.class); - /* * This is the resource Id of the Azure service resource (For example: A * virtual machine resource or an HDInsight resource) for which the support 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 c48096e3c588..7bfd6feaad05 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Contact information associated with the support ticket. */ @Fluent public final class UpdateContactProfile { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateContactProfile.class); - /* * First name. */ 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 7a5c1bc344d5..74c4cf5bd027 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.support.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Updates severity, ticket status, and contact details in the support ticket. */ @Fluent public final class UpdateSupportTicket { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateSupportTicket.class); - /* * Severity level. */ 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 new file mode 100644 index 000000000000..4cc2da626bf7 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCheckNameAvailabilitySamples.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.support.models.Type; + +/** Samples for Communications CheckNameAvailability. */ +public final class CommunicationsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityForSupportTicketCommunication.json + */ + /** + * Sample code: Checks whether name is available for Communication resource. + * + * @param manager Entry point to SupportManager. + */ + public static void checksWhetherNameIsAvailableForCommunicationResource( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .communications() + .checkNameAvailabilityWithResponse( + "testticket", + new CheckNameAvailabilityInput().withName("sampleName").withType(Type.MICROSOFT_SUPPORT_COMMUNICATIONS), + Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java new file mode 100644 index 000000000000..36fc527e687e --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsCreateSamples.java @@ -0,0 +1,27 @@ +// 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; + +/** Samples for Communications Create. */ +public final class CommunicationsCreateSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSupportTicketCommunication.json + */ + /** + * Sample code: AddCommunicationToSubscriptionTicket. + * + * @param manager Entry point to SupportManager. + */ + public static void addCommunicationToSubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { + manager + .communications() + .define("testcommunication") + .withExistingSupportTicket("testticket") + .withSender("user@contoso.com") + .withSubject("This is a test message from a customer!") + .withBody("This is a test message from a customer!") + .create(); + } +} 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 new file mode 100644 index 000000000000..a05feaef0a13 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsGetSamples.java @@ -0,0 +1,23 @@ +// 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.Context; + +/** Samples for Communications Get. */ +public final class CommunicationsGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetCommunicationDetailsForSubscriptionSupportTicket.json + */ + /** + * Sample code: Get communication details for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void getCommunicationDetailsForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager.communications().getWithResponse("testticket", "testmessage", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..8fda015032dd --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/CommunicationsListSamples.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.Context; + +/** Samples for Communications List. */ +public final class CommunicationsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListCommunicationsForSubscriptionSupportTicket.json + */ + /** + * Sample code: List communications for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void listCommunicationsForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager.communications().list("testticket", null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicket.json + */ + /** + * Sample code: List web communications for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void listWebCommunicationsForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager.communications().list("testticket", null, "communicationType eq 'web'", Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListWebCommunicationsForSubscriptionSupportTicketCreatedOnOrAfter.json + */ + /** + * Sample code: List web communication created on or after a specific date for a subscription support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void listWebCommunicationCreatedOnOrAfterASpecificDateForASubscriptionSupportTicket( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .communications() + .list( + "testticket", null, "communicationType eq 'web' and createdDate ge 2020-03-10T22:08:51Z", Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java new file mode 100644 index 000000000000..bdd4f06b8b01 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// 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.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListOperations.json + */ + /** + * Sample code: Get all operations. + * + * @param manager Entry point to SupportManager. + */ + public static void getAllOperations(com.azure.resourcemanager.support.SupportManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java new file mode 100644 index 000000000000..4f00feca8c8c --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsGetSamples.java @@ -0,0 +1,23 @@ +// 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.Context; + +/** Samples for ProblemClassifications Get. */ +public final class ProblemClassificationsGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetProblemClassification.json + */ + /** + * Sample code: Gets details of problemClassification for Azure service. + * + * @param manager Entry point to SupportManager. + */ + public static void getsDetailsOfProblemClassificationForAzureService( + com.azure.resourcemanager.support.SupportManager manager) { + manager.problemClassifications().getWithResponse("service_guid", "problemClassification_guid", Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java new file mode 100644 index 000000000000..d3e1e8d5d8d0 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ProblemClassificationsListSamples.java @@ -0,0 +1,23 @@ +// 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.Context; + +/** Samples for ProblemClassifications List. */ +public final class ProblemClassificationsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListProblemClassifications.json + */ + /** + * Sample code: Gets list of problemClassifications for a service for which a support ticket can be created. + * + * @param manager Entry point to SupportManager. + */ + public static void getsListOfProblemClassificationsForAServiceForWhichASupportTicketCanBeCreated( + com.azure.resourcemanager.support.SupportManager manager) { + manager.problemClassifications().list("service_guid", Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java new file mode 100644 index 000000000000..9641a5ea30ea --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesGetSamples.java @@ -0,0 +1,22 @@ +// 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.Context; + +/** Samples for Services Get. */ +public final class ServicesGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetService.json + */ + /** + * Sample code: Gets details of the Azure service. + * + * @param manager Entry point to SupportManager. + */ + public static void getsDetailsOfTheAzureService(com.azure.resourcemanager.support.SupportManager manager) { + manager.services().getWithResponse("service_guid", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..acb98095deb3 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/ServicesListSamples.java @@ -0,0 +1,23 @@ +// 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.Context; + +/** Samples for Services List. */ +public final class ServicesListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListServices.json + */ + /** + * Sample code: Gets list of services for which a support ticket can be created. + * + * @param manager Entry point to SupportManager. + */ + public static void getsListOfServicesForWhichASupportTicketCanBeCreated( + com.azure.resourcemanager.support.SupportManager manager) { + manager.services().list(Context.NONE); + } +} 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 new file mode 100644 index 000000000000..c47868e92fbe --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCheckNameAvailabilitySamples.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.support.models.CheckNameAvailabilityInput; +import com.azure.resourcemanager.support.models.Type; + +/** Samples for SupportTickets CheckNameAvailability. */ +public final class SupportTicketsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CheckNameAvailabilityWithSubscription.json + */ + /** + * Sample code: Checks whether name is available for SupportTicket resource. + * + * @param manager Entry point to SupportManager. + */ + public static void checksWhetherNameIsAvailableForSupportTicketResource( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .checkNameAvailabilityWithResponse( + new CheckNameAvailabilityInput() + .withName("sampleName") + .withType(Type.MICROSOFT_SUPPORT_SUPPORT_TICKETS), + Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java new file mode 100644 index 000000000000..57b84af3486c --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsCreateSamples.java @@ -0,0 +1,675 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.resourcemanager.support.models.ContactProfile; +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.SeverityLevel; +import com.azure.resourcemanager.support.models.TechnicalTicketDetails; +import java.util.Arrays; + +/** Samples for SupportTickets Create. */ +public final class SupportTicketsCreateSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForDTUs.json + */ + /** + * Sample code: Create a ticket to request Quota increase for DTUs for Azure Synapse Analytics. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForDTUsForAzureSynapseAnalytics( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("DTUs") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForActiveJobs.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Active Jobs and Job Schedules for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForActiveJobsAndJobSchedulesForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Jobs\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForLowPriorityCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Low-priority cores for Machine Learning service. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForMachineLearningService( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("BatchAml") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSubscription.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Batch accounts for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForBatchAccountsForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Subscription") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200,\"Type\":\"Account\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForDTUs.json + */ + /** + * Sample code: Create a ticket to request Quota increase for DTUs for SQL Database. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForDTUsForSQLDatabase( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("DTUs") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"ServerName\":\"testserver\",\"NewLimit\":54000}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateGenericQuotaTicket.json + */ + /** + * 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 + createATicketToRequestQuotaIncreaseForServicesThatDoNotRequireAdditionalDetailsInTheQuotaTicketDetailsObject( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("Increase the maximum throughput per container limit to 10000 for account foo bar") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cosmosdb_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForLowPriorityCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Low-priority cores for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForLowPriorityCoresForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload( + "{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"LowPriority\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlManagedInstanceQuotaTicket.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Azure SQL managed instance. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForAzureSQLManagedInstance( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_managedinstance_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("SQLMI") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"vCore\"}"), + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"NewLimit\":200, \"Metadata\":null, \"Type\":\"Subnet\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForPools.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Pools for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForPoolsForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"AccountName\":\"test\",\"NewLimit\":200,\"Type\":\"Pools\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBatchQuotaTicketForSpecificBatchAccountForDedicatedCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for specific VM family cores for a Batch account. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForABatchAccount( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/batch_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Account") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload( + "{\"AccountName\":\"test\",\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatabaseQuotaTicketForServers.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Servers for SQL Database. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForServersForSQLDatabase( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_database_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Servers") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateBillingSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Billing related issues. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForBillingRelatedIssues(com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/billing_service_guid/problemClassifications/billing_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/billing_service_guid") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSubMgmtSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Subscription Management related issues. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForSubscriptionManagementRelatedIssues( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/subscription_management_service_guid/problemClassifications/subscription_management_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/subscription_management_service_guid") + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateTechnicalSupportTicketForSubscription.json + */ + /** + * Sample code: Create a ticket for Technical issue related to a specific resource. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketForTechnicalIssueRelatedToASpecificResource( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/virtual_machine_running_linux_service_guid/problemClassifications/problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/cddd3eb5-1830-b494-44fd-782f691479dc") + .withTechnicalTicketDetails( + new TechnicalTicketDetails() + .withResourceId( + "/subscriptions/subid/resourceGroups/test/providers/Microsoft.Compute/virtualMachines/testserver")) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateMachineLearningQuotaTicketForDedicatedCores.json + */ + /** + * Sample code: Create a ticket to request Quota increase for specific VM family cores for Machine Learning service. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForSpecificVMFamilyCoresForMachineLearningService( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/machine_learning_service_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("BatchAml") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload( + "{\"VMFamily\":\"standardA0_A7Family\",\"NewLimit\":200,\"Type\":\"Dedicated\"}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateSqlDatawarehouseQuotaTicketForServers.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Servers for Azure Synapse Analytics. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForServersForAzureSynapseAnalytics( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/sql_datawarehouse_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestSubType("Servers") + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays.asList(new QuotaChangeRequest().withRegion("EastUS").withPayload("{\"NewLimit\":200}")))) + .create(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/CreateCoresQuotaTicketForSubscription.json + */ + /** + * Sample code: Create a ticket to request Quota increase for Compute VM Cores. + * + * @param manager Entry point to SupportManager. + */ + public static void createATicketToRequestQuotaIncreaseForComputeVMCores( + com.azure.resourcemanager.support.SupportManager manager) { + manager + .supportTickets() + .define("testticket") + .withDescription("my description") + .withProblemClassificationId( + "/providers/Microsoft.Support/services/quota_service_guid/problemClassifications/cores_problemClassification_guid") + .withSeverity(SeverityLevel.MODERATE) + .withContactDetails( + new ContactProfile() + .withFirstName("abc") + .withLastName("xyz") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("abc@contoso.com") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("usa") + .withPreferredSupportLanguage("en-US")) + .withTitle("my title") + .withServiceId("/providers/Microsoft.Support/services/quota_service_guid") + .withQuotaTicketDetails( + new QuotaTicketDetails() + .withQuotaChangeRequestVersion("1.0") + .withQuotaChangeRequests( + Arrays + .asList( + new QuotaChangeRequest() + .withRegion("EastUS") + .withPayload("{\"SKU\":\"DSv3 Series\",\"NewLimit\":104}")))) + .create(); + } +} 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 new file mode 100644 index 000000000000..b34b809769da --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsGetSamples.java @@ -0,0 +1,22 @@ +// 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.Context; + +/** Samples for SupportTickets Get. */ +public final class SupportTicketsGetSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/GetSubscriptionSupportTicketDetails.json + */ + /** + * Sample code: Get details of a subscription ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void getDetailsOfASubscriptionTicket(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().getWithResponse("testticket", Context.NONE); + } +} 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 new file mode 100644 index 000000000000..d175e2e7e062 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsListSamples.java @@ -0,0 +1,48 @@ +// 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.Context; + +/** Samples for SupportTickets List. */ +public final class SupportTicketsListSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsCreatedOnOrAfterAndInOpenStateBySubscription.json + */ + /** + * Sample code: List support tickets created on or after a certain date and in open state for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void listSupportTicketsCreatedOnOrAfterACertainDateAndInOpenStateForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().list(null, "createdDate ge 2020-03-10T22:08:51Z and status eq 'Open'", Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsBySubscription.json + */ + /** + * Sample code: List support tickets for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void listSupportTicketsForASubscription(com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().list(null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/ListSupportTicketsInOpenStateBySubscription.json + */ + /** + * Sample code: List support tickets in open state for a subscription. + * + * @param manager Entry point to SupportManager. + */ + public static void listSupportTicketsInOpenStateForASubscription( + com.azure.resourcemanager.support.SupportManager manager) { + manager.supportTickets().list(null, "status eq 'Open'", Context.NONE); + } +} diff --git a/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java new file mode 100644 index 000000000000..95cf744d2303 --- /dev/null +++ b/sdk/support/azure-resourcemanager-support/src/samples/java/com/azure/resourcemanager/support/generated/SupportTicketsUpdateSamples.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.support.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.support.models.PreferredContactMethod; +import com.azure.resourcemanager.support.models.SeverityLevel; +import com.azure.resourcemanager.support.models.Status; +import com.azure.resourcemanager.support.models.SupportTicketDetails; +import com.azure.resourcemanager.support.models.UpdateContactProfile; +import java.util.Arrays; + +/** Samples for SupportTickets Update. */ +public final class SupportTicketsUpdateSamples { + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateSeverityOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update severity of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void updateSeverityOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", Context.NONE).getValue(); + resource.update().withSeverity(SeverityLevel.CRITICAL).apply(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateStatusOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update status of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void updateStatusOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", Context.NONE).getValue(); + resource.update().withStatus(Status.CLOSED).apply(); + } + + /* + * x-ms-original-file: specification/support/resource-manager/Microsoft.Support/stable/2020-04-01/examples/UpdateContactDetailsOfSupportTicketForSubscription.json + */ + /** + * Sample code: Update contact details of a support ticket. + * + * @param manager Entry point to SupportManager. + */ + public static void updateContactDetailsOfASupportTicket(com.azure.resourcemanager.support.SupportManager manager) { + SupportTicketDetails resource = manager.supportTickets().getWithResponse("testticket", Context.NONE).getValue(); + resource + .update() + .withContactDetails( + new UpdateContactProfile() + .withFirstName("first name") + .withLastName("last name") + .withPreferredContactMethod(PreferredContactMethod.EMAIL) + .withPrimaryEmailAddress("test.name@contoso.com") + .withAdditionalEmailAddresses(Arrays.asList("tname@contoso.com", "teamtest@contoso.com")) + .withPhoneNumber("123-456-7890") + .withPreferredTimeZone("Pacific Standard Time") + .withCountry("USA") + .withPreferredSupportLanguage("en-US")) + .apply(); + } +}