From 7909b1bb3232f30fda63cc6f9e8b6fd0c264037c Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Mon, 3 Feb 2020 01:53:28 +0000 Subject: [PATCH] Generated from 4ef6d7e5fc657a5f85bde0ccb156847610a8b2ad fixing python sdk pats --- azure-mgmt-support/pom.xml | 135 +++ .../support/CheckNameAvailabilityInput.java | 70 ++ .../support/CheckNameAvailabilityOutput.java | 35 + .../support/CommunicationDetails.java | 166 ++++ .../support/CommunicationDirection.java | 41 + .../management/support/CommunicationType.java | 41 + .../management/support/Communications.java | 49 ++ .../management/support/ContactProfile.java | 264 ++++++ .../management/support/ExceptionResponse.java | 43 + .../support/ExceptionResponseException.java | 44 + .../azure/management/support/Operation.java | 30 + .../management/support/OperationDisplay.java | 77 ++ .../azure/management/support/Operations.java | 27 + .../support/PreferredContactMethod.java | 41 + .../support/ProblemClassification.java | 42 + .../support/ProblemClassifications.java | 38 + .../support/QuotaChangeRequest.java | 69 ++ .../support/QuotaTicketDetails.java | 101 +++ .../azure/management/support/Service.java | 40 + .../management/support/ServiceError.java | 111 +++ .../support/ServiceErrorDetail.java | 73 ++ .../support/ServiceLevelAgreement.java | 63 ++ .../azure/management/support/Services.java | 36 + .../management/support/SeverityLevel.java | 44 + .../management/support/SupportEngineer.java | 33 + .../support/SupportTicketDetails.java | 361 ++++++++ .../management/support/SupportTickets.java | 39 + .../support/TechnicalTicketDetails.java | 45 + .../azure/management/support/Type.java | 53 ++ .../support/UpdateContactProfile.java | 264 ++++++ .../support/UpdateSupportTicket.java | 70 ++ .../CheckNameAvailabilityOutputImpl.java | 41 + .../CheckNameAvailabilityOutputInner.java | 62 ++ .../CommunicationDetailsImpl.java | 142 +++ .../CommunicationDetailsInner.java | 147 ++++ .../implementation/CommunicationsImpl.java | 92 ++ .../implementation/CommunicationsInner.java | 782 ++++++++++++++++ .../implementation/IdParsingUtils.java | 57 ++ .../implementation/MicrosoftSupportImpl.java | 252 ++++++ .../support/implementation/OperationImpl.java | 37 + .../implementation/OperationInner.java | 59 ++ .../implementation/OperationsImpl.java | 49 ++ .../implementation/OperationsInner.java | 134 +++ .../support/implementation/PageImpl.java | 75 ++ .../support/implementation/PageImpl1.java | 75 ++ .../ProblemClassificationImpl.java | 61 ++ .../ProblemClassificationInner.java | 90 ++ .../ProblemClassificationsImpl.java | 69 ++ .../ProblemClassificationsInner.java | 229 +++++ .../support/implementation/ServiceImpl.java | 46 + .../support/implementation/ServiceInner.java | 90 ++ .../support/implementation/ServicesImpl.java | 61 ++ .../support/implementation/ServicesInner.java | 215 +++++ .../implementation/SupportManager.java | 147 ++++ .../SupportTicketDetailsImpl.java | 307 +++++++ .../SupportTicketDetailsInner.java | 494 +++++++++++ .../implementation/SupportTicketsImpl.java | 103 +++ .../implementation/SupportTicketsInner.java | 831 ++++++++++++++++++ .../support/implementation/package-info.java | 11 + .../management/support/package-info.java | 11 + 60 files changed, 7314 insertions(+) create mode 100644 azure-mgmt-support/pom.xml create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityInput.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityOutput.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDetails.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDirection.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationType.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Communications.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ContactProfile.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponse.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponseException.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operation.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/OperationDisplay.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operations.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/PreferredContactMethod.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassification.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassifications.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaChangeRequest.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaTicketDetails.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Service.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceError.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceErrorDetail.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceLevelAgreement.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Services.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SeverityLevel.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportEngineer.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTicketDetails.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTickets.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/TechnicalTicketDetails.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Type.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateContactProfile.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateSupportTicket.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/IdParsingUtils.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/MicrosoftSupportImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl1.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportManager.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsImpl.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsInner.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/package-info.java create mode 100644 azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/package-info.java diff --git a/azure-mgmt-support/pom.xml b/azure-mgmt-support/pom.xml new file mode 100644 index 0000000000000..8d7992d460118 --- /dev/null +++ b/azure-mgmt-support/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.support + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-support + 1.0.0-beta + jar + Microsoft Azure SDK for Support Management + This package contains Microsoft Support Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityInput.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityInput.java new file mode 100644 index 0000000000000..a201d9ab1b281 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityInput.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Input of CheckNameAvailability API. + */ +public class CheckNameAvailabilityInput { + /** + * The resource name to validate. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The type of resource. Possible values include: + * 'Microsoft.Support/supportTickets', 'Microsoft.Support/communications'. + */ + @JsonProperty(value = "type", required = true) + private Type type; + + /** + * Get the resource name to validate. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the resource name to validate. + * + * @param name the name value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type of resource. Possible values include: 'Microsoft.Support/supportTickets', 'Microsoft.Support/communications'. + * + * @return the type value + */ + public Type type() { + return this.type; + } + + /** + * Set the type of resource. Possible values include: 'Microsoft.Support/supportTickets', 'Microsoft.Support/communications'. + * + * @param type the type value to set + * @return the CheckNameAvailabilityInput object itself. + */ + public CheckNameAvailabilityInput withType(Type type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityOutput.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityOutput.java new file mode 100644 index 0000000000000..11a4280a43f6e --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CheckNameAvailabilityOutput.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.support.implementation.SupportManager; +import com.microsoft.azure.management.support.implementation.CheckNameAvailabilityOutputInner; + +/** + * Type representing CheckNameAvailabilityOutput. + */ +public interface CheckNameAvailabilityOutput extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDetails.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDetails.java new file mode 100644 index 0000000000000..7c937d471b58f --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDetails.java @@ -0,0 +1,166 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.support.implementation.CommunicationDetailsInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.support.implementation.SupportManager; +import org.joda.time.DateTime; + +/** + * Type representing CommunicationDetails. + */ +public interface CommunicationDetails extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the body value. + */ + String body(); + + /** + * @return the communicationDirection value. + */ + CommunicationDirection communicationDirection(); + + /** + * @return the communicationType value. + */ + CommunicationType communicationType(); + + /** + * @return the createdDate value. + */ + DateTime createdDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the sender value. + */ + String sender(); + + /** + * @return the subject value. + */ + String subject(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the CommunicationDetails definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithSupportTicket, DefinitionStages.WithBody, DefinitionStages.WithSubject, DefinitionStages.WithCreate { + } + + /** + * Grouping of CommunicationDetails definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a CommunicationDetails definition. + */ + interface Blank extends WithSupportTicket { + } + + /** + * The stage of the communicationdetails definition allowing to specify SupportTicket. + */ + interface WithSupportTicket { + /** + * Specifies supportTicketName. + * @param supportTicketName Support ticket name + * @return the next definition stage + */ + WithBody withExistingSupportTicket(String supportTicketName); + } + + /** + * The stage of the communicationdetails definition allowing to specify Body. + */ + interface WithBody { + /** + * Specifies body. + * @param body Body of the communication + * @return the next definition stage + */ + WithSubject withBody(String body); + } + + /** + * The stage of the communicationdetails definition allowing to specify Subject. + */ + interface WithSubject { + /** + * Specifies subject. + * @param subject Subject of the communication + * @return the next definition stage + */ + WithCreate withSubject(String subject); + } + + /** + * The stage of the communicationdetails definition allowing to specify Sender. + */ + interface WithSender { + /** + * Specifies sender. + * @param sender Email address of the sender + * @return the next definition stage + */ + WithCreate withSender(String sender); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithSender { + } + } + /** + * The template for a CommunicationDetails update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithSender { + } + + /** + * Grouping of CommunicationDetails update stages. + */ + interface UpdateStages { + /** + * The stage of the communicationdetails update allowing to specify Sender. + */ + interface WithSender { + /** + * Specifies sender. + * @param sender Email address of the sender + * @return the next update stage + */ + Update withSender(String sender); + } + + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDirection.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDirection.java new file mode 100644 index 0000000000000..49aaef79e6ac6 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationDirection.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CommunicationDirection. + */ +public final class CommunicationDirection extends ExpandableStringEnum { + /** Static value inbound for CommunicationDirection. */ + public static final CommunicationDirection INBOUND = fromString("inbound"); + + /** Static value outbound for CommunicationDirection. */ + public static final CommunicationDirection OUTBOUND = fromString("outbound"); + + /** + * Creates or finds a CommunicationDirection from its string representation. + * @param name a name to look for + * @return the corresponding CommunicationDirection + */ + @JsonCreator + public static CommunicationDirection fromString(String name) { + return fromString(name, CommunicationDirection.class); + } + + /** + * @return known CommunicationDirection values + */ + public static Collection values() { + return values(CommunicationDirection.class); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationType.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationType.java new file mode 100644 index 0000000000000..74c7abfa86000 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/CommunicationType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CommunicationType. + */ +public final class CommunicationType extends ExpandableStringEnum { + /** Static value web for CommunicationType. */ + public static final CommunicationType WEB = fromString("web"); + + /** Static value phone for CommunicationType. */ + public static final CommunicationType PHONE = fromString("phone"); + + /** + * Creates or finds a CommunicationType from its string representation. + * @param name a name to look for + * @return the corresponding CommunicationType + */ + @JsonCreator + public static CommunicationType fromString(String name) { + return fromString(name, CommunicationType.class); + } + + /** + * @return known CommunicationType values + */ + public static Collection values() { + return values(CommunicationType.class); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Communications.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Communications.java new file mode 100644 index 0000000000000..fc9087a6902c6 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Communications.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.support.implementation.CommunicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Communications. + */ +public interface Communications extends SupportsCreating, HasInner { + /** + * Returns details of a specific communication in a support ticket. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String supportTicketName, String communicationName); + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String supportTicketName); + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @param supportTicketName Support ticket name + * @param checkNameAvailabilityInput Input to check + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ContactProfile.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ContactProfile.java new file mode 100644 index 0000000000000..b99beae9f0e5d --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ContactProfile.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contact information associated with support ticket. + */ +public class ContactProfile { + /** + * First name. + */ + @JsonProperty(value = "firstName", required = true) + private String firstName; + + /** + * Last name. + */ + @JsonProperty(value = "lastName", required = true) + private String lastName; + + /** + * Preferred contact method. Possible values include: 'email', 'phone'. + */ + @JsonProperty(value = "preferredContactMethod", required = true) + private PreferredContactMethod preferredContactMethod; + + /** + * Primary email address. + */ + @JsonProperty(value = "primaryEmailAddress", required = true) + private String primaryEmailAddress; + + /** + * Additional email addresses listed will be copied on any correspondence + * about the support ticket. + */ + @JsonProperty(value = "additionalEmailAddresses") + private List additionalEmailAddresses; + + /** + * Phone number. This is required if preferred contact method is phone. + */ + @JsonProperty(value = "phoneNumber") + private String phoneNumber; + + /** + * Time zone of the user. This is the name of the time zone from <a + * target='_blank' + * href='https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values'>Microsoft + * Time Zone Index Values</a>. + */ + @JsonProperty(value = "preferredTimeZone", required = true) + private String preferredTimeZone; + + /** + * Country of the user. This is the ISO 3166-1 alpha-3 code. + */ + @JsonProperty(value = "country", required = true) + private String country; + + /** + * Preferred language of support from Azure. Support languages vary based + * on the severity you choose for your support ticket. Learn more at <a + * target='_blank' + * href='https://azure.microsoft.com/support/plans/response/'>Azure + * Severity and responsiveness</a>. Use the standard language-country + * code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, + * 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' + * for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for + * Italian, 'zh-tw' for Chinese and 'de-de' for German. + */ + @JsonProperty(value = "preferredSupportLanguage", required = true) + private String preferredSupportLanguage; + + /** + * Get first name. + * + * @return the firstName value + */ + public String firstName() { + return this.firstName; + } + + /** + * Set first name. + * + * @param firstName the firstName value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get last name. + * + * @return the lastName value + */ + public String lastName() { + return this.lastName; + } + + /** + * Set last name. + * + * @param lastName the lastName value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get preferred contact method. Possible values include: 'email', 'phone'. + * + * @return the preferredContactMethod value + */ + public PreferredContactMethod preferredContactMethod() { + return this.preferredContactMethod; + } + + /** + * Set preferred contact method. Possible values include: 'email', 'phone'. + * + * @param preferredContactMethod the preferredContactMethod value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withPreferredContactMethod(PreferredContactMethod preferredContactMethod) { + this.preferredContactMethod = preferredContactMethod; + return this; + } + + /** + * Get primary email address. + * + * @return the primaryEmailAddress value + */ + public String primaryEmailAddress() { + return this.primaryEmailAddress; + } + + /** + * Set primary email address. + * + * @param primaryEmailAddress the primaryEmailAddress value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withPrimaryEmailAddress(String primaryEmailAddress) { + this.primaryEmailAddress = primaryEmailAddress; + return this; + } + + /** + * Get additional email addresses listed will be copied on any correspondence about the support ticket. + * + * @return the additionalEmailAddresses value + */ + public List additionalEmailAddresses() { + return this.additionalEmailAddresses; + } + + /** + * Set additional email addresses listed will be copied on any correspondence about the support ticket. + * + * @param additionalEmailAddresses the additionalEmailAddresses value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withAdditionalEmailAddresses(List additionalEmailAddresses) { + this.additionalEmailAddresses = additionalEmailAddresses; + return this; + } + + /** + * Get phone number. This is required if preferred contact method is phone. + * + * @return the phoneNumber value + */ + public String phoneNumber() { + return this.phoneNumber; + } + + /** + * Set phone number. This is required if preferred contact method is phone. + * + * @param phoneNumber the phoneNumber value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get time zone of the user. This is the name of the time zone from <a target='_blank' href='https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values'>Microsoft Time Zone Index Values</a>. + * + * @return the preferredTimeZone value + */ + public String preferredTimeZone() { + return this.preferredTimeZone; + } + + /** + * Set time zone of the user. This is the name of the time zone from <a target='_blank' href='https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values'>Microsoft Time Zone Index Values</a>. + * + * @param preferredTimeZone the preferredTimeZone value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withPreferredTimeZone(String preferredTimeZone) { + this.preferredTimeZone = preferredTimeZone; + return this; + } + + /** + * Get country of the user. This is the ISO 3166-1 alpha-3 code. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set country of the user. This is the ISO 3166-1 alpha-3 code. + * + * @param country the country value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at <a target='_blank' href='https://azure.microsoft.com/support/plans/response/'>Azure Severity and responsiveness</a>. Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. + * + * @return the preferredSupportLanguage value + */ + public String preferredSupportLanguage() { + return this.preferredSupportLanguage; + } + + /** + * Set preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at <a target='_blank' href='https://azure.microsoft.com/support/plans/response/'>Azure Severity and responsiveness</a>. Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. + * + * @param preferredSupportLanguage the preferredSupportLanguage value to set + * @return the ContactProfile object itself. + */ + public ContactProfile withPreferredSupportLanguage(String preferredSupportLanguage) { + this.preferredSupportLanguage = preferredSupportLanguage; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponse.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponse.java new file mode 100644 index 0000000000000..5f3beefc437a0 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The api error. + */ +public class ExceptionResponse { + /** + * The api error details. + */ + @JsonProperty(value = "error") + private ServiceError error; + + /** + * Get the api error details. + * + * @return the error value + */ + public ServiceError error() { + return this.error; + } + + /** + * Set the api error details. + * + * @param error the error value to set + * @return the ExceptionResponse object itself. + */ + public ExceptionResponse withError(ServiceError error) { + this.error = error; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponseException.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponseException.java new file mode 100644 index 0000000000000..401e82ce963d7 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ExceptionResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ExceptionResponse information. + */ +public class ExceptionResponseException extends RestException { + /** + * Initializes a new instance of the ExceptionResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ExceptionResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ExceptionResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ExceptionResponseException(final String message, final Response response, final ExceptionResponse body) { + super(message, response, body); + } + + @Override + public ExceptionResponse body() { + return (ExceptionResponse) super.body(); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operation.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operation.java new file mode 100644 index 0000000000000..7aa70e0520685 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operation.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.support.implementation.SupportManager; +import com.microsoft.azure.management.support.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/OperationDisplay.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/OperationDisplay.java new file mode 100644 index 0000000000000..21f41a7ae81ae --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/OperationDisplay.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that describes the operation. + */ +public class OperationDisplay { + /** + * The description of the operation. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The action that users can perform, based on their permission level. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * Service provider: Microsoft Support. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * Resource on which the operation is performed. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the action that users can perform, based on their permission level. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get service provider: Microsoft Support. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operations.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operations.java new file mode 100644 index 0000000000000..5b0a10638a0ab --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import rx.Observable; +import com.microsoft.azure.management.support.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * This lists all the available Microsoft Support REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/PreferredContactMethod.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/PreferredContactMethod.java new file mode 100644 index 0000000000000..54195b4569c6b --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/PreferredContactMethod.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PreferredContactMethod. + */ +public final class PreferredContactMethod extends ExpandableStringEnum { + /** Static value email for PreferredContactMethod. */ + public static final PreferredContactMethod EMAIL = fromString("email"); + + /** Static value phone for PreferredContactMethod. */ + public static final PreferredContactMethod PHONE = fromString("phone"); + + /** + * Creates or finds a PreferredContactMethod from its string representation. + * @param name a name to look for + * @return the corresponding PreferredContactMethod + */ + @JsonCreator + public static PreferredContactMethod fromString(String name) { + return fromString(name, PreferredContactMethod.class); + } + + /** + * @return known PreferredContactMethod values + */ + public static Collection values() { + return values(PreferredContactMethod.class); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassification.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassification.java new file mode 100644 index 0000000000000..1fc1a2f00f18c --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassification.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.support.implementation.ProblemClassificationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.support.implementation.SupportManager; + +/** + * Type representing ProblemClassification. + */ +public interface ProblemClassification extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassifications.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassifications.java new file mode 100644 index 0000000000000..89e4b7c102e57 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ProblemClassifications.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import rx.Observable; +import com.microsoft.azure.management.support.implementation.ProblemClassificationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ProblemClassifications. + */ +public interface ProblemClassifications extends HasInner { + /** + * Gets the details of a specific problem classification for a specific Azure service. + * + * @param serviceName Name of Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String serviceName, String problemClassificationName); + + /** + * Lists all the problem classifications (categories) available for a specific Azure service.<br/><br/> Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @param serviceName Name of Azure service for which the problem classifications need to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String serviceName); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaChangeRequest.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaChangeRequest.java new file mode 100644 index 0000000000000..36aab93ef9aa9 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaChangeRequest.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This property is required for providing the region and new quota limits. + */ +public class QuotaChangeRequest { + /** + * Region for which the quota increase request is being made. + */ + @JsonProperty(value = "region") + private String region; + + /** + * Payload of the quota increase request. + */ + @JsonProperty(value = "payload") + private String payload; + + /** + * Get region for which the quota increase request is being made. + * + * @return the region value + */ + public String region() { + return this.region; + } + + /** + * Set region for which the quota increase request is being made. + * + * @param region the region value to set + * @return the QuotaChangeRequest object itself. + */ + public QuotaChangeRequest withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get payload of the quota increase request. + * + * @return the payload value + */ + public String payload() { + return this.payload; + } + + /** + * Set payload of the quota increase request. + * + * @param payload the payload value to set + * @return the QuotaChangeRequest object itself. + */ + public QuotaChangeRequest withPayload(String payload) { + this.payload = payload; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaTicketDetails.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaTicketDetails.java new file mode 100644 index 0000000000000..f1fe1df979b99 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/QuotaTicketDetails.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional set of information required for quota increase support ticket for + * certain quota types, e.g.: Virtual machine cores. Get complete details about + * Quota payload support request along with examples at <a target='' + * href='https://aka.ms/supportrpquotarequestpayload'>Support quota + * request</a>. + */ +public class QuotaTicketDetails { + /** + * Required for certain quota types when there is a sub type that you are + * requesting quota increase for. Example: Batch. + */ + @JsonProperty(value = "quotaChangeRequestSubType") + private String quotaChangeRequestSubType; + + /** + * Quota change request version. + */ + @JsonProperty(value = "quotaChangeRequestVersion") + private String quotaChangeRequestVersion; + + /** + * This property is required for providing the region and new quota limits. + */ + @JsonProperty(value = "quotaChangeRequests") + private List quotaChangeRequests; + + /** + * Get required for certain quota types when there is a sub type that you are requesting quota increase for. Example: Batch. + * + * @return the quotaChangeRequestSubType value + */ + public String quotaChangeRequestSubType() { + return this.quotaChangeRequestSubType; + } + + /** + * Set required for certain quota types when there is a sub type that you are requesting quota increase for. Example: Batch. + * + * @param quotaChangeRequestSubType the quotaChangeRequestSubType value to set + * @return the QuotaTicketDetails object itself. + */ + public QuotaTicketDetails withQuotaChangeRequestSubType(String quotaChangeRequestSubType) { + this.quotaChangeRequestSubType = quotaChangeRequestSubType; + return this; + } + + /** + * Get quota change request version. + * + * @return the quotaChangeRequestVersion value + */ + public String quotaChangeRequestVersion() { + return this.quotaChangeRequestVersion; + } + + /** + * Set quota change request version. + * + * @param quotaChangeRequestVersion the quotaChangeRequestVersion value to set + * @return the QuotaTicketDetails object itself. + */ + public QuotaTicketDetails withQuotaChangeRequestVersion(String quotaChangeRequestVersion) { + this.quotaChangeRequestVersion = quotaChangeRequestVersion; + return this; + } + + /** + * Get this property is required for providing the region and new quota limits. + * + * @return the quotaChangeRequests value + */ + public List quotaChangeRequests() { + return this.quotaChangeRequests; + } + + /** + * Set this property is required for providing the region and new quota limits. + * + * @param quotaChangeRequests the quotaChangeRequests value to set + * @return the QuotaTicketDetails object itself. + */ + public QuotaTicketDetails withQuotaChangeRequests(List quotaChangeRequests) { + this.quotaChangeRequests = quotaChangeRequests; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Service.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Service.java new file mode 100644 index 0000000000000..c691e16134f9b --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Service.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.support.implementation.SupportManager; +import com.microsoft.azure.management.support.implementation.ServiceInner; + +/** + * Type representing Service. + */ +public interface Service extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceError.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceError.java new file mode 100644 index 0000000000000..1a73bd6c1b79c --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceError.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The api error details. + */ +public class ServiceError { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target of the error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The list of error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the error code. + * + * @param code the code value to set + * @return the ServiceError object itself. + */ + public ServiceError withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the error message. + * + * @param message the message value to set + * @return the ServiceError object itself. + */ + public ServiceError withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target of the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the error. + * + * @param target the target value to set + * @return the ServiceError object itself. + */ + public ServiceError withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the list of error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceErrorDetail.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceErrorDetail.java new file mode 100644 index 0000000000000..9699bcaac8687 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceErrorDetail.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error details. + */ +public class ServiceErrorDetail { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The target of the error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the target of the error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target of the error. + * + * @param target the target value to set + * @return the ServiceErrorDetail object itself. + */ + public ServiceErrorDetail withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceLevelAgreement.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceLevelAgreement.java new file mode 100644 index 0000000000000..4d58d796589f3 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/ServiceLevelAgreement.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service Level Agreement details for a support ticket. + */ +public class ServiceLevelAgreement { + /** + * Time in UTC (ISO 8601 format) when service level agreement starts. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * Time in UTC (ISO 8601 format) when service level agreement expires. + */ + @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime expirationTime; + + /** + * Service Level Agreement in minutes. + */ + @JsonProperty(value = "slaMinutes", access = JsonProperty.Access.WRITE_ONLY) + private Integer slaMinutes; + + /** + * Get time in UTC (ISO 8601 format) when service level agreement starts. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get time in UTC (ISO 8601 format) when service level agreement expires. + * + * @return the expirationTime value + */ + public DateTime expirationTime() { + return this.expirationTime; + } + + /** + * Get service Level Agreement in minutes. + * + * @return the slaMinutes value + */ + public Integer slaMinutes() { + return this.slaMinutes; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Services.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Services.java new file mode 100644 index 0000000000000..4e9b5a6003f6b --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Services.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import rx.Observable; +import com.microsoft.azure.management.support.implementation.ServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Services. + */ +public interface Services extends HasInner { + /** + * Gets a specific Azure service for support ticket creation. + * + * @param serviceName Name of Azure service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String serviceName); + + /** + * Lists all the Azure services available for support ticket creation. Here are the Service Ids for **Billing**, **Subscription Management**, and **Service and subscription limits (Quotas)** issues: <br/><table><tr><td><u>Issue type</u></td><td><u>Service Id</u></td></tr><tr><td>Billing</td><td>'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'</td></tr><tr><td>Subscription Management</td><td>'/providers/Microsoft.Support/services/f3dc5421-79ef-1efa-41a5-42bf3cbb52c6'</td></tr><tr><td>Quota</td><td>'/providers/Microsoft.Support/services/06bfd9d3-516b-d5c6-5802-169c800dec89'</td></tr></table> <br/><br/> For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview'>New support request</a> page. <br/><br/> Always use the service and it's corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SeverityLevel.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SeverityLevel.java new file mode 100644 index 0000000000000..ea8c46089eeeb --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SeverityLevel.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SeverityLevel. + */ +public final class SeverityLevel extends ExpandableStringEnum { + /** Static value minimal for SeverityLevel. */ + public static final SeverityLevel MINIMAL = fromString("minimal"); + + /** Static value moderate for SeverityLevel. */ + public static final SeverityLevel MODERATE = fromString("moderate"); + + /** Static value critical for SeverityLevel. */ + public static final SeverityLevel CRITICAL = fromString("critical"); + + /** + * Creates or finds a SeverityLevel from its string representation. + * @param name a name to look for + * @return the corresponding SeverityLevel + */ + @JsonCreator + public static SeverityLevel fromString(String name) { + return fromString(name, SeverityLevel.class); + } + + /** + * @return known SeverityLevel values + */ + public static Collection values() { + return values(SeverityLevel.class); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportEngineer.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportEngineer.java new file mode 100644 index 0000000000000..720ca6a3a3403 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportEngineer.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Support engineer information. + */ +public class SupportEngineer { + /** + * Email address of the Azure Support engineer assigned to the support + * ticket. + */ + @JsonProperty(value = "emailAddress", access = JsonProperty.Access.WRITE_ONLY) + private String emailAddress; + + /** + * Get email address of the Azure Support engineer assigned to the support ticket. + * + * @return the emailAddress value + */ + public String emailAddress() { + return this.emailAddress; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTicketDetails.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTicketDetails.java new file mode 100644 index 0000000000000..d788f0e60985e --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTicketDetails.java @@ -0,0 +1,361 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.support.implementation.SupportTicketDetailsInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.support.implementation.SupportManager; +import org.joda.time.DateTime; + +/** + * Type representing SupportTicketDetails. + */ +public interface SupportTicketDetails extends HasInner, Indexable, Updatable, Refreshable, HasManager { + /** + * @return the contactDetails value. + */ + ContactProfile contactDetails(); + + /** + * @return the createdDate value. + */ + DateTime createdDate(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the enrollmentId value. + */ + String enrollmentId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the modifiedDate value. + */ + DateTime modifiedDate(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the problemClassificationDisplayName value. + */ + String problemClassificationDisplayName(); + + /** + * @return the problemClassificationId value. + */ + String problemClassificationId(); + + /** + * @return the problemStartTime value. + */ + DateTime problemStartTime(); + + /** + * @return the productionOutage value. + */ + Boolean productionOutage(); + + /** + * @return the quotaTicketDetails value. + */ + QuotaTicketDetails quotaTicketDetails(); + + /** + * @return the require24X7Response value. + */ + Boolean require24X7Response(); + + /** + * @return the serviceDisplayName value. + */ + String serviceDisplayName(); + + /** + * @return the serviceId value. + */ + String serviceId(); + + /** + * @return the serviceLevelAgreement value. + */ + ServiceLevelAgreement serviceLevelAgreement(); + + /** + * @return the severity value. + */ + SeverityLevel severity(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the supportEngineer value. + */ + SupportEngineer supportEngineer(); + + /** + * @return the supportPlanType value. + */ + String supportPlanType(); + + /** + * @return the supportTicketId value. + */ + String supportTicketId(); + + /** + * @return the technicalTicketDetails value. + */ + TechnicalTicketDetails technicalTicketDetails(); + + /** + * @return the title value. + */ + String title(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the SupportTicketDetails definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithContactDetails, DefinitionStages.WithDescription, DefinitionStages.WithProblemClassificationId, DefinitionStages.WithServiceId, DefinitionStages.WithSeverity, DefinitionStages.WithTitle, DefinitionStages.WithCreate { + } + + /** + * Grouping of SupportTicketDetails definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SupportTicketDetails definition. + */ + interface Blank extends WithContactDetails { + } + + /** + * The stage of the supportticketdetails definition allowing to specify ContactDetails. + */ + interface WithContactDetails { + /** + * Specifies contactDetails. + * @param contactDetails Contact information of the user requesting to create a support ticket + * @return the next definition stage + */ + WithDescription withContactDetails(ContactProfile contactDetails); + } + + /** + * The stage of the supportticketdetails definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description Detailed description of the question or issue + * @return the next definition stage + */ + WithProblemClassificationId withDescription(String description); + } + + /** + * The stage of the supportticketdetails definition allowing to specify ProblemClassificationId. + */ + interface WithProblemClassificationId { + /** + * Specifies problemClassificationId. + * @param problemClassificationId Each Azure service has its own set of issue category called problem classification that corresponds to the type of problem you're experiencing. This parameter is the resource id of ProblemClassification resource + * @return the next definition stage + */ + WithServiceId withProblemClassificationId(String problemClassificationId); + } + + /** + * The stage of the supportticketdetails definition allowing to specify ServiceId. + */ + interface WithServiceId { + /** + * Specifies serviceId. + * @param serviceId This is the resource id of the Azure service resource associated with the support ticket + * @return the next definition stage + */ + WithSeverity withServiceId(String serviceId); + } + + /** + * The stage of the supportticketdetails definition allowing to specify Severity. + */ + interface WithSeverity { + /** + * Specifies severity. + * @param severity 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. Possible values include: 'minimal', 'moderate', 'critical' + * @return the next definition stage + */ + WithTitle withSeverity(SeverityLevel severity); + } + + /** + * The stage of the supportticketdetails definition allowing to specify Title. + */ + interface WithTitle { + /** + * Specifies title. + * @param title Title of the support ticket + * @return the next definition stage + */ + WithCreate withTitle(String title); + } + + /** + * The stage of the supportticketdetails definition allowing to specify ProblemStartTime. + */ + interface WithProblemStartTime { + /** + * Specifies problemStartTime. + * @param problemStartTime Time in UTC (ISO 8601 format) when the problem started + * @return the next definition stage + */ + WithCreate withProblemStartTime(DateTime problemStartTime); + } + + /** + * The stage of the supportticketdetails definition allowing to specify QuotaTicketDetails. + */ + interface WithQuotaTicketDetails { + /** + * Specifies quotaTicketDetails. + * @param quotaTicketDetails Additional ticket details associated with a quota support ticket request + * @return the next definition stage + */ + WithCreate withQuotaTicketDetails(QuotaTicketDetails quotaTicketDetails); + } + + /** + * The stage of the supportticketdetails definition allowing to specify Require24X7Response. + */ + interface WithRequire24X7Response { + /** + * Specifies require24X7Response. + * @param require24X7Response Indicates if this requires a 24x7 response from Azure + * @return the next definition stage + */ + WithCreate withRequire24X7Response(Boolean require24X7Response); + } + + /** + * The stage of the supportticketdetails definition allowing to specify ServiceLevelAgreement. + */ + interface WithServiceLevelAgreement { + /** + * Specifies serviceLevelAgreement. + * @param serviceLevelAgreement Service Level Agreement information for this support ticket + * @return the next definition stage + */ + WithCreate withServiceLevelAgreement(ServiceLevelAgreement serviceLevelAgreement); + } + + /** + * The stage of the supportticketdetails definition allowing to specify SupportEngineer. + */ + interface WithSupportEngineer { + /** + * Specifies supportEngineer. + * @param supportEngineer Information about support engineer working on this support ticket + * @return the next definition stage + */ + WithCreate withSupportEngineer(SupportEngineer supportEngineer); + } + + /** + * The stage of the supportticketdetails definition allowing to specify SupportTicketId. + */ + interface WithSupportTicketId { + /** + * Specifies supportTicketId. + * @param supportTicketId System generated support ticket id that is unique + * @return the next definition stage + */ + WithCreate withSupportTicketId(String supportTicketId); + } + + /** + * The stage of the supportticketdetails definition allowing to specify TechnicalTicketDetails. + */ + interface WithTechnicalTicketDetails { + /** + * Specifies technicalTicketDetails. + * @param technicalTicketDetails Additional ticket details associated with a technical support ticket request + * @return the next definition stage + */ + WithCreate withTechnicalTicketDetails(TechnicalTicketDetails technicalTicketDetails); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithProblemStartTime, DefinitionStages.WithQuotaTicketDetails, DefinitionStages.WithRequire24X7Response, DefinitionStages.WithServiceLevelAgreement, DefinitionStages.WithSupportEngineer, DefinitionStages.WithSupportTicketId, DefinitionStages.WithTechnicalTicketDetails { + } + } + /** + * The template for a SupportTicketDetails update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithContactDetails, UpdateStages.WithSeverity { + } + + /** + * Grouping of SupportTicketDetails update stages. + */ + interface UpdateStages { + /** + * The stage of the supportticketdetails update allowing to specify ContactDetails. + */ + interface WithContactDetails { + /** + * Specifies contactDetails. + * @param contactDetails Contact details to be updated on the support ticket + * @return the next update stage + */ + Update withContactDetails(UpdateContactProfile contactDetails); + } + + /** + * The stage of the supportticketdetails update allowing to specify Severity. + */ + interface WithSeverity { + /** + * Specifies severity. + * @param severity Severity level. Possible values include: 'minimal', 'moderate', 'critical' + * @return the next update stage + */ + Update withSeverity(SeverityLevel severity); + } + + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTickets.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTickets.java new file mode 100644 index 0000000000000..899198cc4fd8c --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/SupportTickets.java @@ -0,0 +1,39 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Observable; +import com.microsoft.azure.management.support.implementation.SupportTicketsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SupportTickets. + */ +public interface SupportTickets extends SupportsCreating, SupportsListing, HasInner { + /** + * Gets details for a specific support ticket in an Azure subscription. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String supportTicketName); + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput); + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/TechnicalTicketDetails.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/TechnicalTicketDetails.java new file mode 100644 index 0000000000000..a292a3026e791 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/TechnicalTicketDetails.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional information for technical support ticket. + */ +public class TechnicalTicketDetails { + /** + * This is the resource id of the Azure service resource (For example: A + * virtual machine resource or an HDInsight resource) for which the support + * ticket is created. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * Get this is the resource id of the Azure service resource (For example: A virtual machine resource or an HDInsight resource) for which the support ticket is created. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set this is the resource id of the Azure service resource (For example: A virtual machine resource or an HDInsight resource) for which the support ticket is created. + * + * @param resourceId the resourceId value to set + * @return the TechnicalTicketDetails object itself. + */ + public TechnicalTicketDetails withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Type.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Type.java new file mode 100644 index 0000000000000..56d09d6970904 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/Type.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Type. + */ +public enum Type { + /** Enum value Microsoft.Support/supportTickets. */ + MICROSOFT_SUPPORTSUPPORT_TICKETS("Microsoft.Support/supportTickets"), + + /** Enum value Microsoft.Support/communications. */ + MICROSOFT_SUPPORTCOMMUNICATIONS("Microsoft.Support/communications"); + + /** The actual serialized value for a Type instance. */ + private String value; + + Type(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Type instance. + * + * @param value the serialized value to parse. + * @return the parsed Type object, or null if unable to parse. + */ + @JsonCreator + public static Type fromString(String value) { + Type[] items = Type.values(); + for (Type item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateContactProfile.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateContactProfile.java new file mode 100644 index 0000000000000..5eaf3e78c5bed --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateContactProfile.java @@ -0,0 +1,264 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Contact information associated with the support ticket. + */ +public class UpdateContactProfile { + /** + * First name. + */ + @JsonProperty(value = "firstName") + private String firstName; + + /** + * Last name. + */ + @JsonProperty(value = "lastName") + private String lastName; + + /** + * Preferred contact method. Possible values include: 'email', 'phone'. + */ + @JsonProperty(value = "preferredContactMethod") + private PreferredContactMethod preferredContactMethod; + + /** + * Primary email address. + */ + @JsonProperty(value = "primaryEmailAddress") + private String primaryEmailAddress; + + /** + * Email addresses listed will be copied on any correspondence about the + * support ticket. + */ + @JsonProperty(value = "additionalEmailAddresses") + private List additionalEmailAddresses; + + /** + * Phone number. This is required if preferred contact method is phone. + */ + @JsonProperty(value = "phoneNumber") + private String phoneNumber; + + /** + * Time zone of the user. This is the name of the time zone from <a + * target='_blank' + * href='https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values'>Microsoft + * Time Zone Index Values</a>. + */ + @JsonProperty(value = "preferredTimeZone") + private String preferredTimeZone; + + /** + * Country of the user. This is the ISO 3166-1 alpha-3 code. + */ + @JsonProperty(value = "country") + private String country; + + /** + * Preferred language of support from Azure. Support languages vary based + * on the severity you choose for your support ticket. Learn more at <a + * target='_blank' + * href='https://azure.microsoft.com/support/plans/response/'>Azure + * Severity and responsiveness</a>. Use the standard language-country + * code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, + * 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' + * for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for + * Italian, 'zh-tw' for Chinese and 'de-de' for German. + */ + @JsonProperty(value = "preferredSupportLanguage") + private String preferredSupportLanguage; + + /** + * Get first name. + * + * @return the firstName value + */ + public String firstName() { + return this.firstName; + } + + /** + * Set first name. + * + * @param firstName the firstName value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withFirstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get last name. + * + * @return the lastName value + */ + public String lastName() { + return this.lastName; + } + + /** + * Set last name. + * + * @param lastName the lastName value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withLastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get preferred contact method. Possible values include: 'email', 'phone'. + * + * @return the preferredContactMethod value + */ + public PreferredContactMethod preferredContactMethod() { + return this.preferredContactMethod; + } + + /** + * Set preferred contact method. Possible values include: 'email', 'phone'. + * + * @param preferredContactMethod the preferredContactMethod value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withPreferredContactMethod(PreferredContactMethod preferredContactMethod) { + this.preferredContactMethod = preferredContactMethod; + return this; + } + + /** + * Get primary email address. + * + * @return the primaryEmailAddress value + */ + public String primaryEmailAddress() { + return this.primaryEmailAddress; + } + + /** + * Set primary email address. + * + * @param primaryEmailAddress the primaryEmailAddress value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withPrimaryEmailAddress(String primaryEmailAddress) { + this.primaryEmailAddress = primaryEmailAddress; + return this; + } + + /** + * Get email addresses listed will be copied on any correspondence about the support ticket. + * + * @return the additionalEmailAddresses value + */ + public List additionalEmailAddresses() { + return this.additionalEmailAddresses; + } + + /** + * Set email addresses listed will be copied on any correspondence about the support ticket. + * + * @param additionalEmailAddresses the additionalEmailAddresses value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withAdditionalEmailAddresses(List additionalEmailAddresses) { + this.additionalEmailAddresses = additionalEmailAddresses; + return this; + } + + /** + * Get phone number. This is required if preferred contact method is phone. + * + * @return the phoneNumber value + */ + public String phoneNumber() { + return this.phoneNumber; + } + + /** + * Set phone number. This is required if preferred contact method is phone. + * + * @param phoneNumber the phoneNumber value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get time zone of the user. This is the name of the time zone from <a target='_blank' href='https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values'>Microsoft Time Zone Index Values</a>. + * + * @return the preferredTimeZone value + */ + public String preferredTimeZone() { + return this.preferredTimeZone; + } + + /** + * Set time zone of the user. This is the name of the time zone from <a target='_blank' href='https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values'>Microsoft Time Zone Index Values</a>. + * + * @param preferredTimeZone the preferredTimeZone value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withPreferredTimeZone(String preferredTimeZone) { + this.preferredTimeZone = preferredTimeZone; + return this; + } + + /** + * Get country of the user. This is the ISO 3166-1 alpha-3 code. + * + * @return the country value + */ + public String country() { + return this.country; + } + + /** + * Set country of the user. This is the ISO 3166-1 alpha-3 code. + * + * @param country the country value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withCountry(String country) { + this.country = country; + return this; + } + + /** + * Get preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at <a target='_blank' href='https://azure.microsoft.com/support/plans/response/'>Azure Severity and responsiveness</a>. Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. + * + * @return the preferredSupportLanguage value + */ + public String preferredSupportLanguage() { + return this.preferredSupportLanguage; + } + + /** + * Set preferred language of support from Azure. Support languages vary based on the severity you choose for your support ticket. Learn more at <a target='_blank' href='https://azure.microsoft.com/support/plans/response/'>Azure Severity and responsiveness</a>. Use the standard language-country code. Valid values are 'en-us' for English, 'zh-hans' for Chinese, 'es-es' for Spanish, 'fr-fr' for French, 'ja-jp' for Japanese, 'ko-kr' for Korean, 'ru-ru' for Russian, 'pt-br' for Portuguese, 'it-it' for Italian, 'zh-tw' for Chinese and 'de-de' for German. + * + * @param preferredSupportLanguage the preferredSupportLanguage value to set + * @return the UpdateContactProfile object itself. + */ + public UpdateContactProfile withPreferredSupportLanguage(String preferredSupportLanguage) { + this.preferredSupportLanguage = preferredSupportLanguage; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateSupportTicket.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateSupportTicket.java new file mode 100644 index 0000000000000..daac90816729e --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/UpdateSupportTicket.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Updates severity and contact details in the support ticket. + */ +public class UpdateSupportTicket { + /** + * Severity level. Possible values include: 'minimal', 'moderate', + * 'critical'. + */ + @JsonProperty(value = "severity") + private SeverityLevel severity; + + /** + * Contact details to be updated on the support ticket. + */ + @JsonProperty(value = "contactDetails") + private UpdateContactProfile contactDetails; + + /** + * Get severity level. Possible values include: 'minimal', 'moderate', 'critical'. + * + * @return the severity value + */ + public SeverityLevel severity() { + return this.severity; + } + + /** + * Set severity level. Possible values include: 'minimal', 'moderate', 'critical'. + * + * @param severity the severity value to set + * @return the UpdateSupportTicket object itself. + */ + public UpdateSupportTicket withSeverity(SeverityLevel severity) { + this.severity = severity; + return this; + } + + /** + * Get contact details to be updated on the support ticket. + * + * @return the contactDetails value + */ + public UpdateContactProfile contactDetails() { + return this.contactDetails; + } + + /** + * Set contact details to be updated on the support ticket. + * + * @param contactDetails the contactDetails value to set + * @return the UpdateSupportTicket object itself. + */ + public UpdateSupportTicket withContactDetails(UpdateContactProfile contactDetails) { + this.contactDetails = contactDetails; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputImpl.java new file mode 100644 index 0000000000000..8b9ed79f72a4f --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.CheckNameAvailabilityOutput; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class CheckNameAvailabilityOutputImpl extends WrapperImpl implements CheckNameAvailabilityOutput { + private final SupportManager manager; + CheckNameAvailabilityOutputImpl(CheckNameAvailabilityOutputInner inner, SupportManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SupportManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputInner.java new file mode 100644 index 0000000000000..8d210b2eba77c --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CheckNameAvailabilityOutputInner.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Output of check name availability API. + */ +public class CheckNameAvailabilityOutputInner { + /** + * Indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable", access = JsonProperty.Access.WRITE_ONLY) + private Boolean nameAvailable; + + /** + * The reason why the name is not available. + */ + @JsonProperty(value = "reason", access = JsonProperty.Access.WRITE_ONLY) + private String reason; + + /** + * The detailed error message describing why the name is not available. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * Get indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Get the reason why the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Get the detailed error message describing why the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsImpl.java new file mode 100644 index 0000000000000..febca88d77e4c --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsImpl.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.CommunicationDetails; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.support.CommunicationType; +import com.microsoft.azure.management.support.CommunicationDirection; +import org.joda.time.DateTime; + +class CommunicationDetailsImpl extends CreatableUpdatableImpl implements CommunicationDetails, CommunicationDetails.Definition, CommunicationDetails.Update { + private final SupportManager manager; + private String supportTicketName; + private String communicationName; + + CommunicationDetailsImpl(String name, SupportManager manager) { + super(name, new CommunicationDetailsInner()); + this.manager = manager; + // Set resource name + this.communicationName = name; + // + } + + CommunicationDetailsImpl(CommunicationDetailsInner inner, SupportManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.communicationName = inner.name(); + // set resource ancestor and positional variables + this.supportTicketName = IdParsingUtils.getValueFromIdByName(inner.id(), "supportTickets"); + this.communicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "communications"); + // + } + + @Override + public SupportManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + CommunicationsInner client = this.manager().inner().communications(); + return client.createAsync(this.supportTicketName, this.communicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + CommunicationsInner client = this.manager().inner().communications(); + return client.createAsync(this.supportTicketName, this.communicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + CommunicationsInner client = this.manager().inner().communications(); + return client.getAsync(this.supportTicketName, this.communicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String body() { + return this.inner().body(); + } + + @Override + public CommunicationDirection communicationDirection() { + return this.inner().communicationDirection(); + } + + @Override + public CommunicationType communicationType() { + return this.inner().communicationType(); + } + + @Override + public DateTime createdDate() { + return this.inner().createdDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String sender() { + return this.inner().sender(); + } + + @Override + public String subject() { + return this.inner().subject(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public CommunicationDetailsImpl withExistingSupportTicket(String supportTicketName) { + this.supportTicketName = supportTicketName; + return this; + } + + @Override + public CommunicationDetailsImpl withBody(String body) { + this.inner().withBody(body); + return this; + } + + @Override + public CommunicationDetailsImpl withSubject(String subject) { + this.inner().withSubject(subject); + return this; + } + + @Override + public CommunicationDetailsImpl withSender(String sender) { + this.inner().withSender(sender); + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsInner.java new file mode 100644 index 0000000000000..faddcf1920967 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationDetailsInner.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.CommunicationType; +import com.microsoft.azure.management.support.CommunicationDirection; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Object that represents Communication resource. + */ +@JsonFlatten +public class CommunicationDetailsInner extends ProxyResource { + /** + * Communication type. Possible values include: 'web', 'phone'. + */ + @JsonProperty(value = "properties.communicationType", access = JsonProperty.Access.WRITE_ONLY) + private CommunicationType communicationType; + + /** + * Direction of communication. Possible values include: 'inbound', + * 'outbound'. + */ + @JsonProperty(value = "properties.communicationDirection", access = JsonProperty.Access.WRITE_ONLY) + private CommunicationDirection communicationDirection; + + /** + * Email address of the sender. + */ + @JsonProperty(value = "properties.sender") + private String sender; + + /** + * Subject of the communication. + */ + @JsonProperty(value = "properties.subject", required = true) + private String subject; + + /** + * Body of the communication. + */ + @JsonProperty(value = "properties.body", required = true) + private String body; + + /** + * Time in UTC (ISO 8601 format) when the communication was created. + */ + @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDate; + + /** + * Get communication type. Possible values include: 'web', 'phone'. + * + * @return the communicationType value + */ + public CommunicationType communicationType() { + return this.communicationType; + } + + /** + * Get direction of communication. Possible values include: 'inbound', 'outbound'. + * + * @return the communicationDirection value + */ + public CommunicationDirection communicationDirection() { + return this.communicationDirection; + } + + /** + * Get email address of the sender. + * + * @return the sender value + */ + public String sender() { + return this.sender; + } + + /** + * Set email address of the sender. + * + * @param sender the sender value to set + * @return the CommunicationDetailsInner object itself. + */ + public CommunicationDetailsInner withSender(String sender) { + this.sender = sender; + return this; + } + + /** + * Get subject of the communication. + * + * @return the subject value + */ + public String subject() { + return this.subject; + } + + /** + * Set subject of the communication. + * + * @param subject the subject value to set + * @return the CommunicationDetailsInner object itself. + */ + public CommunicationDetailsInner withSubject(String subject) { + this.subject = subject; + return this; + } + + /** + * Get body of the communication. + * + * @return the body value + */ + public String body() { + return this.body; + } + + /** + * Set body of the communication. + * + * @param body the body value to set + * @return the CommunicationDetailsInner object itself. + */ + public CommunicationDetailsInner withBody(String body) { + this.body = body; + return this; + } + + /** + * Get time in UTC (ISO 8601 format) when the communication was created. + * + * @return the createdDate value + */ + public DateTime createdDate() { + return this.createdDate; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsImpl.java new file mode 100644 index 0000000000000..3e9bb7bddf1d6 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsImpl.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.support.Communications; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.support.CommunicationDetails; +import com.microsoft.azure.management.support.CheckNameAvailabilityOutput; +import com.microsoft.azure.management.support.CheckNameAvailabilityInput; + +class CommunicationsImpl extends WrapperImpl implements Communications { + private final SupportManager manager; + + CommunicationsImpl(SupportManager manager) { + super(manager.inner().communications()); + this.manager = manager; + } + + public SupportManager manager() { + return this.manager; + } + + @Override + public CommunicationDetailsImpl define(String name) { + return wrapModel(name); + } + + private CommunicationDetailsImpl wrapModel(CommunicationDetailsInner inner) { + return new CommunicationDetailsImpl(inner, manager()); + } + + private CommunicationDetailsImpl wrapModel(String name) { + return new CommunicationDetailsImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String supportTicketName) { + CommunicationsInner client = this.inner(); + return client.listAsync(supportTicketName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public CommunicationDetails call(CommunicationDetailsInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String supportTicketName, String communicationName) { + CommunicationsInner client = this.inner(); + return client.getAsync(supportTicketName, communicationName) + .flatMap(new Func1>() { + @Override + public Observable call(CommunicationDetailsInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((CommunicationDetails)wrapModel(inner)); + } + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { + CommunicationsInner client = this.inner(); + return client.checkNameAvailabilityAsync(supportTicketName, checkNameAvailabilityInput) + .map(new Func1() { + @Override + public CheckNameAvailabilityOutput call(CheckNameAvailabilityOutputInner inner) { + return new CheckNameAvailabilityOutputImpl(inner, manager()); + } + }); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsInner.java new file mode 100644 index 0000000000000..e138e9ef70232 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/CommunicationsInner.java @@ -0,0 +1,782 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.support.CheckNameAvailabilityInput; +import com.microsoft.azure.management.support.ExceptionResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Communications. + */ +public class CommunicationsInner { + /** The Retrofit service to perform REST calls. */ + private CommunicationsService service; + /** The service client containing this operation class. */ + private MicrosoftSupportImpl client; + + /** + * Initializes an instance of CommunicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CommunicationsInner(Retrofit retrofit, MicrosoftSupportImpl client) { + this.service = retrofit.create(CommunicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Communications to be + * used by Retrofit to perform actually REST calls. + */ + interface CommunicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Communications checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/checkNameAvailability") + Observable> checkNameAvailability(@Path("supportTicketName") String supportTicketName, @Path("subscriptionId") String subscriptionId, @Body CheckNameAvailabilityInput checkNameAvailabilityInput, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Communications list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications") + Observable> list(@Path("supportTicketName") String supportTicketName, @Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Communications get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + Observable> get(@Path("supportTicketName") String supportTicketName, @Path("communicationName") String communicationName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Communications create" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + Observable> create(@Path("supportTicketName") String supportTicketName, @Path("communicationName") String communicationName, @Path("subscriptionId") String subscriptionId, @Body CommunicationDetailsInner createCommunicationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Communications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}/communications/{communicationName}") + Observable> beginCreate(@Path("supportTicketName") String supportTicketName, @Path("communicationName") String communicationName, @Path("subscriptionId") String subscriptionId, @Body CommunicationDetailsInner createCommunicationParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Communications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @param supportTicketName Support ticket name + * @param checkNameAvailabilityInput Input to check + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityOutputInner object if successful. + */ + public CheckNameAvailabilityOutputInner checkNameAvailability(String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithServiceResponseAsync(supportTicketName, checkNameAvailabilityInput).toBlocking().single().body(); + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @param supportTicketName Support ticket name + * @param checkNameAvailabilityInput Input to check + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(supportTicketName, checkNameAvailabilityInput), serviceCallback); + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @param supportTicketName Support ticket name + * @param checkNameAvailabilityInput Input to check + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable checkNameAvailabilityAsync(String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithServiceResponseAsync(supportTicketName, checkNameAvailabilityInput).map(new Func1, CheckNameAvailabilityOutputInner>() { + @Override + public CheckNameAvailabilityOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for adding a new communication to the support ticket. + * + * @param supportTicketName Support ticket name + * @param checkNameAvailabilityInput Input to check + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String supportTicketName, CheckNameAvailabilityInput checkNameAvailabilityInput) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (checkNameAvailabilityInput == null) { + throw new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(checkNameAvailabilityInput); + return service.checkNameAvailability(supportTicketName, this.client.subscriptionId(), checkNameAvailabilityInput, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CommunicationDetailsInner> object if successful. + */ + public PagedList list(final String supportTicketName) { + ServiceResponse> response = listSinglePageAsync(supportTicketName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String supportTicketName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(supportTicketName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CommunicationDetailsInner> object + */ + public Observable> listAsync(final String supportTicketName) { + return listWithServiceResponseAsync(supportTicketName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CommunicationDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync(final String supportTicketName) { + return listSinglePageAsync(supportTicketName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CommunicationDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String supportTicketName) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + final String filter = null; + return service.list(supportTicketName, this.client.subscriptionId(), top, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CommunicationDetailsInner> object if successful. + */ + public PagedList list(final String supportTicketName, final Integer top, final String filter) { + ServiceResponse> response = listSinglePageAsync(supportTicketName, top, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String supportTicketName, final Integer top, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(supportTicketName, top, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CommunicationDetailsInner> object + */ + public Observable> listAsync(final String supportTicketName, final Integer top, final String filter) { + return listWithServiceResponseAsync(supportTicketName, top, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @param top The number of values to return in the collection. Default is 10 and max is 10. + * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CommunicationDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync(final String supportTicketName, final Integer top, final String filter) { + return listSinglePageAsync(supportTicketName, top, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + ServiceResponse> * @param supportTicketName Support ticket name + ServiceResponse> * @param top The number of values to return in the collection. Default is 10 and max is 10. + ServiceResponse> * @param filter The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CommunicationDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String supportTicketName, final Integer top, final String filter) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(supportTicketName, this.client.subscriptionId(), top, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Returns details of a specific communication in a support ticket. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CommunicationDetailsInner object if successful. + */ + public CommunicationDetailsInner get(String supportTicketName, String communicationName) { + return getWithServiceResponseAsync(supportTicketName, communicationName).toBlocking().single().body(); + } + + /** + * Returns details of a specific communication in a support ticket. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String supportTicketName, String communicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(supportTicketName, communicationName), serviceCallback); + } + + /** + * Returns details of a specific communication in a support ticket. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CommunicationDetailsInner object + */ + public Observable getAsync(String supportTicketName, String communicationName) { + return getWithServiceResponseAsync(supportTicketName, communicationName).map(new Func1, CommunicationDetailsInner>() { + @Override + public CommunicationDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns details of a specific communication in a support ticket. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CommunicationDetailsInner object + */ + public Observable> getWithServiceResponseAsync(String supportTicketName, String communicationName) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (communicationName == null) { + throw new IllegalArgumentException("Parameter communicationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(supportTicketName, communicationName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CommunicationDetailsInner object if successful. + */ + public CommunicationDetailsInner create(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + return createWithServiceResponseAsync(supportTicketName, communicationName, createCommunicationParameters).toBlocking().last().body(); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(supportTicketName, communicationName, createCommunicationParameters), serviceCallback); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + return createWithServiceResponseAsync(supportTicketName, communicationName, createCommunicationParameters).map(new Func1, CommunicationDetailsInner>() { + @Override + public CommunicationDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (communicationName == null) { + throw new IllegalArgumentException("Parameter communicationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (createCommunicationParameters == null) { + throw new IllegalArgumentException("Parameter createCommunicationParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(createCommunicationParameters); + Observable> observable = service.create(supportTicketName, communicationName, this.client.subscriptionId(), createCommunicationParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CommunicationDetailsInner object if successful. + */ + public CommunicationDetailsInner beginCreate(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + return beginCreateWithServiceResponseAsync(supportTicketName, communicationName, createCommunicationParameters).toBlocking().single().body(); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(supportTicketName, communicationName, createCommunicationParameters), serviceCallback); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CommunicationDetailsInner object + */ + public Observable beginCreateAsync(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + return beginCreateWithServiceResponseAsync(supportTicketName, communicationName, createCommunicationParameters).map(new Func1, CommunicationDetailsInner>() { + @Override + public CommunicationDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds a new customer communication to an Azure support ticket. Adding attachments are not currently supported via the API. <br/>To add a file to a support ticket, visit the <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/managesupportrequest'>Manage support ticket</a> page in the Azure portal, select the support ticket, and use the file upload control to add a new file. + * + * @param supportTicketName Support ticket name + * @param communicationName Communication name + * @param createCommunicationParameters Communication object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CommunicationDetailsInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String supportTicketName, String communicationName, CommunicationDetailsInner createCommunicationParameters) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (communicationName == null) { + throw new IllegalArgumentException("Parameter communicationName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (createCommunicationParameters == null) { + throw new IllegalArgumentException("Parameter createCommunicationParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(createCommunicationParameters); + return service.beginCreate(supportTicketName, communicationName, this.client.subscriptionId(), createCommunicationParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CommunicationDetailsInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CommunicationDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CommunicationDetailsInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by <i>CreatedDate</i>�or <i>CommunicationType</i> using the $filter parameter. The only type of communication supported today is <i>Web</i>. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of Communication results. <br/><br/> Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CommunicationDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/IdParsingUtils.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..015d1796d3684 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/MicrosoftSupportImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/MicrosoftSupportImpl.java new file mode 100644 index 0000000000000..671ac2cbbc4ae --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/MicrosoftSupportImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MicrosoftSupportImpl class. + */ +public class MicrosoftSupportImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Azure subscription id. */ + private String subscriptionId; + + /** + * Gets Azure subscription id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Azure subscription id. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftSupportImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Api version. */ + private String apiVersion; + + /** + * Gets Api version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MicrosoftSupportImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MicrosoftSupportImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MicrosoftSupportImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ServicesInner object to access its operations. + */ + private ServicesInner services; + + /** + * Gets the ServicesInner object to access its operations. + * @return the ServicesInner object. + */ + public ServicesInner services() { + return this.services; + } + + /** + * The ProblemClassificationsInner object to access its operations. + */ + private ProblemClassificationsInner problemClassifications; + + /** + * Gets the ProblemClassificationsInner object to access its operations. + * @return the ProblemClassificationsInner object. + */ + public ProblemClassificationsInner problemClassifications() { + return this.problemClassifications; + } + + /** + * The SupportTicketsInner object to access its operations. + */ + private SupportTicketsInner supportTickets; + + /** + * Gets the SupportTicketsInner object to access its operations. + * @return the SupportTicketsInner object. + */ + public SupportTicketsInner supportTickets() { + return this.supportTickets; + } + + /** + * The CommunicationsInner object to access its operations. + */ + private CommunicationsInner communications; + + /** + * Gets the CommunicationsInner object to access its operations. + * @return the CommunicationsInner object. + */ + public CommunicationsInner communications() { + return this.communications; + } + + /** + * Initializes an instance of MicrosoftSupport client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftSupportImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of MicrosoftSupport client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftSupportImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftSupport client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftSupportImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-05-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); + this.problemClassifications = new ProblemClassificationsInner(restClient().retrofit(), this); + this.supportTickets = new SupportTicketsInner(restClient().retrofit(), this); + this.communications = new CommunicationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "MicrosoftSupport", "2019-05-01-preview"); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationImpl.java new file mode 100644 index 0000000000000..aad4c0911b428 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.support.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final SupportManager manager; + OperationImpl(OperationInner inner, SupportManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SupportManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationInner.java new file mode 100644 index 0000000000000..d47f67986e612 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationInner.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The operation supported by Microsoft Support RP. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The object that describes the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the object that describes the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that describes the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..84786427045ad --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.support.Operations; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.support.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final SupportManager manager; + + OperationsImpl(SupportManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public SupportManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsInner.java new file mode 100644 index 0000000000000..4d3947271e290 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/OperationsInner.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.support.ExceptionResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private MicrosoftSupportImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, MicrosoftSupportImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Operations list" }) + @GET("providers/Microsoft.Support/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * This lists all the available Microsoft Support REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<OperationInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * This lists all the available Microsoft Support REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * This lists all the available Microsoft Support REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * This lists all the available Microsoft Support REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl.java new file mode 100644 index 0000000000000..e985e1d0679f1 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl1.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl1.java new file mode 100644 index 0000000000000..80d54d1127e2b --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/PageImpl1.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationImpl.java new file mode 100644 index 0000000000000..6356397bcf2a7 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.ProblemClassification; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; + +class ProblemClassificationImpl extends IndexableRefreshableWrapperImpl implements ProblemClassification { + private final SupportManager manager; + private String serviceName; + private String problemClassificationName; + + ProblemClassificationImpl(ProblemClassificationInner inner, SupportManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.serviceName = IdParsingUtils.getValueFromIdByName(inner.id(), "services"); + this.problemClassificationName = IdParsingUtils.getValueFromIdByName(inner.id(), "problemClassifications"); + } + + @Override + public SupportManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + ProblemClassificationsInner client = this.manager().inner().problemClassifications(); + return client.getAsync(this.serviceName, this.problemClassificationName); + } + + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationInner.java new file mode 100644 index 0000000000000..5d24246976773 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationInner.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * ProblemClassification resource object. + */ +@JsonFlatten +public class ProblemClassificationInner { + /** + * Id of the resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Type of the resource 'Microsoft.Support/problemClassification'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Localized name of problem classification. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get id of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get type of the resource 'Microsoft.Support/problemClassification'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get localized name of problem classification. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized name of problem classification. + * + * @param displayName the displayName value to set + * @return the ProblemClassificationInner object itself. + */ + public ProblemClassificationInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsImpl.java new file mode 100644 index 0000000000000..18711c7279745 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.support.ProblemClassifications; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.support.ProblemClassification; + +class ProblemClassificationsImpl extends WrapperImpl implements ProblemClassifications { + private final SupportManager manager; + + ProblemClassificationsImpl(SupportManager manager) { + super(manager.inner().problemClassifications()); + this.manager = manager; + } + + public SupportManager manager() { + return this.manager; + } + + private ProblemClassificationImpl wrapModel(ProblemClassificationInner inner) { + return new ProblemClassificationImpl(inner, manager()); + } + + @Override + public Observable listAsync(String serviceName) { + ProblemClassificationsInner client = this.inner(); + return client.listAsync(serviceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ProblemClassification call(ProblemClassificationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String serviceName, String problemClassificationName) { + ProblemClassificationsInner client = this.inner(); + return client.getAsync(serviceName, problemClassificationName) + .flatMap(new Func1>() { + @Override + public Observable call(ProblemClassificationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ProblemClassification)wrapModel(inner)); + } + } + }); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsInner.java new file mode 100644 index 0000000000000..85d880ad81519 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ProblemClassificationsInner.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.support.ExceptionResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ProblemClassifications. + */ +public class ProblemClassificationsInner { + /** The Retrofit service to perform REST calls. */ + private ProblemClassificationsService service; + /** The service client containing this operation class. */ + private MicrosoftSupportImpl client; + + /** + * Initializes an instance of ProblemClassificationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ProblemClassificationsInner(Retrofit retrofit, MicrosoftSupportImpl client) { + this.service = retrofit.create(ProblemClassificationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ProblemClassifications to be + * used by Retrofit to perform actually REST calls. + */ + interface ProblemClassificationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.ProblemClassifications list" }) + @GET("providers/Microsoft.Support/services/{serviceName}/problemClassifications") + Observable> list(@Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.ProblemClassifications get" }) + @GET("providers/Microsoft.Support/services/{serviceName}/problemClassifications/{problemClassificationName}") + Observable> get(@Path("serviceName") String serviceName, @Path("problemClassificationName") String problemClassificationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the problem classifications (categories) available for a specific Azure service.<br/><br/> Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @param serviceName Name of Azure service for which the problem classifications need to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<ProblemClassificationInner> object if successful. + */ + public List list(String serviceName) { + return listWithServiceResponseAsync(serviceName).toBlocking().single().body(); + } + + /** + * Lists all the problem classifications (categories) available for a specific Azure service.<br/><br/> Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @param serviceName Name of Azure service for which the problem classifications need to be retrieved. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(String serviceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(serviceName), serviceCallback); + } + + /** + * Lists all the problem classifications (categories) available for a specific Azure service.<br/><br/> Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @param serviceName Name of Azure service for which the problem classifications need to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProblemClassificationInner> object + */ + public Observable> listAsync(String serviceName) { + return listWithServiceResponseAsync(serviceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the problem classifications (categories) available for a specific Azure service.<br/><br/> Always use the service and problem classifications obtained programmatically. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @param serviceName Name of Azure service for which the problem classifications need to be retrieved. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProblemClassificationInner> object + */ + public Observable>> listWithServiceResponseAsync(String serviceName) { + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Gets the details of a specific problem classification for a specific Azure service. + * + * @param serviceName Name of Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProblemClassificationInner object if successful. + */ + public ProblemClassificationInner get(String serviceName, String problemClassificationName) { + return getWithServiceResponseAsync(serviceName, problemClassificationName).toBlocking().single().body(); + } + + /** + * Gets the details of a specific problem classification for a specific Azure service. + * + * @param serviceName Name of Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String serviceName, String problemClassificationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(serviceName, problemClassificationName), serviceCallback); + } + + /** + * Gets the details of a specific problem classification for a specific Azure service. + * + * @param serviceName Name of Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProblemClassificationInner object + */ + public Observable getAsync(String serviceName, String problemClassificationName) { + return getWithServiceResponseAsync(serviceName, problemClassificationName).map(new Func1, ProblemClassificationInner>() { + @Override + public ProblemClassificationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the details of a specific problem classification for a specific Azure service. + * + * @param serviceName Name of Azure service available for support. + * @param problemClassificationName Name of problem classification. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProblemClassificationInner object + */ + public Observable> getWithServiceResponseAsync(String serviceName, String problemClassificationName) { + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (problemClassificationName == null) { + throw new IllegalArgumentException("Parameter problemClassificationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(serviceName, problemClassificationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceImpl.java new file mode 100644 index 0000000000000..217bbffa3bd5a --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.Service; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ServiceImpl extends WrapperImpl implements Service { + private final SupportManager manager; + ServiceImpl(ServiceInner inner, SupportManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public SupportManager manager() { + return this.manager; + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceInner.java new file mode 100644 index 0000000000000..d17b54a518cef --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServiceInner.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Object that represents a Service resource. + */ +@JsonFlatten +public class ServiceInner { + /** + * Id of the resource. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Type of the resource 'Microsoft.Support/services'. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Localized name of Azure service. + */ + @JsonProperty(value = "properties.displayName") + private String displayName; + + /** + * Get id of the resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get type of the resource 'Microsoft.Support/services'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get localized name of Azure service. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set localized name of Azure service. + * + * @param displayName the displayName value to set + * @return the ServiceInner object itself. + */ + public ServiceInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesImpl.java new file mode 100644 index 0000000000000..3f2ba66c0c81a --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesImpl.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.support.Services; +import rx.functions.Func1; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.support.Service; + +class ServicesImpl extends WrapperImpl implements Services { + private final SupportManager manager; + + ServicesImpl(SupportManager manager) { + super(manager.inner().services()); + this.manager = manager; + } + + public SupportManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String serviceName) { + ServicesInner client = this.inner(); + return client.getAsync(serviceName) + .map(new Func1() { + @Override + public Service call(ServiceInner inner) { + return new ServiceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + ServicesInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Service call(ServiceInner inner) { + return new ServiceImpl(inner, manager()); + } + }); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesInner.java new file mode 100644 index 0000000000000..caffbbade1543 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/ServicesInner.java @@ -0,0 +1,215 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.support.ExceptionResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Services. + */ +public class ServicesInner { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private MicrosoftSupportImpl client; + + /** + * Initializes an instance of ServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServicesInner(Retrofit retrofit, MicrosoftSupportImpl client) { + this.service = retrofit.create(ServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Services to be + * used by Retrofit to perform actually REST calls. + */ + interface ServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Services list" }) + @GET("providers/Microsoft.Support/services") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.Services get" }) + @GET("providers/Microsoft.Support/services/{serviceName}") + Observable> get(@Path("serviceName") String serviceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the Azure services available for support ticket creation. Here are the Service Ids for **Billing**, **Subscription Management**, and **Service and subscription limits (Quotas)** issues: <br/><table><tr><td><u>Issue type</u></td><td><u>Service Id</u></td></tr><tr><td>Billing</td><td>'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'</td></tr><tr><td>Subscription Management</td><td>'/providers/Microsoft.Support/services/f3dc5421-79ef-1efa-41a5-42bf3cbb52c6'</td></tr><tr><td>Quota</td><td>'/providers/Microsoft.Support/services/06bfd9d3-516b-d5c6-5802-169c800dec89'</td></tr></table> <br/><br/> For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview'>New support request</a> page. <br/><br/> Always use the service and it's corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException 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<ServiceInner> object if successful. + */ + public List list() { + return listWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Lists all the Azure services available for support ticket creation. Here are the Service Ids for **Billing**, **Subscription Management**, and **Service and subscription limits (Quotas)** issues: <br/><table><tr><td><u>Issue type</u></td><td><u>Service Id</u></td></tr><tr><td>Billing</td><td>'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'</td></tr><tr><td>Subscription Management</td><td>'/providers/Microsoft.Support/services/f3dc5421-79ef-1efa-41a5-42bf3cbb52c6'</td></tr><tr><td>Quota</td><td>'/providers/Microsoft.Support/services/06bfd9d3-516b-d5c6-5802-169c800dec89'</td></tr></table> <br/><br/> For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview'>New support request</a> page. <br/><br/> Always use the service and it's corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Lists all the Azure services available for support ticket creation. Here are the Service Ids for **Billing**, **Subscription Management**, and **Service and subscription limits (Quotas)** issues: <br/><table><tr><td><u>Issue type</u></td><td><u>Service Id</u></td></tr><tr><td>Billing</td><td>'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'</td></tr><tr><td>Subscription Management</td><td>'/providers/Microsoft.Support/services/f3dc5421-79ef-1efa-41a5-42bf3cbb52c6'</td></tr><tr><td>Quota</td><td>'/providers/Microsoft.Support/services/06bfd9d3-516b-d5c6-5802-169c800dec89'</td></tr></table> <br/><br/> For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview'>New support request</a> page. <br/><br/> Always use the service and it's corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the Azure services available for support ticket creation. Here are the Service Ids for **Billing**, **Subscription Management**, and **Service and subscription limits (Quotas)** issues: <br/><table><tr><td><u>Issue type</u></td><td><u>Service Id</u></td></tr><tr><td>Billing</td><td>'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'</td></tr><tr><td>Subscription Management</td><td>'/providers/Microsoft.Support/services/f3dc5421-79ef-1efa-41a5-42bf3cbb52c6'</td></tr><tr><td>Quota</td><td>'/providers/Microsoft.Support/services/06bfd9d3-516b-d5c6-5802-169c800dec89'</td></tr></table> <br/><br/> For **Technical** issues, select the Service Id that maps to the Azure service/product as displayed in the **Services** drop-down list on the Azure portal's <a target='_blank' href='https://portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/overview'>New support request</a> page. <br/><br/> Always use the service and it's corresponding problem classification(s) obtained programmatically for support ticket creation. This practice ensures that you always have the most recent set of service and problem classification Ids. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ServiceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @param serviceName Name of Azure service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceInner object if successful. + */ + public ServiceInner get(String serviceName) { + return getWithServiceResponseAsync(serviceName).toBlocking().single().body(); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @param serviceName Name of Azure service + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(serviceName), serviceCallback); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @param serviceName Name of Azure service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceInner object + */ + public Observable getAsync(String serviceName) { + return getWithServiceResponseAsync(serviceName).map(new Func1, ServiceInner>() { + @Override + public ServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a specific Azure service for support ticket creation. + * + * @param serviceName Name of Azure service + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceInner object + */ + public Observable> getWithServiceResponseAsync(String serviceName) { + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportManager.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportManager.java new file mode 100644 index 0000000000000..5d8ccd2c62216 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportManager.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.support.Operations; +import com.microsoft.azure.management.support.Services; +import com.microsoft.azure.management.support.ProblemClassifications; +import com.microsoft.azure.management.support.SupportTickets; +import com.microsoft.azure.management.support.Communications; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Support resource management. + */ +public final class SupportManager extends ManagerCore { + private Operations operations; + private Services services; + private ProblemClassifications problemClassifications; + private SupportTickets supportTickets; + private Communications communications; + /** + * Get a Configurable instance that can be used to create SupportManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new SupportManager.ConfigurableImpl(); + } + /** + * Creates an instance of SupportManager that exposes Support resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the SupportManager + */ + public static SupportManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new SupportManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of SupportManager that exposes Support resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the SupportManager + */ + public static SupportManager authenticate(RestClient restClient, String subscriptionId) { + return new SupportManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of SupportManager that exposes Support management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing Support management API entry points that work across subscriptions + */ + SupportManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Services. + */ + public Services services() { + if (this.services == null) { + this.services = new ServicesImpl(this); + } + return this.services; + } + + /** + * @return Entry point to manage ProblemClassifications. + */ + public ProblemClassifications problemClassifications() { + if (this.problemClassifications == null) { + this.problemClassifications = new ProblemClassificationsImpl(this); + } + return this.problemClassifications; + } + + /** + * @return Entry point to manage SupportTickets. + */ + public SupportTickets supportTickets() { + if (this.supportTickets == null) { + this.supportTickets = new SupportTicketsImpl(this); + } + return this.supportTickets; + } + + /** + * @return Entry point to manage Communications. + */ + public Communications communications() { + if (this.communications == null) { + this.communications = new CommunicationsImpl(this); + } + return this.communications; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public SupportManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return SupportManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private SupportManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new MicrosoftSupportImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsImpl.java new file mode 100644 index 0000000000000..f9671937da70e --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsImpl.java @@ -0,0 +1,307 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.SupportTicketDetails; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.support.UpdateSupportTicket; +import com.microsoft.azure.management.support.SeverityLevel; +import com.microsoft.azure.management.support.ContactProfile; +import com.microsoft.azure.management.support.ServiceLevelAgreement; +import com.microsoft.azure.management.support.SupportEngineer; +import org.joda.time.DateTime; +import com.microsoft.azure.management.support.TechnicalTicketDetails; +import com.microsoft.azure.management.support.QuotaTicketDetails; +import com.microsoft.azure.management.support.UpdateContactProfile; +import rx.functions.Func1; + +class SupportTicketDetailsImpl extends CreatableUpdatableImpl implements SupportTicketDetails, SupportTicketDetails.Definition, SupportTicketDetails.Update { + private String supportTicketName; + private UpdateSupportTicket updateParameter; + private final SupportManager manager; + + SupportTicketDetailsImpl(String name, SupportManager manager) { + super(name, new SupportTicketDetailsInner()); + this.manager = manager; + // Set resource name + this.supportTicketName = name; + // + this.updateParameter = new UpdateSupportTicket(); + } + + SupportTicketDetailsImpl(SupportTicketDetailsInner inner, SupportManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.supportTicketName = inner.name(); + // set resource ancestor and positional variables + this.supportTicketName = IdParsingUtils.getValueFromIdByName(inner.id(), "supportTickets"); + // set other parameters for create and update + this.updateParameter = new UpdateSupportTicket(); + } + + @Override + public SupportManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SupportTicketsInner client = this.manager().inner().supportTickets(); + return client.createAsync(this.supportTicketName, this.inner()) + .map(new Func1() { + @Override + public SupportTicketDetailsInner call(SupportTicketDetailsInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SupportTicketsInner client = this.manager().inner().supportTickets(); + return client.updateAsync(this.supportTicketName, this.updateParameter) + .map(new Func1() { + @Override + public SupportTicketDetailsInner call(SupportTicketDetailsInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SupportTicketsInner client = this.manager().inner().supportTickets(); + return client.getAsync(this.supportTicketName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new UpdateSupportTicket(); + } + + @Override + public ContactProfile contactDetails() { + return this.inner().contactDetails(); + } + + @Override + public DateTime createdDate() { + return this.inner().createdDate(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String enrollmentId() { + return this.inner().enrollmentId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DateTime modifiedDate() { + return this.inner().modifiedDate(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String problemClassificationDisplayName() { + return this.inner().problemClassificationDisplayName(); + } + + @Override + public String problemClassificationId() { + return this.inner().problemClassificationId(); + } + + @Override + public DateTime problemStartTime() { + return this.inner().problemStartTime(); + } + + @Override + public Boolean productionOutage() { + return this.inner().productionOutage(); + } + + @Override + public QuotaTicketDetails quotaTicketDetails() { + return this.inner().quotaTicketDetails(); + } + + @Override + public Boolean require24X7Response() { + return this.inner().require24X7Response(); + } + + @Override + public String serviceDisplayName() { + return this.inner().serviceDisplayName(); + } + + @Override + public String serviceId() { + return this.inner().serviceId(); + } + + @Override + public ServiceLevelAgreement serviceLevelAgreement() { + return this.inner().serviceLevelAgreement(); + } + + @Override + public SeverityLevel severity() { + return this.inner().severity(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public SupportEngineer supportEngineer() { + return this.inner().supportEngineer(); + } + + @Override + public String supportPlanType() { + return this.inner().supportPlanType(); + } + + @Override + public String supportTicketId() { + return this.inner().supportTicketId(); + } + + @Override + public TechnicalTicketDetails technicalTicketDetails() { + return this.inner().technicalTicketDetails(); + } + + @Override + public String title() { + return this.inner().title(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public SupportTicketDetailsImpl withContactDetails(ContactProfile contactDetails) { + this.inner().withContactDetails(contactDetails); + return this; + } + + @Override + public SupportTicketDetailsImpl withDescription(String description) { + this.inner().withDescription(description); + return this; + } + + @Override + public SupportTicketDetailsImpl withProblemClassificationId(String problemClassificationId) { + this.inner().withProblemClassificationId(problemClassificationId); + return this; + } + + @Override + public SupportTicketDetailsImpl withServiceId(String serviceId) { + this.inner().withServiceId(serviceId); + return this; + } + + @Override + public SupportTicketDetailsImpl withTitle(String title) { + this.inner().withTitle(title); + return this; + } + + @Override + public SupportTicketDetailsImpl withProblemStartTime(DateTime problemStartTime) { + this.inner().withProblemStartTime(problemStartTime); + return this; + } + + @Override + public SupportTicketDetailsImpl withQuotaTicketDetails(QuotaTicketDetails quotaTicketDetails) { + this.inner().withQuotaTicketDetails(quotaTicketDetails); + return this; + } + + @Override + public SupportTicketDetailsImpl withRequire24X7Response(Boolean require24X7Response) { + this.inner().withRequire24X7Response(require24X7Response); + return this; + } + + @Override + public SupportTicketDetailsImpl withServiceLevelAgreement(ServiceLevelAgreement serviceLevelAgreement) { + this.inner().withServiceLevelAgreement(serviceLevelAgreement); + return this; + } + + @Override + public SupportTicketDetailsImpl withSupportEngineer(SupportEngineer supportEngineer) { + this.inner().withSupportEngineer(supportEngineer); + return this; + } + + @Override + public SupportTicketDetailsImpl withSupportTicketId(String supportTicketId) { + this.inner().withSupportTicketId(supportTicketId); + return this; + } + + @Override + public SupportTicketDetailsImpl withTechnicalTicketDetails(TechnicalTicketDetails technicalTicketDetails) { + this.inner().withTechnicalTicketDetails(technicalTicketDetails); + return this; + } + + @Override + public SupportTicketDetailsImpl withContactDetails(UpdateContactProfile contactDetails) { + this.updateParameter.withContactDetails(contactDetails); + return this; + } + + @Override + public SupportTicketDetailsImpl withSeverity(SeverityLevel severity) { + if (isInCreateMode()) { + this.inner().withSeverity(severity); + } else { + this.updateParameter.withSeverity(severity); + } + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsInner.java new file mode 100644 index 0000000000000..fb7866836d420 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketDetailsInner.java @@ -0,0 +1,494 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.management.support.SeverityLevel; +import com.microsoft.azure.management.support.ContactProfile; +import com.microsoft.azure.management.support.ServiceLevelAgreement; +import com.microsoft.azure.management.support.SupportEngineer; +import org.joda.time.DateTime; +import com.microsoft.azure.management.support.TechnicalTicketDetails; +import com.microsoft.azure.management.support.QuotaTicketDetails; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Object that represents SupportTicketDetails resource. + */ +@JsonFlatten +public class SupportTicketDetailsInner extends ProxyResource { + /** + * 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", required = true) + private String description; + + /** + * Each Azure service has its own set of issue category called problem + * classification that corresponds to the type of problem you're + * experiencing. This parameter is the resource id of ProblemClassification + * resource. + */ + @JsonProperty(value = "properties.problemClassificationId", required = true) + 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. Possible values include: + * 'minimal', 'moderate', 'critical'. + */ + @JsonProperty(value = "properties.severity", required = true) + 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 issue is a production outage. + */ + @JsonProperty(value = "properties.productionOutage", access = JsonProperty.Access.WRITE_ONLY) + private Boolean productionOutage; + + /** + * 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", required = true) + private ContactProfile contactDetails; + + /** + * Service Level Agreement information for this support ticket. + */ + @JsonProperty(value = "properties.serviceLevelAgreement") + private ServiceLevelAgreement serviceLevelAgreement; + + /** + * Information about 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", required = true) + private String title; + + /** + * Time in UTC (ISO 8601 format) when the problem started. + */ + @JsonProperty(value = "properties.problemStartTime") + private DateTime problemStartTime; + + /** + * This is the resource id of the Azure service resource associated with + * the support ticket. + */ + @JsonProperty(value = "properties.serviceId", required = true) + private String serviceId; + + /** + * Localized name of 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; + + /** + * Time in UTC (ISO 8601 format) when support ticket was created. + */ + @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime createdDate; + + /** + * Time in UTC (ISO 8601 format) when support ticket was last modified. + */ + @JsonProperty(value = "properties.modifiedDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime 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. + */ + @JsonProperty(value = "properties.quotaTicketDetails") + private QuotaTicketDetails quotaTicketDetails; + + /** + * Get system generated support ticket id that is unique. + * + * @return the supportTicketId value + */ + public String supportTicketId() { + return this.supportTicketId; + } + + /** + * Set system generated support ticket id that is unique. + * + * @param supportTicketId the supportTicketId value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withSupportTicketId(String supportTicketId) { + this.supportTicketId = supportTicketId; + return this; + } + + /** + * Get detailed description of the question or issue. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set detailed description of the question or issue. + * + * @param description the description value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get each Azure service has its own set of issue category called problem classification that corresponds to the type of problem you're experiencing. This parameter is the resource id of ProblemClassification resource. + * + * @return the problemClassificationId value + */ + public String problemClassificationId() { + return this.problemClassificationId; + } + + /** + * Set each Azure service has its own set of issue category called problem classification that corresponds to the type of problem you're experiencing. This parameter is the resource id of ProblemClassification resource. + * + * @param problemClassificationId the problemClassificationId value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withProblemClassificationId(String problemClassificationId) { + this.problemClassificationId = problemClassificationId; + return this; + } + + /** + * Get localized name of problem classification. + * + * @return the problemClassificationDisplayName value + */ + public String problemClassificationDisplayName() { + return this.problemClassificationDisplayName; + } + + /** + * Get 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. Possible values include: 'minimal', 'moderate', 'critical'. + * + * @return the severity value + */ + public SeverityLevel severity() { + return this.severity; + } + + /** + * Set 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. Possible values include: 'minimal', 'moderate', 'critical'. + * + * @param severity the severity value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withSeverity(SeverityLevel severity) { + this.severity = severity; + return this; + } + + /** + * Get enrollment ID associated with the support ticket. + * + * @return the enrollmentId value + */ + public String enrollmentId() { + return this.enrollmentId; + } + + /** + * Get indicates if this issue is a production outage. + * + * @return the productionOutage value + */ + public Boolean productionOutage() { + return this.productionOutage; + } + + /** + * Get indicates if this requires a 24x7 response from Azure. + * + * @return the require24X7Response value + */ + public Boolean require24X7Response() { + return this.require24X7Response; + } + + /** + * Set indicates if this requires a 24x7 response from Azure. + * + * @param require24X7Response the require24X7Response value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withRequire24X7Response(Boolean require24X7Response) { + this.require24X7Response = require24X7Response; + return this; + } + + /** + * Get contact information of the user requesting to create a support ticket. + * + * @return the contactDetails value + */ + public ContactProfile contactDetails() { + return this.contactDetails; + } + + /** + * Set contact information of the user requesting to create a support ticket. + * + * @param contactDetails the contactDetails value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withContactDetails(ContactProfile contactDetails) { + this.contactDetails = contactDetails; + return this; + } + + /** + * Get service Level Agreement information for this support ticket. + * + * @return the serviceLevelAgreement value + */ + public ServiceLevelAgreement serviceLevelAgreement() { + return this.serviceLevelAgreement; + } + + /** + * Set service Level Agreement information for this support ticket. + * + * @param serviceLevelAgreement the serviceLevelAgreement value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withServiceLevelAgreement(ServiceLevelAgreement serviceLevelAgreement) { + this.serviceLevelAgreement = serviceLevelAgreement; + return this; + } + + /** + * Get information about support engineer working on this support ticket. + * + * @return the supportEngineer value + */ + public SupportEngineer supportEngineer() { + return this.supportEngineer; + } + + /** + * Set information about support engineer working on this support ticket. + * + * @param supportEngineer the supportEngineer value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withSupportEngineer(SupportEngineer supportEngineer) { + this.supportEngineer = supportEngineer; + return this; + } + + /** + * Get support plan type associated with the support ticket. + * + * @return the supportPlanType value + */ + public String supportPlanType() { + return this.supportPlanType; + } + + /** + * Get title of the support ticket. + * + * @return the title value + */ + public String title() { + return this.title; + } + + /** + * Set title of the support ticket. + * + * @param title the title value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withTitle(String title) { + this.title = title; + return this; + } + + /** + * Get time in UTC (ISO 8601 format) when the problem started. + * + * @return the problemStartTime value + */ + public DateTime problemStartTime() { + return this.problemStartTime; + } + + /** + * Set time in UTC (ISO 8601 format) when the problem started. + * + * @param problemStartTime the problemStartTime value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withProblemStartTime(DateTime problemStartTime) { + this.problemStartTime = problemStartTime; + return this; + } + + /** + * Get 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 this is the resource id of the Azure service resource associated with the support ticket. + * + * @param serviceId the serviceId value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withServiceId(String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Get localized name of Azure service. + * + * @return the serviceDisplayName value + */ + public String serviceDisplayName() { + return this.serviceDisplayName; + } + + /** + * Get status of the support ticket. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Get time in UTC (ISO 8601 format) when support ticket was created. + * + * @return the createdDate value + */ + public DateTime createdDate() { + return this.createdDate; + } + + /** + * Get time in UTC (ISO 8601 format) when support ticket was last modified. + * + * @return the modifiedDate value + */ + public DateTime modifiedDate() { + return this.modifiedDate; + } + + /** + * Get additional ticket details associated with a technical support ticket request. + * + * @return the technicalTicketDetails value + */ + public TechnicalTicketDetails technicalTicketDetails() { + return this.technicalTicketDetails; + } + + /** + * Set additional ticket details associated with a technical support ticket request. + * + * @param technicalTicketDetails the technicalTicketDetails value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withTechnicalTicketDetails(TechnicalTicketDetails technicalTicketDetails) { + this.technicalTicketDetails = technicalTicketDetails; + return this; + } + + /** + * Get additional ticket details associated with a quota support ticket request. + * + * @return the quotaTicketDetails value + */ + public QuotaTicketDetails quotaTicketDetails() { + return this.quotaTicketDetails; + } + + /** + * Set additional ticket details associated with a quota support ticket request. + * + * @param quotaTicketDetails the quotaTicketDetails value to set + * @return the SupportTicketDetailsInner object itself. + */ + public SupportTicketDetailsInner withQuotaTicketDetails(QuotaTicketDetails quotaTicketDetails) { + this.quotaTicketDetails = quotaTicketDetails; + return this; + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsImpl.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsImpl.java new file mode 100644 index 0000000000000..9139a782fe04c --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsImpl.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * jkl + */ + +package com.microsoft.azure.management.support.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.support.SupportTickets; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.support.SupportTicketDetails; +import com.microsoft.azure.management.support.CheckNameAvailabilityOutput; +import com.microsoft.azure.management.support.CheckNameAvailabilityInput; +import com.microsoft.azure.arm.utils.PagedListConverter; + +class SupportTicketsImpl extends WrapperImpl implements SupportTickets { + private PagedListConverter converter; + private final SupportManager manager; + + SupportTicketsImpl(SupportManager manager) { + super(manager.inner().supportTickets()); + this.manager = manager; + this.converter = new PagedListConverter() { + @Override + public Observable typeConvertAsync(SupportTicketDetailsInner inner) { + return Observable.just((SupportTicketDetails) wrapModel(inner)); + } + }; + } + + public SupportManager manager() { + return this.manager; + } + + @Override + public SupportTicketDetailsImpl define(String name) { + return wrapModel(name); + } + + private SupportTicketDetailsImpl wrapModel(SupportTicketDetailsInner inner) { + return new SupportTicketDetailsImpl(inner, manager()); + } + + private SupportTicketDetailsImpl wrapModel(String name) { + return new SupportTicketDetailsImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String supportTicketName) { + SupportTicketsInner client = this.inner(); + return client.getAsync(supportTicketName) + .map(new Func1() { + @Override + public SupportTicketDetails call(SupportTicketDetailsInner inner) { + return new SupportTicketDetailsImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + SupportTicketsInner client = this.inner(); + return client.checkNameAvailabilityAsync(checkNameAvailabilityInput) + .map(new Func1() { + @Override + public CheckNameAvailabilityOutput call(CheckNameAvailabilityOutputInner inner) { + return new CheckNameAvailabilityOutputImpl(inner, manager()); + } + }); + } + + @Override + public PagedList list() { + SupportTicketsInner client = this.inner(); + return converter.convert(client.list()); + } + + @Override + public Observable listAsync() { + SupportTicketsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public SupportTicketDetails call(SupportTicketDetailsInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsInner.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsInner.java new file mode 100644 index 0000000000000..3d05910a0d820 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/SupportTicketsInner.java @@ -0,0 +1,831 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.support.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.support.CheckNameAvailabilityInput; +import com.microsoft.azure.management.support.ExceptionResponseException; +import com.microsoft.azure.management.support.UpdateSupportTicket; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SupportTickets. + */ +public class SupportTicketsInner { + /** The Retrofit service to perform REST calls. */ + private SupportTicketsService service; + /** The service client containing this operation class. */ + private MicrosoftSupportImpl client; + + /** + * Initializes an instance of SupportTicketsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SupportTicketsInner(Retrofit retrofit, MicrosoftSupportImpl client) { + this.service = retrofit.create(SupportTicketsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SupportTickets to be + * used by Retrofit to perform actually REST calls. + */ + interface SupportTicketsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.Support/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Body CheckNameAvailabilityInput checkNameAvailabilityInput, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("$top") Integer top, @Query("$filter") String filter, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + Observable> get(@Path("supportTicketName") String supportTicketName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets update" }) + @PATCH("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + Observable> update(@Path("supportTicketName") String supportTicketName, @Path("subscriptionId") String subscriptionId, @Body UpdateSupportTicket updateSupportTicket, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets create" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + Observable> create(@Path("supportTicketName") String supportTicketName, @Path("subscriptionId") String subscriptionId, @Body SupportTicketDetailsInner createSupportTicketParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets beginCreate" }) + @PUT("subscriptions/{subscriptionId}/providers/Microsoft.Support/supportTickets/{supportTicketName}") + Observable> beginCreate(@Path("supportTicketName") String supportTicketName, @Path("subscriptionId") String subscriptionId, @Body SupportTicketDetailsInner createSupportTicketParameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.support.SupportTickets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameAvailabilityOutputInner object if successful. + */ + public CheckNameAvailabilityOutputInner checkNameAvailability(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithServiceResponseAsync(checkNameAvailabilityInput).toBlocking().single().body(); + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput Input to check. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(checkNameAvailabilityInput), serviceCallback); + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable checkNameAvailabilityAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + return checkNameAvailabilityWithServiceResponseAsync(checkNameAvailabilityInput).map(new Func1, CheckNameAvailabilityOutputInner>() { + @Override + public CheckNameAvailabilityOutputInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Check the availability of a resource name. This API should to be used to check the uniqueness of the name for support ticket creation for the selected subscription. + * + * @param checkNameAvailabilityInput Input to check. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameAvailabilityOutputInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(CheckNameAvailabilityInput checkNameAvailabilityInput) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (checkNameAvailabilityInput == null) { + throw new IllegalArgumentException("Parameter checkNameAvailabilityInput is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(checkNameAvailabilityInput); + return service.checkNameAvailability(this.client.subscriptionId(), checkNameAvailabilityInput, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SupportTicketDetailsInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SupportTicketDetailsInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SupportTicketDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SupportTicketDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Integer top = null; + final String filter = null; + return service.list(this.client.subscriptionId(), top, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> <br/><i>Status</i> filter can only be used with 'eq' operator. For <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, combine them using the logical 'AND'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SupportTicketDetailsInner> object if successful. + */ + public PagedList list(final Integer top, final String filter) { + ServiceResponse> response = listSinglePageAsync(top, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> <br/><i>Status</i> filter can only be used with 'eq' operator. For <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, combine them using the logical 'AND'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final Integer top, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(top, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> <br/><i>Status</i> filter can only be used with 'eq' operator. For <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, combine them using the logical 'AND'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SupportTicketDetailsInner> object + */ + public Observable> listAsync(final Integer top, final String filter) { + return listWithServiceResponseAsync(top, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param top The number of values to return in the collection. Default is 25 and max is 100. + * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> <br/><i>Status</i> filter can only be used with 'eq' operator. For <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, combine them using the logical 'AND'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SupportTicketDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync(final Integer top, final String filter) { + return listSinglePageAsync(top, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + ServiceResponse> * @param top The number of values to return in the collection. Default is 25 and max is 100. + ServiceResponse> * @param filter The filter to apply on the operation. We support 'odata v4.0' filter semantics. <a target='_blank' href='https://docs.microsoft.com/odata/concepts/queryoptions-overview'>Learn more</a> <br/><i>Status</i> filter can only be used with 'eq' operator. For <i>CreatedDate</i> filter, the supported operators are 'gt' and 'ge'. When using both filters, combine them using the logical 'AND'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SupportTicketDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final Integer top, final String filter) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), top, filter, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Gets details for a specific support ticket in an Azure subscription. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SupportTicketDetailsInner object if successful. + */ + public SupportTicketDetailsInner get(String supportTicketName) { + return getWithServiceResponseAsync(supportTicketName).toBlocking().single().body(); + } + + /** + * Gets details for a specific support ticket in an Azure subscription. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String supportTicketName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(supportTicketName), serviceCallback); + } + + /** + * Gets details for a specific support ticket in an Azure subscription. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportTicketDetailsInner object + */ + public Observable getAsync(String supportTicketName) { + return getWithServiceResponseAsync(supportTicketName).map(new Func1, SupportTicketDetailsInner>() { + @Override + public SupportTicketDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets details for a specific support ticket in an Azure subscription. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param supportTicketName Support ticket name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportTicketDetailsInner object + */ + public Observable> getWithServiceResponseAsync(String supportTicketName) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(supportTicketName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * This API allows you to update the severity level or your contact information in the support ticket. <br/><br/> Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API. + * + * @param supportTicketName Support ticket name + * @param updateSupportTicket UpdateSupportTicket object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SupportTicketDetailsInner object if successful. + */ + public SupportTicketDetailsInner update(String supportTicketName, UpdateSupportTicket updateSupportTicket) { + return updateWithServiceResponseAsync(supportTicketName, updateSupportTicket).toBlocking().single().body(); + } + + /** + * This API allows you to update the severity level or your contact information in the support ticket. <br/><br/> Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API. + * + * @param supportTicketName Support ticket name + * @param updateSupportTicket UpdateSupportTicket object + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String supportTicketName, UpdateSupportTicket updateSupportTicket, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(supportTicketName, updateSupportTicket), serviceCallback); + } + + /** + * This API allows you to update the severity level or your contact information in the support ticket. <br/><br/> Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API. + * + * @param supportTicketName Support ticket name + * @param updateSupportTicket UpdateSupportTicket object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportTicketDetailsInner object + */ + public Observable updateAsync(String supportTicketName, UpdateSupportTicket updateSupportTicket) { + return updateWithServiceResponseAsync(supportTicketName, updateSupportTicket).map(new Func1, SupportTicketDetailsInner>() { + @Override + public SupportTicketDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * This API allows you to update the severity level or your contact information in the support ticket. <br/><br/> Note: The severity levels cannot be changed if a support ticket is actively being worked upon by an Azure support engineer. In such a case, contact your support engineer to request severity update by adding a new communication using the Communications API. + * + * @param supportTicketName Support ticket name + * @param updateSupportTicket UpdateSupportTicket object + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportTicketDetailsInner object + */ + public Observable> updateWithServiceResponseAsync(String supportTicketName, UpdateSupportTicket updateSupportTicket) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (updateSupportTicket == null) { + throw new IllegalArgumentException("Parameter updateSupportTicket is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(updateSupportTicket); + return service.update(supportTicketName, this.client.subscriptionId(), updateSupportTicket, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SupportTicketDetailsInner object if successful. + */ + public SupportTicketDetailsInner create(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + return createWithServiceResponseAsync(supportTicketName, createSupportTicketParameters).toBlocking().last().body(); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(supportTicketName, createSupportTicketParameters), serviceCallback); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + return createWithServiceResponseAsync(supportTicketName, createSupportTicketParameters).map(new Func1, SupportTicketDetailsInner>() { + @Override + public SupportTicketDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (createSupportTicketParameters == null) { + throw new IllegalArgumentException("Parameter createSupportTicketParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(createSupportTicketParameters); + Observable> observable = service.create(supportTicketName, this.client.subscriptionId(), createSupportTicketParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SupportTicketDetailsInner object if successful. + */ + public SupportTicketDetailsInner beginCreate(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + return beginCreateWithServiceResponseAsync(supportTicketName, createSupportTicketParameters).toBlocking().single().body(); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(supportTicketName, createSupportTicketParameters), serviceCallback); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportTicketDetailsInner object + */ + public Observable beginCreateAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + return beginCreateWithServiceResponseAsync(supportTicketName, createSupportTicketParameters).map(new Func1, SupportTicketDetailsInner>() { + @Override + public SupportTicketDetailsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new support ticket for Quota increase, Technical, Billing, and Subscription Management issues for the specified subscription. <br/><br/>A paid technical support plan is required to create a support ticket using this API. <a href='https://aka.ms/supportticketAPI'>Learn more</a> <br/><br/> Use the Services API to map the right Service Id to the issue type. For example: For billing tickets set *serviceId* to *'/providers/Microsoft.Support/services/517f2da6-78fd-0498-4e22-ad26996b1dfc'*. <br/> For Technical issues, the Service id will map to the Azure service you want to raise a support ticket for. <br/><br/>Always call the Services and ProblemClassifications API to get the most recent set of services and problem categories required for support ticket creation. + * + * @param supportTicketName Support ticket name. + * @param createSupportTicketParameters Support ticket request payload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SupportTicketDetailsInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String supportTicketName, SupportTicketDetailsInner createSupportTicketParameters) { + if (supportTicketName == null) { + throw new IllegalArgumentException("Parameter supportTicketName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (createSupportTicketParameters == null) { + throw new IllegalArgumentException("Parameter createSupportTicketParameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(createSupportTicketParameters); + return service.beginCreate(supportTicketName, this.client.subscriptionId(), createSupportTicketParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ExceptionResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<SupportTicketDetailsInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SupportTicketDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SupportTicketDetailsInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the support tickets for an Azure subscription. <br/><br/>You can also filter the support tickets by <i>Status</i> or <i>CreatedDate</i> using the $filter parameter. Output will be a paged result with <i>nextLink</i>, using which you can retrieve the next set of support tickets. <br/><br/>Support ticket data is available for 12 months after ticket creation. If a ticket was created more than 12 months ago, a request for data might cause an error. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SupportTicketDetailsInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ExceptionResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ExceptionResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ExceptionResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/package-info.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/package-info.java new file mode 100644 index 0000000000000..68741ddcd02ec --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for MicrosoftSupport. + * Microsoft Azure Support Resource Provider. + */ +package com.microsoft.azure.management.support.implementation; diff --git a/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/package-info.java b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/package-info.java new file mode 100644 index 0000000000000..8b8c8d7490829 --- /dev/null +++ b/azure-mgmt-support/src/main/java/com/microsoft/azure/management/support/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for MicrosoftSupport. + * Microsoft Azure Support Resource Provider. + */ +package com.microsoft.azure.management.support;