diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/Disk.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/Disk.java new file mode 100644 index 00000000000..7a520b5d407 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/Disk.java @@ -0,0 +1,86 @@ +/** + * 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.hanaonazure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the disk information fo the HANA instance. + */ +public class Disk { + /** + * The disk name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Specifies the size of an empty data disk in gigabytes. + */ + @JsonProperty(value = "diskSizeGB") + private Integer diskSizeGB; + + /** + * Specifies the logical unit number of the data disk. This value is used + * to identify data disks within the VM and therefore must be unique for + * each data disk attached to a VM. + */ + @JsonProperty(value = "lun", access = JsonProperty.Access.WRITE_ONLY) + private Integer lun; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Disk object itself. + */ + public Disk withName(String name) { + this.name = name; + return this; + } + + /** + * Get the diskSizeGB value. + * + * @return the diskSizeGB value + */ + public Integer diskSizeGB() { + return this.diskSizeGB; + } + + /** + * Set the diskSizeGB value. + * + * @param diskSizeGB the diskSizeGB value to set + * @return the Disk object itself. + */ + public Disk withDiskSizeGB(Integer diskSizeGB) { + this.diskSizeGB = diskSizeGB; + return this; + } + + /** + * Get the lun value. + * + * @return the lun value + */ + public Integer lun() { + return this.lun; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/Display.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/Display.java new file mode 100644 index 00000000000..a071b30414b --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/Display.java @@ -0,0 +1,104 @@ +/** + * 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.hanaonazure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Detailed HANA operation information. + */ +public class Display { + /** + * The localized friendly form of the resource provider name. This form is + * also expected to include the publisher/company responsible. Use Title + * Casing. Begin with “Microsoft” for 1st party services. + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /** + * The localized friendly form of the resource type related to this + * action/operation. This form should match the public documentation for + * the resource provider. Use Title Casing. For examples, refer to the + * “name” section. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private String resource; + + /** + * The localized friendly name for the operation as shown to the user. This + * name should be concise (to fit in drop downs), but clear + * (self-documenting). Use Title Casing and include the entity/resource to + * which it applies. + */ + @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) + private String operation; + + /** + * The localized friendly description for the operation as shown to the + * user. This description should be thorough, yet concise. It will be used + * in tool-tips and detailed views. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is + * 'user,system'. + */ + @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) + private String origin; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the origin value. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/ErrorResponse.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/ErrorResponse.java new file mode 100644 index 00000000000..294d1caf01c --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/ErrorResponse.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.hanaonazure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the format of Error response. + */ +public class ErrorResponse { + /** + * Error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * Error message indicating why the operation failed. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/ErrorResponseException.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/ErrorResponseException.java new file mode 100644 index 00000000000..fdab0296684 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/ErrorResponseException.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.hanaonazure; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HanaHardwareTypeNamesEnum.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HanaHardwareTypeNamesEnum.java new file mode 100644 index 00000000000..8a7d1e275f7 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HanaHardwareTypeNamesEnum.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.hanaonazure; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HanaHardwareTypeNamesEnum. + */ +public final class HanaHardwareTypeNamesEnum extends ExpandableStringEnum { + /** Static value Cisco_UCS for HanaHardwareTypeNamesEnum. */ + public static final HanaHardwareTypeNamesEnum CISCO_UCS = fromString("Cisco_UCS"); + + /** Static value HPE for HanaHardwareTypeNamesEnum. */ + public static final HanaHardwareTypeNamesEnum HPE = fromString("HPE"); + + /** + * Creates or finds a HanaHardwareTypeNamesEnum from its string representation. + * @param name a name to look for + * @return the corresponding HanaHardwareTypeNamesEnum + */ + @JsonCreator + public static HanaHardwareTypeNamesEnum fromString(String name) { + return fromString(name, HanaHardwareTypeNamesEnum.class); + } + + /** + * @return known HanaHardwareTypeNamesEnum values + */ + public static Collection values() { + return values(HanaHardwareTypeNamesEnum.class); + } +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HanaInstanceSizeNamesEnum.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HanaInstanceSizeNamesEnum.java new file mode 100644 index 00000000000..5be1c10abd4 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HanaInstanceSizeNamesEnum.java @@ -0,0 +1,71 @@ +/** + * 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.hanaonazure; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HanaInstanceSizeNamesEnum. + */ +public final class HanaInstanceSizeNamesEnum extends ExpandableStringEnum { + /** Static value S72m for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S72M = fromString("S72m"); + + /** Static value S144m for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S144M = fromString("S144m"); + + /** Static value S72 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S72 = fromString("S72"); + + /** Static value S144 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S144 = fromString("S144"); + + /** Static value S192 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S192 = fromString("S192"); + + /** Static value S192m for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S192M = fromString("S192m"); + + /** Static value S384 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S384 = fromString("S384"); + + /** Static value S384m for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S384M = fromString("S384m"); + + /** Static value S384xm for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S384XM = fromString("S384xm"); + + /** Static value S576 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S576 = fromString("S576"); + + /** Static value S768 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S768 = fromString("S768"); + + /** Static value S960 for HanaInstanceSizeNamesEnum. */ + public static final HanaInstanceSizeNamesEnum S960 = fromString("S960"); + + /** + * Creates or finds a HanaInstanceSizeNamesEnum from its string representation. + * @param name a name to look for + * @return the corresponding HanaInstanceSizeNamesEnum + */ + @JsonCreator + public static HanaInstanceSizeNamesEnum fromString(String name) { + return fromString(name, HanaInstanceSizeNamesEnum.class); + } + + /** + * @return known HanaInstanceSizeNamesEnum values + */ + public static Collection values() { + return values(HanaInstanceSizeNamesEnum.class); + } +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HardwareProfile.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HardwareProfile.java new file mode 100644 index 00000000000..778bd81a646 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/HardwareProfile.java @@ -0,0 +1,50 @@ +/** + * 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.hanaonazure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the hardware settings for the HANA instance. + */ +public class HardwareProfile { + /** + * Name of the hardware type (vendor and/or their product name). Possible + * values include: 'Cisco_UCS', 'HPE'. + */ + @JsonProperty(value = "hardwareType", access = JsonProperty.Access.WRITE_ONLY) + private HanaHardwareTypeNamesEnum hardwareType; + + /** + * Specifies the HANA instance SKU. Possible values include: 'S72m', + * 'S144m', 'S72', 'S144', 'S192', 'S192m', 'S384', 'S384m', 'S384xm', + * 'S576', 'S768', 'S960'. + */ + @JsonProperty(value = "hanaInstanceSize", access = JsonProperty.Access.WRITE_ONLY) + private HanaInstanceSizeNamesEnum hanaInstanceSize; + + /** + * Get the hardwareType value. + * + * @return the hardwareType value + */ + public HanaHardwareTypeNamesEnum hardwareType() { + return this.hardwareType; + } + + /** + * Get the hanaInstanceSize value. + * + * @return the hanaInstanceSize value + */ + public HanaInstanceSizeNamesEnum hanaInstanceSize() { + return this.hanaInstanceSize; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/IpAddress.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/IpAddress.java new file mode 100644 index 00000000000..eb32cfe8aa9 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/IpAddress.java @@ -0,0 +1,32 @@ +/** + * 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.hanaonazure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the IP address of the network interaface. + */ +public class IpAddress { + /** + * Specifies the IP address of the network interface. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * Get the ipAddress value. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/NetworkProfile.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/NetworkProfile.java new file mode 100644 index 00000000000..d521e48eecb --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/NetworkProfile.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.hanaonazure; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the network settings for the HANA instance disks. + */ +public class NetworkProfile { + /** + * Specifies the network interfaces for the HANA instance. + */ + @JsonProperty(value = "networkInterfaces") + private List networkInterfaces; + + /** + * Specifies the circuit id for connecting to express route. + */ + @JsonProperty(value = "circuitId", access = JsonProperty.Access.WRITE_ONLY) + private String circuitId; + + /** + * Get the networkInterfaces value. + * + * @return the networkInterfaces value + */ + public List networkInterfaces() { + return this.networkInterfaces; + } + + /** + * Set the networkInterfaces value. + * + * @param networkInterfaces the networkInterfaces value to set + * @return the NetworkProfile object itself. + */ + public NetworkProfile withNetworkInterfaces(List networkInterfaces) { + this.networkInterfaces = networkInterfaces; + return this; + } + + /** + * Get the circuitId value. + * + * @return the circuitId value + */ + public String circuitId() { + return this.circuitId; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/OSProfile.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/OSProfile.java new file mode 100644 index 00000000000..efcf880f14c --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/OSProfile.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.hanaonazure; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the operating system settings for the HANA instance. + */ +public class OSProfile { + /** + * Specifies the host OS name of the HANA instance. + */ + @JsonProperty(value = "computerName", access = JsonProperty.Access.WRITE_ONLY) + private String computerName; + + /** + * This property allows you to specify the type of the OS. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /** + * Specifies version of operating system. + */ + @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Get the computerName value. + * + * @return the computerName value + */ + public String computerName() { + return this.computerName; + } + + /** + * Get the osType value. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Get the version value. + * + * @return the version value + */ + public String version() { + return this.version; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/StorageProfile.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/StorageProfile.java new file mode 100644 index 00000000000..6b4a576016d --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/StorageProfile.java @@ -0,0 +1,60 @@ +/** + * 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.hanaonazure; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifies the storage settings for the HANA instance disks. + */ +public class StorageProfile { + /** + * IP Address to connect to storage. + */ + @JsonProperty(value = "nfsIpAddress", access = JsonProperty.Access.WRITE_ONLY) + private String nfsIpAddress; + + /** + * Specifies information about the operating system disk used by the hana + * instance. + */ + @JsonProperty(value = "osDisks") + private List osDisks; + + /** + * Get the nfsIpAddress value. + * + * @return the nfsIpAddress value + */ + public String nfsIpAddress() { + return this.nfsIpAddress; + } + + /** + * Get the osDisks value. + * + * @return the osDisks value + */ + public List osDisks() { + return this.osDisks; + } + + /** + * Set the osDisks value. + * + * @param osDisks the osDisks value to set + * @return the StorageProfile object itself. + */ + public StorageProfile withOsDisks(List osDisks) { + this.osDisks = osDisks; + return this; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaInstanceInner.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaInstanceInner.java new file mode 100644 index 00000000000..a6a67945733 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaInstanceInner.java @@ -0,0 +1,145 @@ +/** + * 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.hanaonazure.implementation; + +import com.microsoft.azure.management.hanaonazure.HardwareProfile; +import com.microsoft.azure.management.hanaonazure.StorageProfile; +import com.microsoft.azure.management.hanaonazure.OSProfile; +import com.microsoft.azure.management.hanaonazure.NetworkProfile; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * HANA instance info on Azure (ARM properties and HANA properties). + */ +@JsonFlatten +@SkipParentValidation +public class HanaInstanceInner extends Resource { + /** + * Specifies the hardware settings for the HANA instance. + */ + @JsonProperty(value = "properties.hardwareProfile") + private HardwareProfile hardwareProfile; + + /** + * Specifies the storage settings for the HANA instance disks. + */ + @JsonProperty(value = "properties.storageProfile") + private StorageProfile storageProfile; + + /** + * Specifies the operating system settings for the HANA instance. + */ + @JsonProperty(value = "properties.osProfile") + private OSProfile osProfile; + + /** + * Specifies the network settings for the HANA instance. + */ + @JsonProperty(value = "properties.networkProfile") + private NetworkProfile networkProfile; + + /** + * Specifies the HANA instance unique ID. + */ + @JsonProperty(value = "properties.hanaInstanceId", access = JsonProperty.Access.WRITE_ONLY) + private String hanaInstanceId; + + /** + * Get the hardwareProfile value. + * + * @return the hardwareProfile value + */ + public HardwareProfile hardwareProfile() { + return this.hardwareProfile; + } + + /** + * Set the hardwareProfile value. + * + * @param hardwareProfile the hardwareProfile value to set + * @return the HanaInstanceInner object itself. + */ + public HanaInstanceInner withHardwareProfile(HardwareProfile hardwareProfile) { + this.hardwareProfile = hardwareProfile; + return this; + } + + /** + * Get the storageProfile value. + * + * @return the storageProfile value + */ + public StorageProfile storageProfile() { + return this.storageProfile; + } + + /** + * Set the storageProfile value. + * + * @param storageProfile the storageProfile value to set + * @return the HanaInstanceInner object itself. + */ + public HanaInstanceInner withStorageProfile(StorageProfile storageProfile) { + this.storageProfile = storageProfile; + return this; + } + + /** + * Get the osProfile value. + * + * @return the osProfile value + */ + public OSProfile osProfile() { + return this.osProfile; + } + + /** + * Set the osProfile value. + * + * @param osProfile the osProfile value to set + * @return the HanaInstanceInner object itself. + */ + public HanaInstanceInner withOsProfile(OSProfile osProfile) { + this.osProfile = osProfile; + return this; + } + + /** + * Get the networkProfile value. + * + * @return the networkProfile value + */ + public NetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the networkProfile value. + * + * @param networkProfile the networkProfile value to set + * @return the HanaInstanceInner object itself. + */ + public HanaInstanceInner withNetworkProfile(NetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the hanaInstanceId value. + * + * @return the hanaInstanceId value + */ + public String hanaInstanceId() { + return this.hanaInstanceId; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaInstancesInner.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaInstancesInner.java new file mode 100644 index 00000000000..7e1f7ba51b4 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaInstancesInner.java @@ -0,0 +1,638 @@ +/** + * 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.hanaonazure.implementation; + +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.hanaonazure.ErrorResponseException; +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 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.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 HanaInstances. + */ +public class HanaInstancesInner implements InnerSupportsGet, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private HanaInstancesService service; + /** The service client containing this operation class. */ + private HanaManagementClientImpl client; + + /** + * Initializes an instance of HanaInstancesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HanaInstancesInner(Retrofit retrofit, HanaManagementClientImpl client) { + this.service = retrofit.create(HanaInstancesService.class); + this.client = client; + } + + /** + * The interface defining all the services for HanaInstances to be + * used by Retrofit to perform actually REST calls. + */ + interface HanaInstancesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.hanaonazure.HanaInstances list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.HanaOnAzure/hanaInstances") + Observable> list(@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.hanaonazure.HanaInstances listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.hanaonazure.HanaInstances getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HanaOnAzure/hanaInstances/{hanaInstanceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("hanaInstanceName") String hanaInstanceName, @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.hanaonazure.HanaInstances listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.hanaonazure.HanaInstances listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<HanaInstanceInner> 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(); + } + }; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HanaInstanceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HanaInstanceInner> 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)); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HanaInstanceInner> 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."); + } + return service.list(this.client.subscriptionId(), 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<HanaInstanceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @param resourceGroupName Name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HanaInstanceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<HanaInstanceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + ServiceResponse> * @param resourceGroupName Name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HanaInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName 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.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets properties of a SAP HANA instance. + * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the HanaInstanceInner object if successful. + */ + public HanaInstanceInner getByResourceGroup(String resourceGroupName, String hanaInstanceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, hanaInstanceName).toBlocking().single().body(); + } + + /** + * Gets properties of a SAP HANA instance. + * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @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 getByResourceGroupAsync(String resourceGroupName, String hanaInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, hanaInstanceName), serviceCallback); + } + + /** + * Gets properties of a SAP HANA instance. + * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HanaInstanceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String hanaInstanceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, hanaInstanceName).map(new Func1, HanaInstanceInner>() { + @Override + public HanaInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets properties of a SAP HANA instance. + * Gets properties of a SAP HANA instance for the specified subscription, resource group, and instance name. + * + * @param resourceGroupName Name of the resource group. + * @param hanaInstanceName Name of the SAP HANA on Azure instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the HanaInstanceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String hanaInstanceName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (hanaInstanceName == null) { + throw new IllegalArgumentException("Parameter hanaInstanceName 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.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, hanaInstanceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<HanaInstanceInner> 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(); + } + }; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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<HanaInstanceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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<HanaInstanceInner> 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)); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription. + * Gets a list of SAP HANA instances in the specified subscription. The operations returns various properties of each SAP HANA on Azure instance. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HanaInstanceInner> 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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<HanaInstanceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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<HanaInstanceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + * @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<HanaInstanceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of SAP HANA instances in the specified subscription and the resource group. + * Gets a list of SAP HANA instances in the specified subscription and the resource group. The operations returns various properties of each SAP HANA on Azure instance. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<HanaInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaManagementClientImpl.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaManagementClientImpl.java new file mode 100644 index 00000000000..7047a181817 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/HanaManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * 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.hanaonazure.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 HanaManagementClientImpl class. + */ +public class HanaManagementClientImpl 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; + } + + /** Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription ID which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public HanaManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client API version. */ + private String apiVersion; + + /** + * Gets Client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public HanaManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or 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 HanaManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** 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 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 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 HanaManagementClientImpl 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 HanaInstancesInner object to access its operations. + */ + private HanaInstancesInner hanaInstances; + + /** + * Gets the HanaInstancesInner object to access its operations. + * @return the HanaInstancesInner object. + */ + public HanaInstancesInner hanaInstances() { + return this.hanaInstances; + } + + /** + * Initializes an instance of HanaManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public HanaManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of HanaManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public HanaManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of HanaManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public HanaManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-11-03-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); + this.hanaInstances = new HanaInstancesInner(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)", super.userAgent(), "HanaManagementClient", "2017-11-03-preview"); + } +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/OperationInner.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/OperationInner.java new file mode 100644 index 00000000000..6e83b21b1a8 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/OperationInner.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.hanaonazure.implementation; + +import com.microsoft.azure.management.hanaonazure.Display; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * HANA operation information. + */ +public class OperationInner { + /** + * The name of the operation being performed on this particular object. + * This name should match the action name that appears in RBAC / the event + * service. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Displayed HANA operation information. + */ + @JsonProperty(value = "display") + private Display display; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the display value. + * + * @return the display value + */ + public Display display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(Display display) { + this.display = display; + return this; + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/OperationsInner.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/OperationsInner.java new file mode 100644 index 00000000000..597e8541814 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/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.hanaonazure.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.hanaonazure.ErrorResponseException; +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 HanaManagementClientImpl 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, HanaManagementClientImpl 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.hanaonazure.Operations list" }) + @GET("providers/Microsoft.HanaOnAzure/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of SAP HANA management operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException 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(); + } + + /** + * Gets a list of SAP HANA management 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); + } + + /** + * Gets a list of SAP HANA management 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(); + } + }); + } + + /** + * Gets a list of SAP HANA management 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/PageImpl.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/PageImpl.java new file mode 100644 index 00000000000..56f48b6020c --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/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.hanaonazure.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-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/PageImpl1.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/PageImpl1.java new file mode 100644 index 00000000000..bbf46721c16 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/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.hanaonazure.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-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/package-info.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/implementation/package-info.java new file mode 100644 index 00000000000..c9e594ec921 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/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 HanaManagementClient. + * HANA on Azure Client. + */ +package com.microsoft.azure.management.hanaonazure.implementation; diff --git a/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/package-info.java b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/package-info.java new file mode 100644 index 00000000000..550eef6b4a3 --- /dev/null +++ b/azure-mgmt-hanaonazure/src/main/java/com/microsoft/azure/management/hanaonazure/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 HanaManagementClient. + * HANA on Azure Client. + */ +package com.microsoft.azure.management.hanaonazure;