diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationProperties.java new file mode 100644 index 000000000000..280d27b9e3e4 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationProperties.java @@ -0,0 +1,204 @@ +/** + * 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.servicefabricmesh; + +import java.util.List; +import com.microsoft.azure.management.servicefabricmesh.implementation.ServiceResourceDescriptionInner; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes properties of an application resource. + */ +public class ApplicationProperties { + /** + * User readable description of the application. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Internal use. + */ + @JsonProperty(value = "debugParams") + private String debugParams; + + /** + * describes the services in the application. + */ + @JsonProperty(value = "services") + private List services; + + /** + * Describes the health state of an application resource. Possible values + * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /** + * When the application's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the + * application is marked unhealthy. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** + * Status of the application resource. Possible values include: 'Invalid', + * 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationResourceStatus status; + + /** + * Gives additional information about the current status of the application + * deployment. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * Names of the services in the application. + */ + @JsonProperty(value = "serviceNames", access = JsonProperty.Access.WRITE_ONLY) + private List serviceNames; + + /** + * Describes the diagnostics definition and usage for an application + * resource. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsDescription diagnostics; + + /** + * Get user readable description of the application. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the application. + * + * @param description the description value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get internal use. + * + * @return the debugParams value + */ + public String debugParams() { + return this.debugParams; + } + + /** + * Set internal use. + * + * @param debugParams the debugParams value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withDebugParams(String debugParams) { + this.debugParams = debugParams; + return this; + } + + /** + * Get describes the services in the application. + * + * @return the services value + */ + public List services() { + return this.services; + } + + /** + * Set describes the services in the application. + * + * @param services the services value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withServices(List services) { + this.services = services; + return this; + } + + /** + * Get describes the health state of an application resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get when the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy. + * + * @return the unhealthyEvaluation value + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Get status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ApplicationResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the application deployment. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get names of the services in the application. + * + * @return the serviceNames value + */ + public List serviceNames() { + return this.serviceNames; + } + + /** + * Get describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value + */ + public DiagnosticsDescription diagnostics() { + return this.diagnostics; + } + + /** + * Set describes the diagnostics definition and usage for an application resource. + * + * @param diagnostics the diagnostics value to set + * @return the ApplicationProperties object itself. + */ + public ApplicationProperties withDiagnostics(DiagnosticsDescription diagnostics) { + this.diagnostics = diagnostics; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationResourceStatus.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationResourceStatus.java new file mode 100644 index 000000000000..7e80c3a00d1a --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationResourceStatus.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.servicefabricmesh; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ApplicationResourceStatus. + */ +public final class ApplicationResourceStatus extends ExpandableStringEnum { + /** Static value Invalid for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus INVALID = fromString("Invalid"); + + /** Static value Ready for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus READY = fromString("Ready"); + + /** Static value Upgrading for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Creating for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus CREATING = fromString("Creating"); + + /** Static value Deleting for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ApplicationResourceStatus. */ + public static final ApplicationResourceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ApplicationResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationResourceStatus + */ + @JsonCreator + public static ApplicationResourceStatus fromString(String name) { + return fromString(name, ApplicationResourceStatus.class); + } + + /** + * @return known ApplicationResourceStatus values + */ + public static Collection values() { + return values(ApplicationResourceStatus.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AvailableOperationDisplay.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AvailableOperationDisplay.java new file mode 100644 index 000000000000..2d67a0040fa2 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AvailableOperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation available at the listed Azure resource provider. + */ +public class AvailableOperationDisplay { + /** + * Name of the operation provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Name of the resource on which the operation is available. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Name of the available operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the available operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the operation provider. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set name of the operation provider. + * + * @param provider the provider value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get name of the resource on which the operation is available. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set name of the resource on which the operation is available. + * + * @param resource the resource value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get name of the available operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set name of the available operation. + * + * @param operation the operation value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the available operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the available operation. + * + * @param description the description value to set + * @return the AvailableOperationDisplay object itself. + */ + public AvailableOperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AzureInternalMonitoringPipelineSinkDescription.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AzureInternalMonitoringPipelineSinkDescription.java new file mode 100644 index 000000000000..0951cde10539 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AzureInternalMonitoringPipelineSinkDescription.java @@ -0,0 +1,152 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Diagnostics settings for Geneva. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AzureInternalMonitoringPipeline") +public class AzureInternalMonitoringPipelineSinkDescription extends DiagnosticsSinkProperties { + /** + * Azure Internal monitoring pipeline account. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /** + * Azure Internal monitoring pipeline account namespace. + */ + @JsonProperty(value = "namespace") + private String namespace; + + /** + * Azure Internal monitoring agent configuration. + */ + @JsonProperty(value = "maConfigUrl") + private String maConfigUrl; + + /** + * Azure Internal monitoring agent fluentd configuration. + */ + @JsonProperty(value = "fluentdConfigUrl") + private Object fluentdConfigUrl; + + /** + * Azure Internal monitoring pipeline autokey associated with the + * certificate. + */ + @JsonProperty(value = "autoKeyConfigUrl") + private String autoKeyConfigUrl; + + /** + * Get azure Internal monitoring pipeline account. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Set azure Internal monitoring pipeline account. + * + * @param accountName the accountName value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get azure Internal monitoring pipeline account namespace. + * + * @return the namespace value + */ + public String namespace() { + return this.namespace; + } + + /** + * Set azure Internal monitoring pipeline account namespace. + * + * @param namespace the namespace value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + /** + * Get azure Internal monitoring agent configuration. + * + * @return the maConfigUrl value + */ + public String maConfigUrl() { + return this.maConfigUrl; + } + + /** + * Set azure Internal monitoring agent configuration. + * + * @param maConfigUrl the maConfigUrl value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withMaConfigUrl(String maConfigUrl) { + this.maConfigUrl = maConfigUrl; + return this; + } + + /** + * Get azure Internal monitoring agent fluentd configuration. + * + * @return the fluentdConfigUrl value + */ + public Object fluentdConfigUrl() { + return this.fluentdConfigUrl; + } + + /** + * Set azure Internal monitoring agent fluentd configuration. + * + * @param fluentdConfigUrl the fluentdConfigUrl value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withFluentdConfigUrl(Object fluentdConfigUrl) { + this.fluentdConfigUrl = fluentdConfigUrl; + return this; + } + + /** + * Get azure Internal monitoring pipeline autokey associated with the certificate. + * + * @return the autoKeyConfigUrl value + */ + public String autoKeyConfigUrl() { + return this.autoKeyConfigUrl; + } + + /** + * Set azure Internal monitoring pipeline autokey associated with the certificate. + * + * @param autoKeyConfigUrl the autoKeyConfigUrl value to set + * @return the AzureInternalMonitoringPipelineSinkDescription object itself. + */ + public AzureInternalMonitoringPipelineSinkDescription withAutoKeyConfigUrl(String autoKeyConfigUrl) { + this.autoKeyConfigUrl = autoKeyConfigUrl; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerCodePackageProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerCodePackageProperties.java new file mode 100644 index 000000000000..564ae93aef89 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerCodePackageProperties.java @@ -0,0 +1,349 @@ +/** + * 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.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a container and its runtime properties. + */ +public class ContainerCodePackageProperties { + /** + * The name of the code package. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Container image to use. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /** + * Image registry credential. + */ + @JsonProperty(value = "imageRegistryCredential") + private ImageRegistryCredential imageRegistryCredential; + + /** + * Override for the default entry point in the container. + */ + @JsonProperty(value = "entrypoint") + private String entrypoint; + + /** + * Command array to execute within the container in exec form. + */ + @JsonProperty(value = "commands") + private List commands; + + /** + * The environment variables to set in this container. + */ + @JsonProperty(value = "environmentVariables") + private List environmentVariables; + + /** + * The settings to set in this container. The setting file path can be + * fetched from environment variable "Fabric_SettingPath". The path for + * Windows container is "C:\\secrets". The path for Linux container is + * "/var/secrets". + */ + @JsonProperty(value = "settings") + private List settings; + + /** + * The labels to set in this container. + */ + @JsonProperty(value = "labels") + private List labels; + + /** + * The endpoints exposed by this container. + */ + @JsonProperty(value = "endpoints") + private List endpoints; + + /** + * This type describes the resource requirements for a container or a + * service. + */ + @JsonProperty(value = "resources", required = true) + private ResourceRequirements resources; + + /** + * The volumes to be attached to the container. + */ + @JsonProperty(value = "volumeRefs") + private List volumeRefs; + + /** + * Runtime information of a container instance. + */ + @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerInstanceView instanceView; + + /** + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /** + * Get the name of the code package. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the code package. + * + * @param name the name value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Container image to use. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the Container image to use. + * + * @param image the image value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withImage(String image) { + this.image = image; + return this; + } + + /** + * Get image registry credential. + * + * @return the imageRegistryCredential value + */ + public ImageRegistryCredential imageRegistryCredential() { + return this.imageRegistryCredential; + } + + /** + * Set image registry credential. + * + * @param imageRegistryCredential the imageRegistryCredential value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withImageRegistryCredential(ImageRegistryCredential imageRegistryCredential) { + this.imageRegistryCredential = imageRegistryCredential; + return this; + } + + /** + * Get override for the default entry point in the container. + * + * @return the entrypoint value + */ + public String entrypoint() { + return this.entrypoint; + } + + /** + * Set override for the default entry point in the container. + * + * @param entrypoint the entrypoint value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEntrypoint(String entrypoint) { + this.entrypoint = entrypoint; + return this; + } + + /** + * Get command array to execute within the container in exec form. + * + * @return the commands value + */ + public List commands() { + return this.commands; + } + + /** + * Set command array to execute within the container in exec form. + * + * @param commands the commands value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withCommands(List commands) { + this.commands = commands; + return this; + } + + /** + * Get the environment variables to set in this container. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in this container. + * + * @param environmentVariables the environmentVariables value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets". + * + * @return the settings value + */ + public List settings() { + return this.settings; + } + + /** + * Set the settings to set in this container. The setting file path can be fetched from environment variable "Fabric_SettingPath". The path for Windows container is "C:\\secrets". The path for Linux container is "/var/secrets". + * + * @param settings the settings value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withSettings(List settings) { + this.settings = settings; + return this; + } + + /** + * Get the labels to set in this container. + * + * @return the labels value + */ + public List labels() { + return this.labels; + } + + /** + * Set the labels to set in this container. + * + * @param labels the labels value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withLabels(List labels) { + this.labels = labels; + return this; + } + + /** + * Get the endpoints exposed by this container. + * + * @return the endpoints value + */ + public List endpoints() { + return this.endpoints; + } + + /** + * Set the endpoints exposed by this container. + * + * @param endpoints the endpoints value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withEndpoints(List endpoints) { + this.endpoints = endpoints; + return this; + } + + /** + * Get this type describes the resource requirements for a container or a service. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set this type describes the resource requirements for a container or a service. + * + * @param resources the resources value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volumes to be attached to the container. + * + * @return the volumeRefs value + */ + public List volumeRefs() { + return this.volumeRefs; + } + + /** + * Set the volumes to be attached to the container. + * + * @param volumeRefs the volumeRefs value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withVolumeRefs(List volumeRefs) { + this.volumeRefs = volumeRefs; + return this; + } + + /** + * Get runtime information of a container instance. + * + * @return the instanceView value + */ + public ContainerInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set + * @return the ContainerCodePackageProperties object itself. + */ + public ContainerCodePackageProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerEvent.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerEvent.java new file mode 100644 index 000000000000..fb64b6a83317 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerEvent.java @@ -0,0 +1,173 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container event. + */ +public class ContainerEvent { + /** + * The name of the container event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The count of the event. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Date/time of the first event. + */ + @JsonProperty(value = "firstTimestamp") + private String firstTimestamp; + + /** + * Date/time of the last event. + */ + @JsonProperty(value = "lastTimestamp") + private String lastTimestamp; + + /** + * The event message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get the name of the container event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container event. + * + * @param name the name value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withName(String name) { + this.name = name; + return this; + } + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of the event. + * + * @param count the count value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get date/time of the first event. + * + * @return the firstTimestamp value + */ + public String firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Set date/time of the first event. + * + * @param firstTimestamp the firstTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withFirstTimestamp(String firstTimestamp) { + this.firstTimestamp = firstTimestamp; + return this; + } + + /** + * Get date/time of the last event. + * + * @return the lastTimestamp value + */ + public String lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Set date/time of the last event. + * + * @param lastTimestamp the lastTimestamp value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withLastTimestamp(String lastTimestamp) { + this.lastTimestamp = lastTimestamp; + return this; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the event message. + * + * @param message the message value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the event type. + * + * @param type the type value to set + * @return the ContainerEvent object itself. + */ + public ContainerEvent withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerInstanceView.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerInstanceView.java new file mode 100644 index 000000000000..4f7b12299f7d --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerInstanceView.java @@ -0,0 +1,122 @@ +/** + * 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.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Runtime information of a container instance. + */ +public class ContainerInstanceView { + /** + * The number of times the container has been restarted. + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState") + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState") + private ContainerState previousState; + + /** + * The events of this container instance. + */ + @JsonProperty(value = "events") + private List events; + + /** + * Get the number of times the container has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the number of times the container has been restarted. + * + * @param restartCount the restartCount value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Set current container instance state. + * + * @param currentState the currentState value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withCurrentState(ContainerState currentState) { + this.currentState = currentState; + return this; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Set previous container instance state. + * + * @param previousState the previousState value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withPreviousState(ContainerState previousState) { + this.previousState = previousState; + return this; + } + + /** + * Get the events of this container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Set the events of this container instance. + * + * @param events the events value to set + * @return the ContainerInstanceView object itself. + */ + public ContainerInstanceView withEvents(List events) { + this.events = events; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerLabel.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerLabel.java new file mode 100644 index 000000000000..17fc1e041654 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerLabel.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a container label. + */ +public class ContainerLabel { + /** + * The name of the container label. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the container label. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the name of the container label. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container label. + * + * @param name the name value to set + * @return the ContainerLabel object itself. + */ + public ContainerLabel withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the container label. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the container label. + * + * @param value the value value to set + * @return the ContainerLabel object itself. + */ + public ContainerLabel withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerState.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerState.java new file mode 100644 index 000000000000..04eb6a3b1306 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerState.java @@ -0,0 +1,148 @@ +/** + * 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.servicefabricmesh; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container state. + */ +public class ContainerState { + /** + * The state of this container. + */ + @JsonProperty(value = "state") + private String state; + + /** + * Date/time when the container state started. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The container exit code. + */ + @JsonProperty(value = "exitCode") + private String exitCode; + + /** + * Date/time when the container state finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * Human-readable status of this state. + */ + @JsonProperty(value = "detailStatus") + private String detailStatus; + + /** + * Get the state of this container. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Set the state of this container. + * + * @param state the state value to set + * @return the ContainerState object itself. + */ + public ContainerState withState(String state) { + this.state = state; + return this; + } + + /** + * Get date/time when the container state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set date/time when the container state started. + * + * @param startTime the startTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the container exit code. + * + * @return the exitCode value + */ + public String exitCode() { + return this.exitCode; + } + + /** + * Set the container exit code. + * + * @param exitCode the exitCode value to set + * @return the ContainerState object itself. + */ + public ContainerState withExitCode(String exitCode) { + this.exitCode = exitCode; + return this; + } + + /** + * Get date/time when the container state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set date/time when the container state finished. + * + * @param finishTime the finishTime value to set + * @return the ContainerState object itself. + */ + public ContainerState withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get human-readable status of this state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + + /** + * Set human-readable status of this state. + * + * @param detailStatus the detailStatus value to set + * @return the ContainerState object itself. + */ + public ContainerState withDetailStatus(String detailStatus) { + this.detailStatus = detailStatus; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerVolume.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerVolume.java new file mode 100644 index 000000000000..a1ab001def6f --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerVolume.java @@ -0,0 +1,96 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes how a volume is attached to a container. + */ +public class ContainerVolume { + /** + * Name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The flag indicating whether the volume is read only. Default is 'false'. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The path within the container at which the volume should be mounted. + * Only valid path characters are allowed. + */ + @JsonProperty(value = "destinationPath", required = true) + private String destinationPath; + + /** + * Get name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the volume. + * + * @param name the name value to set + * @return the ContainerVolume object itself. + */ + public ContainerVolume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the flag indicating whether the volume is read only. Default is 'false'. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume is read only. Default is 'false'. + * + * @param readOnly the readOnly value to set + * @return the ContainerVolume object itself. + */ + public ContainerVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the path within the container at which the volume should be mounted. Only valid path characters are allowed. + * + * @return the destinationPath value + */ + public String destinationPath() { + return this.destinationPath; + } + + /** + * Set the path within the container at which the volume should be mounted. Only valid path characters are allowed. + * + * @param destinationPath the destinationPath value to set + * @return the ContainerVolume object itself. + */ + public ContainerVolume withDestinationPath(String destinationPath) { + this.destinationPath = destinationPath; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsDescription.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsDescription.java new file mode 100644 index 000000000000..09f1fa772e81 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsDescription.java @@ -0,0 +1,97 @@ +/** + * 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.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the diagnostics options available. + */ +public class DiagnosticsDescription { + /** + * List of supported sinks that can be referenced. + */ + @JsonProperty(value = "sinks") + private List sinks; + + /** + * Status of whether or not sinks are enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * The sinks to be used if diagnostics is enabled. Sink choices can be + * overridden at the service and code package level. + */ + @JsonProperty(value = "defaultSinkRefs") + private String defaultSinkRefs; + + /** + * Get list of supported sinks that can be referenced. + * + * @return the sinks value + */ + public List sinks() { + return this.sinks; + } + + /** + * Set list of supported sinks that can be referenced. + * + * @param sinks the sinks value to set + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withSinks(List sinks) { + this.sinks = sinks; + return this; + } + + /** + * Get status of whether or not sinks are enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set status of whether or not sinks are enabled. + * + * @param enabled the enabled value to set + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level. + * + * @return the defaultSinkRefs value + */ + public String defaultSinkRefs() { + return this.defaultSinkRefs; + } + + /** + * Set the sinks to be used if diagnostics is enabled. Sink choices can be overridden at the service and code package level. + * + * @param defaultSinkRefs the defaultSinkRefs value to set + * @return the DiagnosticsDescription object itself. + */ + public DiagnosticsDescription withDefaultSinkRefs(String defaultSinkRefs) { + this.defaultSinkRefs = defaultSinkRefs; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsRef.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsRef.java new file mode 100644 index 000000000000..a4e517fb27fd --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsRef.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.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Reference to sinks in DiagnosticsDescription. + */ +public class DiagnosticsRef { + /** + * Status of whether or not sinks are enabled. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * List of sinks to be used if enabled. References the list of sinks in + * DiagnosticsDescription. + */ + @JsonProperty(value = "sinkRefs") + private List sinkRefs; + + /** + * Get status of whether or not sinks are enabled. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set status of whether or not sinks are enabled. + * + * @param enabled the enabled value to set + * @return the DiagnosticsRef object itself. + */ + public DiagnosticsRef withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get list of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription. + * + * @return the sinkRefs value + */ + public List sinkRefs() { + return this.sinkRefs; + } + + /** + * Set list of sinks to be used if enabled. References the list of sinks in DiagnosticsDescription. + * + * @param sinkRefs the sinkRefs value to set + * @return the DiagnosticsRef object itself. + */ + public DiagnosticsRef withSinkRefs(List sinkRefs) { + this.sinkRefs = sinkRefs; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkKind.java new file mode 100644 index 000000000000..322da68699f7 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkKind.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.servicefabricmesh; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DiagnosticsSinkKind. + */ +public final class DiagnosticsSinkKind extends ExpandableStringEnum { + /** Static value Invalid for DiagnosticsSinkKind. */ + public static final DiagnosticsSinkKind INVALID = fromString("Invalid"); + + /** Static value AzureInternalMonitoringPipeline for DiagnosticsSinkKind. */ + public static final DiagnosticsSinkKind AZURE_INTERNAL_MONITORING_PIPELINE = fromString("AzureInternalMonitoringPipeline"); + + /** + * Creates or finds a DiagnosticsSinkKind from its string representation. + * @param name a name to look for + * @return the corresponding DiagnosticsSinkKind + */ + @JsonCreator + public static DiagnosticsSinkKind fromString(String name) { + return fromString(name, DiagnosticsSinkKind.class); + } + + /** + * @return known DiagnosticsSinkKind values + */ + public static Collection values() { + return values(DiagnosticsSinkKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkProperties.java new file mode 100644 index 000000000000..1a99512508a0 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkProperties.java @@ -0,0 +1,78 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Properties of a DiagnosticsSink. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("DiagnosticsSinkProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AzureInternalMonitoringPipeline", value = AzureInternalMonitoringPipelineSinkDescription.class) +}) +public class DiagnosticsSinkProperties { + /** + * Name of the sink. This value is referenced by + * DiagnosticsReferenceDescription. + */ + @JsonProperty(value = "name") + private String name; + + /** + * A description of the sink. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get name of the sink. This value is referenced by DiagnosticsReferenceDescription. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the sink. This value is referenced by DiagnosticsReferenceDescription. + * + * @param name the name value to set + * @return the DiagnosticsSinkProperties object itself. + */ + public DiagnosticsSinkProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get a description of the sink. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set a description of the sink. + * + * @param description the description value to set + * @return the DiagnosticsSinkProperties object itself. + */ + public DiagnosticsSinkProperties withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointProperties.java new file mode 100644 index 000000000000..c6362173d932 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointProperties.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a container endpoint. + */ +public class EndpointProperties { + /** + * The name of the endpoint. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Port used by the container. + */ + @JsonProperty(value = "port") + private Integer port; + + /** + * Get the name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the endpoint. + * + * @param name the name value to set + * @return the EndpointProperties object itself. + */ + public EndpointProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get port used by the container. + * + * @return the port value + */ + public Integer port() { + return this.port; + } + + /** + * Set port used by the container. + * + * @param port the port value to set + * @return the EndpointProperties object itself. + */ + public EndpointProperties withPort(Integer port) { + this.port = port; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EnvironmentVariable.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EnvironmentVariable.java new file mode 100644 index 000000000000..90d5b9a150a7 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EnvironmentVariable.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes an environment variable for the container. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModel.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModel.java new file mode 100644 index 000000000000..b8df1d69edde --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModel.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error details. + */ +public class ErrorModel { + /** + * The error code. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * 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 ErrorModel object itself. + */ + public ErrorModel 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 ErrorModel object itself. + */ + public ErrorModel withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModelException.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModelException.java new file mode 100644 index 000000000000..a4e1d86a03f0 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModelException.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.servicefabricmesh; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorModel information. + */ +public class ErrorModelException extends RestException { + /** + * Initializes a new instance of the ErrorModelException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorModelException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorModelException 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 ErrorModelException(final String message, final Response response, final ErrorModel body) { + super(message, response, body); + } + + @Override + public ErrorModel body() { + return (ErrorModel) super.body(); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HealthState.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HealthState.java new file mode 100644 index 000000000000..e92f9dcf1439 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HealthState.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.servicefabricmesh; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for HealthState. + */ +public final class HealthState extends ExpandableStringEnum { + /** Static value Invalid for HealthState. */ + public static final HealthState INVALID = fromString("Invalid"); + + /** Static value Ok for HealthState. */ + public static final HealthState OK = fromString("Ok"); + + /** Static value Warning for HealthState. */ + public static final HealthState WARNING = fromString("Warning"); + + /** Static value Error for HealthState. */ + public static final HealthState ERROR = fromString("Error"); + + /** Static value Unknown for HealthState. */ + public static final HealthState UNKNOWN = fromString("Unknown"); + + /** + * Creates or finds a HealthState from its string representation. + * @param name a name to look for + * @return the corresponding HealthState + */ + @JsonCreator + public static HealthState fromString(String name) { + return fromString(name, HealthState.class); + } + + /** + * @return known HealthState values + */ + public static Collection values() { + return values(HealthState.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ImageRegistryCredential.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ImageRegistryCredential.java new file mode 100644 index 000000000000..f6efd7c44a9a --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * Docker image registry server, without protocol such as `http` and + * `https`. + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get docker image registry server, without protocol such as `http` and `https`. + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set docker image registry server, without protocol such as `http` and `https`. + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressConfig.java new file mode 100644 index 000000000000..ca7e3b3f217a --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressConfig.java @@ -0,0 +1,85 @@ +/** + * 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.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes public connectivity configuration for the network. + */ +public class IngressConfig { + /** + * The QoS tier for ingress. Possible values include: 'Bronze'. + */ + @JsonProperty(value = "qosLevel") + private IngressQoSLevel qosLevel; + + /** + * Configuration for layer4 public connectivity for this network. + */ + @JsonProperty(value = "layer4") + private List layer4; + + /** + * The public IP address for reaching this network. + */ + @JsonProperty(value = "publicIPAddress", access = JsonProperty.Access.WRITE_ONLY) + private String publicIPAddress; + + /** + * Get the QoS tier for ingress. Possible values include: 'Bronze'. + * + * @return the qosLevel value + */ + public IngressQoSLevel qosLevel() { + return this.qosLevel; + } + + /** + * Set the QoS tier for ingress. Possible values include: 'Bronze'. + * + * @param qosLevel the qosLevel value to set + * @return the IngressConfig object itself. + */ + public IngressConfig withQosLevel(IngressQoSLevel qosLevel) { + this.qosLevel = qosLevel; + return this; + } + + /** + * Get configuration for layer4 public connectivity for this network. + * + * @return the layer4 value + */ + public List layer4() { + return this.layer4; + } + + /** + * Set configuration for layer4 public connectivity for this network. + * + * @param layer4 the layer4 value to set + * @return the IngressConfig object itself. + */ + public IngressConfig withLayer4(List layer4) { + this.layer4 = layer4; + return this; + } + + /** + * Get the public IP address for reaching this network. + * + * @return the publicIPAddress value + */ + public String publicIPAddress() { + return this.publicIPAddress; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressQoSLevel.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressQoSLevel.java new file mode 100644 index 000000000000..9c868ebb090d --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressQoSLevel.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.servicefabricmesh; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IngressQoSLevel. + */ +public final class IngressQoSLevel extends ExpandableStringEnum { + /** Static value Bronze for IngressQoSLevel. */ + public static final IngressQoSLevel BRONZE = fromString("Bronze"); + + /** + * Creates or finds a IngressQoSLevel from its string representation. + * @param name a name to look for + * @return the corresponding IngressQoSLevel + */ + @JsonCreator + public static IngressQoSLevel fromString(String name) { + return fromString(name, IngressQoSLevel.class); + } + + /** + * @return known IngressQoSLevel values + */ + public static Collection values() { + return values(IngressQoSLevel.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Layer4IngressConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Layer4IngressConfig.java new file mode 100644 index 000000000000..f014055aa615 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Layer4IngressConfig.java @@ -0,0 +1,148 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the layer4 configuration for public connectivity for this network. + */ +public class Layer4IngressConfig { + /** + * Layer4 ingress config name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Specifies the public port at which the service endpoint below needs to + * be exposed. + */ + @JsonProperty(value = "publicPort") + private Integer publicPort; + + /** + * The application name which contains the service to be exposed. + */ + @JsonProperty(value = "applicationName") + private String applicationName; + + /** + * The service whose endpoint needs to be exposed at the public port. + */ + @JsonProperty(value = "serviceName") + private String serviceName; + + /** + * The service endpoint that needs to be exposed. + */ + @JsonProperty(value = "endpointName") + private String endpointName; + + /** + * Get layer4 ingress config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set layer4 ingress config name. + * + * @param name the name value to set + * @return the Layer4IngressConfig object itself. + */ + public Layer4IngressConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the public port at which the service endpoint below needs to be exposed. + * + * @return the publicPort value + */ + public Integer publicPort() { + return this.publicPort; + } + + /** + * Set specifies the public port at which the service endpoint below needs to be exposed. + * + * @param publicPort the publicPort value to set + * @return the Layer4IngressConfig object itself. + */ + public Layer4IngressConfig withPublicPort(Integer publicPort) { + this.publicPort = publicPort; + return this; + } + + /** + * Get the application name which contains the service to be exposed. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set the application name which contains the service to be exposed. + * + * @param applicationName the applicationName value to set + * @return the Layer4IngressConfig object itself. + */ + public Layer4IngressConfig withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get the service whose endpoint needs to be exposed at the public port. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set the service whose endpoint needs to be exposed at the public port. + * + * @param serviceName the serviceName value to set + * @return the Layer4IngressConfig object itself. + */ + public Layer4IngressConfig withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get the service endpoint that needs to be exposed. + * + * @return the endpointName value + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set the service endpoint that needs to be exposed. + * + * @param endpointName the endpointName value to set + * @return the Layer4IngressConfig object itself. + */ + public Layer4IngressConfig withEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ManagedProxyResource.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ManagedProxyResource.java new file mode 100644 index 000000000000..3511cea7e163 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ManagedProxyResource.java @@ -0,0 +1,20 @@ +/** + * 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.servicefabricmesh; + +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for Azure Resource Manager proxy resource. It + * will have everything other than required location and tags. This proxy + * resource is explicitly created or updated by including it in the parent + * resource. + */ +public class ManagedProxyResource extends ProxyResource { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkProperties.java new file mode 100644 index 000000000000..cffb6b02310b --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkProperties.java @@ -0,0 +1,95 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a network. + */ +public class NetworkProperties { + /** + * User readable description of the network. + */ + @JsonProperty(value = "description") + private String description; + + /** + * the address prefix for this network. + */ + @JsonProperty(value = "addressPrefix", required = true) + private String addressPrefix; + + /** + * Configuration for public connectivity for this network. + */ + @JsonProperty(value = "ingressConfig") + private IngressConfig ingressConfig; + + /** + * Get user readable description of the network. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the network. + * + * @param description the description value to set + * @return the NetworkProperties object itself. + */ + public NetworkProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the address prefix for this network. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefix for this network. + * + * @param addressPrefix the addressPrefix value to set + * @return the NetworkProperties object itself. + */ + public NetworkProperties withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get configuration for public connectivity for this network. + * + * @return the ingressConfig value + */ + public IngressConfig ingressConfig() { + return this.ingressConfig; + } + + /** + * Set configuration for public connectivity for this network. + * + * @param ingressConfig the ingressConfig value to set + * @return the NetworkProperties object itself. + */ + public NetworkProperties withIngressConfig(IngressConfig ingressConfig) { + this.ingressConfig = ingressConfig; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkRef.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkRef.java new file mode 100644 index 000000000000..a3300373a742 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkRef.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a network reference in a service. + */ +public class NetworkRef { + /** + * Name of the network. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the network. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the network. + * + * @param name the name value to set + * @return the NetworkRef object itself. + */ + public NetworkRef withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemTypes.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemTypes.java new file mode 100644 index 000000000000..34e488843cfe --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemTypes.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.servicefabricmesh; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ProvisionedResourceProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ProvisionedResourceProperties.java new file mode 100644 index 000000000000..7b059c80cd03 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ProvisionedResourceProperties.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes common properties of a provisioned resource. + */ +public class ProvisionedResourceProperties { + /** + * State of the resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * Get state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceLimits.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceLimits.java new file mode 100644 index 000000000000..0c54b2e94a95 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceLimits.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes the resource limits for a given container. It describes + * the most amount of resources a container is allowed to use before being + * restarted. + */ +public class ResourceLimits { + /** + * The memory limit in GB. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * CPU limits in cores. At present, only full cores are supported. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * Get the memory limit in GB. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get cPU limits in cores. At present, only full cores are supported. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set cPU limits in cores. At present, only full cores are supported. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequests.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequests.java new file mode 100644 index 000000000000..da3fb5671132 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequests.java @@ -0,0 +1,74 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes the requested resources for a given container. It + * describes the least amount of resources required for the container. A + * container can consume more than requested resources up to the specified + * limits before being restarted. Currently, the requested resources are + * treated as limits. + */ +public class ResourceRequests { + /** + * The memory request in GB for this container. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * Requested number of CPU cores. At present, only full cores are + * supported. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * Get the memory request in GB for this container. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB for this container. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get requested number of CPU cores. At present, only full cores are supported. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set requested number of CPU cores. At present, only full cores are supported. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequirements.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequirements.java new file mode 100644 index 000000000000..08e533427268 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequirements.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes the resource requirements for a container or a service. + */ +public class ResourceRequirements { + /** + * Describes the requested resources for a given container. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * Describes the maximum limits on the resources for a given container. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get describes the requested resources for a given container. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set describes the requested resources for a given container. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get describes the maximum limits on the resources for a given container. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set describes the maximum limits on the resources for a given container. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceReplicaProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceReplicaProperties.java new file mode 100644 index 000000000000..327c164d9861 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceReplicaProperties.java @@ -0,0 +1,128 @@ +/** + * 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.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a service replica. + */ +public class ServiceReplicaProperties { + /** + * The Operating system type required by the code in service. + * . Possible values include: 'Linux', 'Windows'. + */ + @JsonProperty(value = "osType", required = true) + private OperatingSystemTypes osType; + + /** + * Describes the set of code packages that forms the service. A code + * package describes the container and the properties for running it. All + * the code packages are started together on the same host and share the + * same context (network, process etc.). + */ + @JsonProperty(value = "codePackages", required = true) + private List codePackages; + + /** + * The names of the private networks that this service needs to be part of. + */ + @JsonProperty(value = "networkRefs") + private List networkRefs; + + /** + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "diagnostics") + private DiagnosticsRef diagnostics; + + /** + * Get the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @param osType the osType value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). + * + * @return the codePackages value + */ + public List codePackages() { + return this.codePackages; + } + + /** + * Set describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). + * + * @param codePackages the codePackages value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withCodePackages(List codePackages) { + this.codePackages = codePackages; + return this; + } + + /** + * Get the names of the private networks that this service needs to be part of. + * + * @return the networkRefs value + */ + public List networkRefs() { + return this.networkRefs; + } + + /** + * Set the names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withNetworkRefs(List networkRefs) { + this.networkRefs = networkRefs; + return this; + } + + /** + * Get reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set + * @return the ServiceReplicaProperties object itself. + */ + public ServiceReplicaProperties withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceResourceStatus.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceResourceStatus.java new file mode 100644 index 000000000000..87ecd52f4914 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceResourceStatus.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.servicefabricmesh; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ServiceResourceStatus. + */ +public final class ServiceResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ServiceResourceStatus. */ + public static final ServiceResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Active for ServiceResourceStatus. */ + public static final ServiceResourceStatus ACTIVE = fromString("Active"); + + /** Static value Upgrading for ServiceResourceStatus. */ + public static final ServiceResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Deleting for ServiceResourceStatus. */ + public static final ServiceResourceStatus DELETING = fromString("Deleting"); + + /** Static value Creating for ServiceResourceStatus. */ + public static final ServiceResourceStatus CREATING = fromString("Creating"); + + /** Static value Failed for ServiceResourceStatus. */ + public static final ServiceResourceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ServiceResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ServiceResourceStatus + */ + @JsonCreator + public static ServiceResourceStatus fromString(String name) { + return fromString(name, ServiceResourceStatus.class); + } + + /** + * @return known ServiceResourceStatus values + */ + public static Collection values() { + return values(ServiceResourceStatus.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Setting.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Setting.java new file mode 100644 index 000000000000..b12c7da22898 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Setting.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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a setting for the container. + */ +public class Setting { + /** + * The name of the setting. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The value of the setting. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name of the setting. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the setting. + * + * @param name the name value to set + * @return the Setting object itself. + */ + public Setting withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the setting. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the setting. + * + * @param value the value value to set + * @return the Setting object itself. + */ + public Setting withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProperties.java new file mode 100644 index 000000000000..01f9b997e3f9 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProperties.java @@ -0,0 +1,102 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes properties of a volume resource. + */ +public class VolumeProperties { + /** + * User readable description of the volume. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Provider of the volume. + */ + @JsonProperty(value = "provider", required = true) + private String provider; + + /** + * This type describes a volume provided by an Azure Files file share. + */ + @JsonProperty(value = "azureFileParameters") + private VolumeProviderParametersAzureFile azureFileParameters; + + /** + * Creates an instance of VolumeProperties class. + */ + public VolumeProperties() { + provider = "SFAzureFile"; + } + + /** + * Get user readable description of the volume. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the volume. + * + * @param description the description value to set + * @return the VolumeProperties object itself. + */ + public VolumeProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get provider of the volume. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider of the volume. + * + * @param provider the provider value to set + * @return the VolumeProperties object itself. + */ + public VolumeProperties withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get this type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value + */ + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.azureFileParameters; + } + + /** + * Set this type describes a volume provided by an Azure Files file share. + * + * @param azureFileParameters the azureFileParameters value to set + * @return the VolumeProperties object itself. + */ + public VolumeProperties withAzureFileParameters(VolumeProviderParametersAzureFile azureFileParameters) { + this.azureFileParameters = azureFileParameters; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProviderParametersAzureFile.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProviderParametersAzureFile.java new file mode 100644 index 000000000000..a44e1454b925 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProviderParametersAzureFile.java @@ -0,0 +1,95 @@ +/** + * 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.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * This type describes a volume provided by an Azure Files file share. + */ +public class VolumeProviderParametersAzureFile { + /** + * Name of the Azure storage account for the File Share. + */ + @JsonProperty(value = "accountName", required = true) + private String accountName; + + /** + * Access key of the Azure storage account for the File Share. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /** + * Name of the Azure Files file share that provides storage for the volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * Get name of the Azure storage account for the File Share. + * + * @return the accountName value + */ + public String accountName() { + return this.accountName; + } + + /** + * Set name of the Azure storage account for the File Share. + * + * @param accountName the accountName value to set + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get access key of the Azure storage account for the File Share. + * + * @return the accountKey value + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set access key of the Azure storage account for the File Share. + * + * @param accountKey the accountKey value to set + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get name of the Azure Files file share that provides storage for the volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set name of the Azure Files file share that provides storage for the volume. + * + * @param shareName the shareName value to set + * @return the VolumeProviderParametersAzureFile object itself. + */ + public VolumeProviderParametersAzureFile withShareName(String shareName) { + this.shareName = shareName; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationResourceDescriptionInner.java new file mode 100644 index 000000000000..0e78bca37444 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationResourceDescriptionInner.java @@ -0,0 +1,226 @@ +/** + * 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.servicefabricmesh.implementation; + +import java.util.List; +import com.microsoft.azure.management.servicefabricmesh.HealthState; +import com.microsoft.azure.management.servicefabricmesh.ApplicationResourceStatus; +import com.microsoft.azure.management.servicefabricmesh.DiagnosticsDescription; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * This type describes an application resource. + */ +@JsonFlatten +@SkipParentValidation +public class ApplicationResourceDescriptionInner extends Resource { + /** + * State of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * User readable description of the application. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Internal use. + */ + @JsonProperty(value = "properties.debugParams") + private String debugParams; + + /** + * describes the services in the application. + */ + @JsonProperty(value = "properties.services") + private List services; + + /** + * Describes the health state of an application resource. Possible values + * include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + */ + @JsonProperty(value = "properties.healthState", access = JsonProperty.Access.WRITE_ONLY) + private HealthState healthState; + + /** + * When the application's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the + * application is marked unhealthy. + */ + @JsonProperty(value = "properties.unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** + * Status of the application resource. Possible values include: 'Invalid', + * 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ApplicationResourceStatus status; + + /** + * Gives additional information about the current status of the application + * deployment. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * Names of the services in the application. + */ + @JsonProperty(value = "properties.serviceNames", access = JsonProperty.Access.WRITE_ONLY) + private List serviceNames; + + /** + * Describes the diagnostics definition and usage for an application + * resource. + */ + @JsonProperty(value = "properties.diagnostics") + private DiagnosticsDescription diagnostics; + + /** + * Get state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get user readable description of the application. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the application. + * + * @param description the description value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get internal use. + * + * @return the debugParams value + */ + public String debugParams() { + return this.debugParams; + } + + /** + * Set internal use. + * + * @param debugParams the debugParams value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDebugParams(String debugParams) { + this.debugParams = debugParams; + return this; + } + + /** + * Get describes the services in the application. + * + * @return the services value + */ + public List services() { + return this.services; + } + + /** + * Set describes the services in the application. + * + * @param services the services value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withServices(List services) { + this.services = services; + return this; + } + + /** + * Get describes the health state of an application resource. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Get when the application's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the application is marked unhealthy. + * + * @return the unhealthyEvaluation value + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + + /** + * Get status of the application resource. Possible values include: 'Invalid', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ApplicationResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the application deployment. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get names of the services in the application. + * + * @return the serviceNames value + */ + public List serviceNames() { + return this.serviceNames; + } + + /** + * Get describes the diagnostics definition and usage for an application resource. + * + * @return the diagnostics value + */ + public DiagnosticsDescription diagnostics() { + return this.diagnostics; + } + + /** + * Set describes the diagnostics definition and usage for an application resource. + * + * @param diagnostics the diagnostics value to set + * @return the ApplicationResourceDescriptionInner object itself. + */ + public ApplicationResourceDescriptionInner withDiagnostics(DiagnosticsDescription diagnostics) { + this.diagnostics = diagnostics; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationsInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationsInner.java new file mode 100644 index 000000000000..bb743074d798 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationsInner.java @@ -0,0 +1,829 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.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.servicefabricmesh.ErrorModelException; +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.HTTP; +import retrofit2.http.Path; +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 Applications. + */ +public class ApplicationsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ApplicationsService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of ApplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApplicationsInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(ApplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Applications to be + * used by Retrofit to perform actually REST calls. + */ + interface ApplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.Applications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @Query("api-version") String apiVersion, @Body ApplicationResourceDescriptionInner applicationResourceDescription, @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.servicefabricmesh.Applications getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @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.servicefabricmesh.Applications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @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.servicefabricmesh.Applications listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications") + 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.servicefabricmesh.Applications list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/applications") + 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.servicefabricmesh.Applications listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.servicefabricmesh.Applications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates an application resource. + * Creates an application resource with the specified name and description. If an application with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to provide public connectivity to the services of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param applicationResourceDescription Description for creating an application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceDescriptionInner object if successful. + */ + public ApplicationResourceDescriptionInner create(String resourceGroupName, String applicationName, ApplicationResourceDescriptionInner applicationResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, applicationName, applicationResourceDescription).toBlocking().single().body(); + } + + /** + * Creates or updates an application resource. + * Creates an application resource with the specified name and description. If an application with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to provide public connectivity to the services of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param applicationResourceDescription Description for creating an application resource. + * @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 resourceGroupName, String applicationName, ApplicationResourceDescriptionInner applicationResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, applicationName, applicationResourceDescription), serviceCallback); + } + + /** + * Creates or updates an application resource. + * Creates an application resource with the specified name and description. If an application with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to provide public connectivity to the services of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param applicationResourceDescription Description for creating an application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable createAsync(String resourceGroupName, String applicationName, ApplicationResourceDescriptionInner applicationResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, applicationName, applicationResourceDescription).map(new Func1, ApplicationResourceDescriptionInner>() { + @Override + public ApplicationResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates an application resource. + * Creates an application resource with the specified name and description. If an application with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to provide public connectivity to the services of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param applicationResourceDescription Description for creating an application resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String applicationName, ApplicationResourceDescriptionInner applicationResourceDescription) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (applicationResourceDescription == null) { + throw new IllegalArgumentException("Parameter applicationResourceDescription is required and cannot be null."); + } + Validator.validate(applicationResourceDescription); + return service.create(this.client.subscriptionId(), resourceGroupName, applicationName, this.client.apiVersion(), applicationResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the application resource. + * Gets the information about the application resource with a given name. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ApplicationResourceDescriptionInner object if successful. + */ + public ApplicationResourceDescriptionInner getByResourceGroup(String resourceGroupName, String applicationName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationName).toBlocking().single().body(); + } + + /** + * Gets the application resource. + * Gets the information about the application resource with a given name. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @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 applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationName), serviceCallback); + } + + /** + * Gets the application resource. + * Gets the information about the application resource with a given name. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String applicationName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationName).map(new Func1, ApplicationResourceDescriptionInner>() { + @Override + public ApplicationResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the application resource. + * Gets the information about the application resource with a given name. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ApplicationResourceDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String applicationName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, applicationName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes the application resource. + * Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String applicationName) { + deleteWithServiceResponseAsync(resourceGroupName, applicationName).toBlocking().single().body(); + } + + /** + * Deletes the application resource. + * Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @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 deleteAsync(String resourceGroupName, String applicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, applicationName), serviceCallback); + } + + /** + * Deletes the application resource. + * Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String applicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the application resource. + * Deletes the application resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<ApplicationResourceDescriptionInner> 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 all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group 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> 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 all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationResourceDescriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationResourceDescriptionInner> 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 all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationResourceDescriptionInner> 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."); + } + 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<ApplicationResourceDescriptionInner> 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 all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @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 all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationResourceDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ApplicationResourceDescriptionInner> 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 all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationResourceDescriptionInner> 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."); + } + 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<ApplicationResourceDescriptionInner> 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 all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @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 all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @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<ApplicationResourceDescriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + * @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<ApplicationResourceDescriptionInner> 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 all the application resources in a given resource group. + * Gets the information about all application resources in a given resource group. The information includes the information about the application's services and other runtime properties. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationResourceDescriptionInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<ApplicationResourceDescriptionInner> 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 all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @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 all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @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<ApplicationResourceDescriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + * @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<ApplicationResourceDescriptionInner> 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 all the application resources in a given subscription. + * Gets the information about all application resources in a given subscription. The information includes the information about the application's services and other runtime properties. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ApplicationResourceDescriptionInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/CodePackagesInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/CodePackagesInner.java new file mode 100644 index 000000000000..390cf9a05239 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/CodePackagesInner.java @@ -0,0 +1,274 @@ +/** + * 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.servicefabricmesh.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.servicefabricmesh.ErrorModelException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +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 CodePackages. + */ +public class CodePackagesInner { + /** The Retrofit service to perform REST calls. */ + private CodePackagesService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of CodePackagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public CodePackagesInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(CodePackagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for CodePackages to be + * used by Retrofit to perform actually REST calls. + */ + interface CodePackagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.CodePackages getContainerLog" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}/services/{serviceName}/replicas/{replicaName}/codePackages/{codePackageName}/logs") + Observable> getContainerLog(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @Path(value = "serviceName", encoded = true) String serviceName, @Path(value = "replicaName", encoded = true) String replicaName, @Path(value = "codePackageName", encoded = true) String codePackageName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerLogsInner object if successful. + */ + public ContainerLogsInner getContainerLog(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName) { + return getContainerLogWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName, codePackageName).toBlocking().single().body(); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @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 getContainerLogAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerLogWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName, codePackageName), serviceCallback); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable getContainerLogAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName) { + return getContainerLogWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName, codePackageName).map(new Func1, ContainerLogsInner>() { + @Override + public ContainerLogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable> getContainerLogWithServiceResponseAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + final Integer tail = null; + return service.getContainerLog(this.client.subscriptionId(), resourceGroupName, applicationName, serviceName, replicaName, codePackageName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerLogsInner object if successful. + */ + public ContainerLogsInner getContainerLog(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName, Integer tail) { + return getContainerLogWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName, codePackageName, tail).toBlocking().single().body(); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @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 getContainerLogAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getContainerLogWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName, codePackageName, tail), serviceCallback); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable getContainerLogAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName, Integer tail) { + return getContainerLogWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName, codePackageName, tail).map(new Func1, ContainerLogsInner>() { + @Override + public ContainerLogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the logs for the container. + * Get the logs for the container of a given code package of an application. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @param codePackageName The name of the code package. + * @param tail Number of lines to show from the end of the logs. Default is 100. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerLogsInner object + */ + public Observable> getContainerLogWithServiceResponseAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName, String codePackageName, Integer tail) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + if (codePackageName == null) { + throw new IllegalArgumentException("Parameter codePackageName is required and cannot be null."); + } + return service.getContainerLog(this.client.subscriptionId(), resourceGroupName, applicationName, serviceName, replicaName, codePackageName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getContainerLogDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getContainerLogDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ContainerLogsInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ContainerLogsInner.java new file mode 100644 index 000000000000..b98bebc8fbab --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ContainerLogsInner.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.servicefabricmesh.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs of the container. + */ +public class ContainerLogsInner { + /** + * content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set content of the log. + * + * @param content the content value to set + * @return the ContainerLogsInner object itself. + */ + public ContainerLogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworkResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworkResourceDescriptionInner.java new file mode 100644 index 000000000000..5272bcfe6361 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworkResourceDescriptionInner.java @@ -0,0 +1,116 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.management.servicefabricmesh.IngressConfig; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * This type describes a network resource. + */ +@JsonFlatten +@SkipParentValidation +public class NetworkResourceDescriptionInner extends Resource { + /** + * State of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * User readable description of the network. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * the address prefix for this network. + */ + @JsonProperty(value = "properties.addressPrefix", required = true) + private String addressPrefix; + + /** + * Configuration for public connectivity for this network. + */ + @JsonProperty(value = "properties.ingressConfig") + private IngressConfig ingressConfig; + + /** + * Get state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get user readable description of the network. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the network. + * + * @param description the description value to set + * @return the NetworkResourceDescriptionInner object itself. + */ + public NetworkResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the address prefix for this network. + * + * @return the addressPrefix value + */ + public String addressPrefix() { + return this.addressPrefix; + } + + /** + * Set the address prefix for this network. + * + * @param addressPrefix the addressPrefix value to set + * @return the NetworkResourceDescriptionInner object itself. + */ + public NetworkResourceDescriptionInner withAddressPrefix(String addressPrefix) { + this.addressPrefix = addressPrefix; + return this; + } + + /** + * Get configuration for public connectivity for this network. + * + * @return the ingressConfig value + */ + public IngressConfig ingressConfig() { + return this.ingressConfig; + } + + /** + * Set configuration for public connectivity for this network. + * + * @param ingressConfig the ingressConfig value to set + * @return the NetworkResourceDescriptionInner object itself. + */ + public NetworkResourceDescriptionInner withIngressConfig(IngressConfig ingressConfig) { + this.ingressConfig = ingressConfig; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworksInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworksInner.java new file mode 100644 index 000000000000..caac574fbefb --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworksInner.java @@ -0,0 +1,829 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.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.servicefabricmesh.ErrorModelException; +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.HTTP; +import retrofit2.http.Path; +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 Networks. + */ +public class NetworksInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private NetworksService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of NetworksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NetworksInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(NetworksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Networks to be + * used by Retrofit to perform actually REST calls. + */ + interface NetworksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.Networks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "networkName", encoded = true) String networkName, @Query("api-version") String apiVersion, @Body NetworkResourceDescriptionInner networkResourceDescription, @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.servicefabricmesh.Networks getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "networkName", encoded = true) String networkName, @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.servicefabricmesh.Networks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks/{networkName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "networkName", encoded = true) String networkName, @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.servicefabricmesh.Networks listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/networks") + 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.servicefabricmesh.Networks list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/networks") + 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.servicefabricmesh.Networks listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.servicefabricmesh.Networks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a network resource. + * Creates a network resource with the specified name and description. If a network with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to create private network and configure public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @param networkResourceDescription Description for creating a network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkResourceDescriptionInner object if successful. + */ + public NetworkResourceDescriptionInner create(String resourceGroupName, String networkName, NetworkResourceDescriptionInner networkResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, networkName, networkResourceDescription).toBlocking().single().body(); + } + + /** + * Creates or updates a network resource. + * Creates a network resource with the specified name and description. If a network with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to create private network and configure public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @param networkResourceDescription Description for creating a network resource. + * @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 resourceGroupName, String networkName, NetworkResourceDescriptionInner networkResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, networkName, networkResourceDescription), serviceCallback); + } + + /** + * Creates or updates a network resource. + * Creates a network resource with the specified name and description. If a network with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to create private network and configure public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @param networkResourceDescription Description for creating a network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable createAsync(String resourceGroupName, String networkName, NetworkResourceDescriptionInner networkResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, networkName, networkResourceDescription).map(new Func1, NetworkResourceDescriptionInner>() { + @Override + public NetworkResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a network resource. + * Creates a network resource with the specified name and description. If a network with the same name already exists, then its description is updated to the one indicated in this request. + Use network resources to create private network and configure public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @param networkResourceDescription Description for creating a network resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String networkName, NetworkResourceDescriptionInner networkResourceDescription) { + 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 (networkName == null) { + throw new IllegalArgumentException("Parameter networkName is required and cannot be null."); + } + if (networkResourceDescription == null) { + throw new IllegalArgumentException("Parameter networkResourceDescription is required and cannot be null."); + } + Validator.validate(networkResourceDescription); + return service.create(this.client.subscriptionId(), resourceGroupName, networkName, this.client.apiVersion(), networkResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the network resource. + * Gets the information about the network resource with a given name. This information includes the network description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NetworkResourceDescriptionInner object if successful. + */ + public NetworkResourceDescriptionInner getByResourceGroup(String resourceGroupName, String networkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkName).toBlocking().single().body(); + } + + /** + * Gets the network resource. + * Gets the information about the network resource with a given name. This information includes the network description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @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 networkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkName), serviceCallback); + } + + /** + * Gets the network resource. + * Gets the information about the network resource with a given name. This information includes the network description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String networkName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, networkName).map(new Func1, NetworkResourceDescriptionInner>() { + @Override + public NetworkResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the network resource. + * Gets the information about the network resource with a given name. This information includes the network description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NetworkResourceDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String networkName) { + 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 (networkName == null) { + throw new IllegalArgumentException("Parameter networkName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, networkName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes the network resource. + * Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String networkName) { + deleteWithServiceResponseAsync(resourceGroupName, networkName).toBlocking().single().body(); + } + + /** + * Deletes the network resource. + * Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @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 deleteAsync(String resourceGroupName, String networkName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, networkName), serviceCallback); + } + + /** + * Deletes the network resource. + * Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String networkName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the network resource. + * Deletes the network resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param networkName The identity of the network. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkName) { + 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 (networkName == null) { + throw new IllegalArgumentException("Parameter networkName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, networkName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<NetworkResourceDescriptionInner> 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 all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @param resourceGroupName Azure resource group 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> 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 all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkResourceDescriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkResourceDescriptionInner> 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 all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkResourceDescriptionInner> 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."); + } + 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<NetworkResourceDescriptionInner> 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 all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @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 all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkResourceDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<NetworkResourceDescriptionInner> 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 all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkResourceDescriptionInner> 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."); + } + 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<NetworkResourceDescriptionInner> 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 all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @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 all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @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<NetworkResourceDescriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + * @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<NetworkResourceDescriptionInner> 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 all the network resources in a given resource group. + * Gets the information about all network resources in a given resource group. The information includes the network description and other runtime properties. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkResourceDescriptionInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<NetworkResourceDescriptionInner> 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 all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @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 all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @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<NetworkResourceDescriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + * @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<NetworkResourceDescriptionInner> 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 all the network resources in a given subscription. + * Gets the information about all network resources in a given subscription. The information includes the network description and other runtime properties. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<NetworkResourceDescriptionInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationResultInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationResultInner.java new file mode 100644 index 000000000000..eb8c41d4098e --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationResultInner.java @@ -0,0 +1,122 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.management.servicefabricmesh.AvailableOperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * List of operations available at the listed Azure resource provider. + */ +public class OperationResultInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private AvailableOperationDisplay display; + + /** + * Origin result. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * The URL to use for getting the next set of results. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public AvailableOperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withDisplay(AvailableOperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get origin result. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set origin result. + * + * @param origin the origin value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get the URL to use for getting the next set of results. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the URL to use for getting the next set of results. + * + * @param nextLink the nextLink value to set + * @return the OperationResultInner object itself. + */ + public OperationResultInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationsInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationsInner.java new file mode 100644 index 000000000000..c8f1e629767f --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationsInner.java @@ -0,0 +1,290 @@ +/** + * 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.servicefabricmesh.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.servicefabricmesh.ErrorModelException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +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.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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl 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, ServiceFabricMeshManagementClientImpl 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.servicefabricmesh.Operations list" }) + @GET("providers/Microsoft.ServiceFabricMesh/operations") + 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.servicefabricmesh.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<OperationResultInner> 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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationResultInner> 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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorModelException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Lists all of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<OperationResultInner> 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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @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<OperationResultInner> 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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + * @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<OperationResultInner> 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 of the available operations. + * Lists all the available operations provided by Service Fabric SeaBreeze resource provider. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationResultInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/PageImpl.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/PageImpl.java new file mode 100644 index 000000000000..34411f2fbd7a --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/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.servicefabricmesh.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("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 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-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ReplicasInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ReplicasInner.java new file mode 100644 index 000000000000..1d9fc1faf85c --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ReplicasInner.java @@ -0,0 +1,424 @@ +/** + * 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.servicefabricmesh.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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 Replicas. + */ +public class ReplicasInner { + /** The Retrofit service to perform REST calls. */ + private ReplicasService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of ReplicasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicasInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(ReplicasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replicas to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.Replicas listByServiceName" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}/services/{serviceName}/replicas") + Observable> listByServiceName(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @Path(value = "serviceName", encoded = true) 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.servicefabricmesh.Replicas get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}/services/{serviceName}/replicas/{replicaName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @Path(value = "serviceName", encoded = true) String serviceName, @Path(value = "replicaName", encoded = true) String replicaName, @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.servicefabricmesh.Replicas listByServiceNameNext" }) + @GET + Observable> listByServiceNameNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ServiceReplicaDescriptionInner> object if successful. + */ + public PagedList listByServiceName(final String resourceGroupName, final String applicationName, final String serviceName) { + ServiceResponse> response = listByServiceNameSinglePageAsync(resourceGroupName, applicationName, serviceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNameNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the 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> listByServiceNameAsync(final String resourceGroupName, final String applicationName, final String serviceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceNameSinglePageAsync(resourceGroupName, applicationName, serviceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNameNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceReplicaDescriptionInner> object + */ + public Observable> listByServiceNameAsync(final String resourceGroupName, final String applicationName, final String serviceName) { + return listByServiceNameWithServiceResponseAsync(resourceGroupName, applicationName, serviceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceReplicaDescriptionInner> object + */ + public Observable>> listByServiceNameWithServiceResponseAsync(final String resourceGroupName, final String applicationName, final String serviceName) { + return listByServiceNameSinglePageAsync(resourceGroupName, applicationName, serviceName) + .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(listByServiceNameNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + ServiceResponse> * @param applicationName The identity of the application. + ServiceResponse> * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceReplicaDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceNameSinglePageAsync(final String resourceGroupName, final String applicationName, final String serviceName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + return service.listByServiceName(this.client.subscriptionId(), resourceGroupName, applicationName, serviceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceNameDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceNameDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a specific replica of a given service. + * Gets the information about the specified replica of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceReplicaDescriptionInner object if successful. + */ + public ServiceReplicaDescriptionInner get(String resourceGroupName, String applicationName, String serviceName, String replicaName) { + return getWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName).toBlocking().single().body(); + } + + /** + * Gets a specific replica of a given service. + * Gets the information about the specified replica of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @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 resourceGroupName, String applicationName, String serviceName, String replicaName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName), serviceCallback); + } + + /** + * Gets a specific replica of a given service. + * Gets the information about the specified replica of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceReplicaDescriptionInner object + */ + public Observable getAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName) { + return getWithServiceResponseAsync(resourceGroupName, applicationName, serviceName, replicaName).map(new Func1, ServiceReplicaDescriptionInner>() { + @Override + public ServiceReplicaDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a specific replica of a given service. + * Gets the information about the specified replica of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @param replicaName The identity of the service replica. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceReplicaDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String applicationName, String serviceName, String replicaName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + if (replicaName == null) { + throw new IllegalArgumentException("Parameter replicaName is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, applicationName, serviceName, replicaName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica instance. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ServiceReplicaDescriptionInner> object if successful. + */ + public PagedList listByServiceNameNext(final String nextPageLink) { + ServiceResponse> response = listByServiceNameNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByServiceNameNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica 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> listByServiceNameNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByServiceNameNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByServiceNameNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica 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<ServiceReplicaDescriptionInner> object + */ + public Observable> listByServiceNameNextAsync(final String nextPageLink) { + return listByServiceNameNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica 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<ServiceReplicaDescriptionInner> object + */ + public Observable>> listByServiceNameNextWithServiceResponseAsync(final String nextPageLink) { + return listByServiceNameNextSinglePageAsync(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(listByServiceNameNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets replicas of a given service. + * Gets the information about all replicas of a given service of an application. The information includes the runtime properties of the replica 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<ServiceReplicaDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByServiceNameNextSinglePageAsync(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.listByServiceNameNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByServiceNameNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByServiceNameNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java new file mode 100644 index 000000000000..20e85fe499b8 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java @@ -0,0 +1,280 @@ +/** + * 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.servicefabricmesh.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 ServiceFabricMeshManagementClientImpl class. + */ +public class ServiceFabricMeshManagementClientImpl 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; + } + + /** The version of the API. This parameter is required and its value must be `2018-07-01-preview`. */ + private String apiVersion; + + /** + * Gets The version of the API. This parameter is required and its value must be `2018-07-01-preview`. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The customer subscription identifier. */ + private String subscriptionId; + + /** + * Gets The customer subscription identifier. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The customer subscription identifier. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ServiceFabricMeshManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** 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 ServiceFabricMeshManagementClientImpl 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 ServiceFabricMeshManagementClientImpl 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 ServiceFabricMeshManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ApplicationsInner object to access its operations. + */ + private ApplicationsInner applications; + + /** + * Gets the ApplicationsInner object to access its operations. + * @return the ApplicationsInner object. + */ + public ApplicationsInner applications() { + return this.applications; + } + + /** + * 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 ReplicasInner object to access its operations. + */ + private ReplicasInner replicas; + + /** + * Gets the ReplicasInner object to access its operations. + * @return the ReplicasInner object. + */ + public ReplicasInner replicas() { + return this.replicas; + } + + /** + * The CodePackagesInner object to access its operations. + */ + private CodePackagesInner codePackages; + + /** + * Gets the CodePackagesInner object to access its operations. + * @return the CodePackagesInner object. + */ + public CodePackagesInner codePackages() { + return this.codePackages; + } + + /** + * 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 NetworksInner object to access its operations. + */ + private NetworksInner networks; + + /** + * Gets the NetworksInner object to access its operations. + * @return the NetworksInner object. + */ + public NetworksInner networks() { + return this.networks; + } + + /** + * The VolumesInner object to access its operations. + */ + private VolumesInner volumes; + + /** + * Gets the VolumesInner object to access its operations. + * @return the VolumesInner object. + */ + public VolumesInner volumes() { + return this.volumes; + } + + /** + * Initializes an instance of ServiceFabricMeshManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ServiceFabricMeshManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ServiceFabricMeshManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ServiceFabricMeshManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ServiceFabricMeshManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ServiceFabricMeshManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2018-07-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.applications = new ApplicationsInner(restClient().retrofit(), this); + this.services = new ServicesInner(restClient().retrofit(), this); + this.replicas = new ReplicasInner(restClient().retrofit(), this); + this.codePackages = new CodePackagesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.networks = new NetworksInner(restClient().retrofit(), this); + this.volumes = new VolumesInner(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(), "ServiceFabricMeshManagementClient", "2018-07-01-preview"); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicaDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicaDescriptionInner.java new file mode 100644 index 000000000000..0e0991d92b01 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicaDescriptionInner.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.servicefabricmesh.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.servicefabricmesh.ServiceReplicaProperties; + +/** + * This type describes a replica of a service resource. + */ +public class ServiceReplicaDescriptionInner extends ServiceReplicaProperties { + /** + * Name of the replica. + */ + @JsonProperty(value = "replicaName") + private String replicaName; + + /** + * Get name of the replica. + * + * @return the replicaName value + */ + public String replicaName() { + return this.replicaName; + } + + /** + * Set name of the replica. + * + * @param replicaName the replicaName value to set + * @return the ServiceReplicaDescriptionInner object itself. + */ + public ServiceReplicaDescriptionInner withReplicaName(String replicaName) { + this.replicaName = replicaName; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceResourceDescriptionInner.java new file mode 100644 index 000000000000..0071716ac859 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceResourceDescriptionInner.java @@ -0,0 +1,233 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.management.servicefabricmesh.OperatingSystemTypes; +import java.util.List; +import com.microsoft.azure.management.servicefabricmesh.ContainerCodePackageProperties; +import com.microsoft.azure.management.servicefabricmesh.NetworkRef; +import com.microsoft.azure.management.servicefabricmesh.DiagnosticsRef; +import com.microsoft.azure.management.servicefabricmesh.HealthState; +import com.microsoft.azure.management.servicefabricmesh.ServiceResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.servicefabricmesh.ManagedProxyResource; + +/** + * This type describes a service resource. + */ +@JsonFlatten +public class ServiceResourceDescriptionInner extends ManagedProxyResource { + /** + * The Operating system type required by the code in service. + * . Possible values include: 'Linux', 'Windows'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * Describes the set of code packages that forms the service. A code + * package describes the container and the properties for running it. All + * the code packages are started together on the same host and share the + * same context (network, process etc.). + */ + @JsonProperty(value = "properties.codePackages", required = true) + private List codePackages; + + /** + * The names of the private networks that this service needs to be part of. + */ + @JsonProperty(value = "properties.networkRefs") + private List networkRefs; + + /** + * Reference to sinks in DiagnosticsDescription. + */ + @JsonProperty(value = "properties.diagnostics") + private DiagnosticsRef diagnostics; + + /** + * User readable description of the service. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The number of replicas of the service to create. Defaults to 1 if not + * specified. + */ + @JsonProperty(value = "properties.replicaCount") + private Integer replicaCount; + + /** + * The health state of a resource such as Application, Service, or Network. + * Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + */ + @JsonProperty(value = "properties.healthState") + private HealthState healthState; + + /** + * Represents the status of the service. Possible values include: + * 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ServiceResourceStatus status; + + /** + * Get the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the Operating system type required by the code in service. + . Possible values include: 'Linux', 'Windows'. + * + * @param osType the osType value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). + * + * @return the codePackages value + */ + public List codePackages() { + return this.codePackages; + } + + /** + * Set describes the set of code packages that forms the service. A code package describes the container and the properties for running it. All the code packages are started together on the same host and share the same context (network, process etc.). + * + * @param codePackages the codePackages value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withCodePackages(List codePackages) { + this.codePackages = codePackages; + return this; + } + + /** + * Get the names of the private networks that this service needs to be part of. + * + * @return the networkRefs value + */ + public List networkRefs() { + return this.networkRefs; + } + + /** + * Set the names of the private networks that this service needs to be part of. + * + * @param networkRefs the networkRefs value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withNetworkRefs(List networkRefs) { + this.networkRefs = networkRefs; + return this; + } + + /** + * Get reference to sinks in DiagnosticsDescription. + * + * @return the diagnostics value + */ + public DiagnosticsRef diagnostics() { + return this.diagnostics; + } + + /** + * Set reference to sinks in DiagnosticsDescription. + * + * @param diagnostics the diagnostics value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withDiagnostics(DiagnosticsRef diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get user readable description of the service. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the service. + * + * @param description the description value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the number of replicas of the service to create. Defaults to 1 if not specified. + * + * @return the replicaCount value + */ + public Integer replicaCount() { + return this.replicaCount; + } + + /** + * Set the number of replicas of the service to create. Defaults to 1 if not specified. + * + * @param replicaCount the replicaCount value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get the health state of a resource such as Application, Service, or Network. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @return the healthState value + */ + public HealthState healthState() { + return this.healthState; + } + + /** + * Set the health state of a resource such as Application, Service, or Network. Possible values include: 'Invalid', 'Ok', 'Warning', 'Error', 'Unknown'. + * + * @param healthState the healthState value to set + * @return the ServiceResourceDescriptionInner object itself. + */ + public ServiceResourceDescriptionInner withHealthState(HealthState healthState) { + this.healthState = healthState; + return this; + } + + /** + * Get represents the status of the service. Possible values include: 'Unknown', 'Active', 'Upgrading', 'Deleting', 'Creating', 'Failed'. + * + * @return the status value + */ + public ServiceResourceStatus status() { + return this.status; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServicesInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServicesInner.java new file mode 100644 index 000000000000..43c7f30ca4c5 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServicesInner.java @@ -0,0 +1,409 @@ +/** + * 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.servicefabricmesh.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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 Services. + */ +public class ServicesInner { + /** The Retrofit service to perform REST calls. */ + private ServicesService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl 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, ServiceFabricMeshManagementClientImpl 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.servicefabricmesh.Services listByApplicationName" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}/services") + Observable> listByApplicationName(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @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.servicefabricmesh.Services get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationName}/services/{serviceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationName", encoded = true) String applicationName, @Path(value = "serviceName", encoded = true) 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.servicefabricmesh.Services listByApplicationNameNext" }) + @GET + Observable> listByApplicationNameNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ServiceResourceDescriptionInner> object if successful. + */ + public PagedList listByApplicationName(final String resourceGroupName, final String applicationName) { + ServiceResponse> response = listByApplicationNameSinglePageAsync(resourceGroupName, applicationName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByApplicationNameNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @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> listByApplicationNameAsync(final String resourceGroupName, final String applicationName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByApplicationNameSinglePageAsync(resourceGroupName, applicationName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByApplicationNameNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceResourceDescriptionInner> object + */ + public Observable> listByApplicationNameAsync(final String resourceGroupName, final String applicationName) { + return listByApplicationNameWithServiceResponseAsync(resourceGroupName, applicationName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service instance. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceResourceDescriptionInner> object + */ + public Observable>> listByApplicationNameWithServiceResponseAsync(final String resourceGroupName, final String applicationName) { + return listByApplicationNameSinglePageAsync(resourceGroupName, applicationName) + .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(listByApplicationNameNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service instance. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + ServiceResponse> * @param applicationName The identity of the application. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ServiceResourceDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByApplicationNameSinglePageAsync(final String resourceGroupName, final String applicationName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + return service.listByApplicationName(this.client.subscriptionId(), resourceGroupName, applicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByApplicationNameDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByApplicationNameDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the service. + * The operation returns the properties of the service. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ServiceResourceDescriptionInner object if successful. + */ + public ServiceResourceDescriptionInner get(String resourceGroupName, String applicationName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, applicationName, serviceName).toBlocking().single().body(); + } + + /** + * Gets the properties of the service. + * The operation returns the properties of the service. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the 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 resourceGroupName, String applicationName, String serviceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, applicationName, serviceName), serviceCallback); + } + + /** + * Gets the properties of the service. + * The operation returns the properties of the service. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceDescriptionInner object + */ + public Observable getAsync(String resourceGroupName, String applicationName, String serviceName) { + return getWithServiceResponseAsync(resourceGroupName, applicationName, serviceName).map(new Func1, ServiceResourceDescriptionInner>() { + @Override + public ServiceResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the service. + * The operation returns the properties of the service. + * + * @param resourceGroupName Azure resource group name + * @param applicationName The identity of the application. + * @param serviceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String applicationName, String serviceName) { + 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 (applicationName == null) { + throw new IllegalArgumentException("Parameter applicationName is required and cannot be null."); + } + if (serviceName == null) { + throw new IllegalArgumentException("Parameter serviceName is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, applicationName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service instance. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ServiceResourceDescriptionInner> object if successful. + */ + public PagedList listByApplicationNameNext(final String nextPageLink) { + ServiceResponse> response = listByApplicationNameNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByApplicationNameNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service 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> listByApplicationNameNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByApplicationNameNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByApplicationNameNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service 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<ServiceResourceDescriptionInner> object + */ + public Observable> listByApplicationNameNextAsync(final String nextPageLink) { + return listByApplicationNameNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service 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<ServiceResourceDescriptionInner> object + */ + public Observable>> listByApplicationNameNextWithServiceResponseAsync(final String nextPageLink) { + return listByApplicationNameNextSinglePageAsync(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(listByApplicationNameNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets services of a given application. + * Gets the information about all services of a given service of an application. The information includes the runtime properties of the service 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<ServiceResourceDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByApplicationNameNextSinglePageAsync(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.listByApplicationNameNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByApplicationNameNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByApplicationNameNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumeResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumeResourceDescriptionInner.java new file mode 100644 index 000000000000..ba2b4d96cd66 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumeResourceDescriptionInner.java @@ -0,0 +1,123 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.management.servicefabricmesh.VolumeProviderParametersAzureFile; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * This type describes a volume resource. + */ +@JsonFlatten +@SkipParentValidation +public class VolumeResourceDescriptionInner extends Resource { + /** + * State of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * User readable description of the volume. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Provider of the volume. + */ + @JsonProperty(value = "properties.provider", required = true) + private String provider; + + /** + * This type describes a volume provided by an Azure Files file share. + */ + @JsonProperty(value = "properties.azureFileParameters") + private VolumeProviderParametersAzureFile azureFileParameters; + + /** + * Creates an instance of VolumeResourceDescriptionInner class. + */ + public VolumeResourceDescriptionInner() { + provider = "SFAzureFile"; + } + + /** + * Get state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get user readable description of the volume. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the volume. + * + * @param description the description value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get provider of the volume. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set provider of the volume. + * + * @param provider the provider value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get this type describes a volume provided by an Azure Files file share. + * + * @return the azureFileParameters value + */ + public VolumeProviderParametersAzureFile azureFileParameters() { + return this.azureFileParameters; + } + + /** + * Set this type describes a volume provided by an Azure Files file share. + * + * @param azureFileParameters the azureFileParameters value to set + * @return the VolumeResourceDescriptionInner object itself. + */ + public VolumeResourceDescriptionInner withAzureFileParameters(VolumeProviderParametersAzureFile azureFileParameters) { + this.azureFileParameters = azureFileParameters; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumesInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumesInner.java new file mode 100644 index 000000000000..5c9726d9dbca --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumesInner.java @@ -0,0 +1,825 @@ +/** + * 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.servicefabricmesh.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.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.servicefabricmesh.ErrorModelException; +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.HTTP; +import retrofit2.http.Path; +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 Volumes. + */ +public class VolumesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private VolumesService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of VolumesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public VolumesInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(VolumesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Volumes to be + * used by Retrofit to perform actually REST calls. + */ + interface VolumesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.Volumes create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes/{volumeName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "volumeName", encoded = true) String volumeName, @Query("api-version") String apiVersion, @Body VolumeResourceDescriptionInner volumeResourceDescription, @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.servicefabricmesh.Volumes getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes/{volumeName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "volumeName", encoded = true) String volumeName, @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.servicefabricmesh.Volumes delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes/{volumeName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "volumeName", encoded = true) String volumeName, @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.servicefabricmesh.Volumes listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/volumes") + 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.servicefabricmesh.Volumes list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/volumes") + 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.servicefabricmesh.Volumes listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@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.servicefabricmesh.Volumes listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a volume resource. + * Creates a volume resource with the specified name and description. If a volume with the same name already exists, then its description is updated to the one indicated in this request. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @param volumeResourceDescription Description for creating a volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeResourceDescriptionInner object if successful. + */ + public VolumeResourceDescriptionInner create(String resourceGroupName, String volumeName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, volumeName, volumeResourceDescription).toBlocking().single().body(); + } + + /** + * Creates or updates a volume resource. + * Creates a volume resource with the specified name and description. If a volume with the same name already exists, then its description is updated to the one indicated in this request. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @param volumeResourceDescription Description for creating a volume resource. + * @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 resourceGroupName, String volumeName, VolumeResourceDescriptionInner volumeResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, volumeName, volumeResourceDescription), serviceCallback); + } + + /** + * Creates or updates a volume resource. + * Creates a volume resource with the specified name and description. If a volume with the same name already exists, then its description is updated to the one indicated in this request. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @param volumeResourceDescription Description for creating a volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable createAsync(String resourceGroupName, String volumeName, VolumeResourceDescriptionInner volumeResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, volumeName, volumeResourceDescription).map(new Func1, VolumeResourceDescriptionInner>() { + @Override + public VolumeResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a volume resource. + * Creates a volume resource with the specified name and description. If a volume with the same name already exists, then its description is updated to the one indicated in this request. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @param volumeResourceDescription Description for creating a volume resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String volumeName, VolumeResourceDescriptionInner volumeResourceDescription) { + 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 (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + if (volumeResourceDescription == null) { + throw new IllegalArgumentException("Parameter volumeResourceDescription is required and cannot be null."); + } + Validator.validate(volumeResourceDescription); + return service.create(this.client.subscriptionId(), resourceGroupName, volumeName, this.client.apiVersion(), volumeResourceDescription, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the volume resource. + * Gets the information about the volume resource with a given name. This information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the VolumeResourceDescriptionInner object if successful. + */ + public VolumeResourceDescriptionInner getByResourceGroup(String resourceGroupName, String volumeName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, volumeName).toBlocking().single().body(); + } + + /** + * Gets the volume resource. + * Gets the information about the volume resource with a given name. This information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @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 volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, volumeName), serviceCallback); + } + + /** + * Gets the volume resource. + * Gets the information about the volume resource with a given name. This information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String volumeName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, volumeName).map(new Func1, VolumeResourceDescriptionInner>() { + @Override + public VolumeResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the volume resource. + * Gets the information about the volume resource with a given name. This information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the VolumeResourceDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String volumeName) { + 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 (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, volumeName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String volumeName) { + deleteWithServiceResponseAsync(resourceGroupName, volumeName).toBlocking().single().body(); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @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 deleteAsync(String resourceGroupName, String volumeName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, volumeName), serviceCallback); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String volumeName) { + return deleteWithServiceResponseAsync(resourceGroupName, volumeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the volume resource. + * Deletes the volume identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param volumeName The identity of the volume. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String volumeName) { + 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 (volumeName == null) { + throw new IllegalArgumentException("Parameter volumeName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, volumeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<VolumeResourceDescriptionInner> 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 all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group 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> 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 all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VolumeResourceDescriptionInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VolumeResourceDescriptionInner> 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 all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VolumeResourceDescriptionInner> 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."); + } + 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<VolumeResourceDescriptionInner> 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 all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @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 all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VolumeResourceDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<VolumeResourceDescriptionInner> 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 all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VolumeResourceDescriptionInner> 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."); + } + 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<VolumeResourceDescriptionInner> 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 all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @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 all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @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<VolumeResourceDescriptionInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + * @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<VolumeResourceDescriptionInner> 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 all the volume resources in a given resource group. + * Gets the information about all volume resources in a given resource group. The information includes the volume description and other runtime information. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VolumeResourceDescriptionInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorModelException 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<VolumeResourceDescriptionInner> 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 all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @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 all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @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<VolumeResourceDescriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + * @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<VolumeResourceDescriptionInner> 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 all the volume resources in a given subscription. + * Gets the information about all volume resources in a given subscription. The information includes the volume description and other runtime information. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<VolumeResourceDescriptionInner> 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorModelException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/package-info.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/package-info.java new file mode 100644 index 000000000000..24463dee89bd --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/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 ServiceFabricMeshManagementClient. + * Service Fabric Mesh Management Client. + */ +package com.microsoft.azure.management.servicefabricmesh.implementation; diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/package-info.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/package-info.java new file mode 100644 index 000000000000..76c407b1c873 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/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 ServiceFabricMeshManagementClient. + * Service Fabric Mesh Management Client. + */ +package com.microsoft.azure.management.servicefabricmesh;