From 787775ffb6a91d43206a23c781a1eb5d2ae9e516 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 18 Jul 2018 09:31:54 -0700 Subject: [PATCH 1/3] Generated from f54b36deb73654dd59a4d4b3571371268b1414ae (#2231) BugFix: defaultSinkRefs is an array of string --- .../ApplicationProperties.java | 204 +++++ .../ApplicationResourceStatus.java | 53 ++ .../AvailableOperationDisplay.java | 121 +++ ...rnalMonitoringPipelineSinkDescription.java | 152 ++++ .../ContainerCodePackageProperties.java | 349 ++++++++ .../servicefabricmesh/ContainerEvent.java | 173 ++++ .../ContainerInstanceView.java | 122 +++ .../servicefabricmesh/ContainerLabel.java | 69 ++ .../servicefabricmesh/ContainerState.java | 148 ++++ .../servicefabricmesh/ContainerVolume.java | 96 ++ .../DiagnosticsDescription.java | 97 ++ .../servicefabricmesh/DiagnosticsRef.java | 71 ++ .../DiagnosticsSinkKind.java | 41 + .../DiagnosticsSinkProperties.java | 78 ++ .../servicefabricmesh/EndpointProperties.java | 69 ++ .../EnvironmentVariable.java | 69 ++ .../servicefabricmesh/ErrorModel.java | 69 ++ .../ErrorModelException.java | 44 + .../servicefabricmesh/HealthState.java | 50 ++ .../ImageRegistryCredential.java | 96 ++ .../servicefabricmesh/IngressConfig.java | 85 ++ .../servicefabricmesh/IngressQoSLevel.java | 38 + .../Layer4IngressConfig.java | 148 ++++ .../ManagedProxyResource.java | 20 + .../servicefabricmesh/NetworkProperties.java | 95 ++ .../servicefabricmesh/NetworkRef.java | 43 + .../OperatingSystemTypes.java | 41 + .../ProvisionedResourceProperties.java | 32 + .../servicefabricmesh/ResourceLimits.java | 71 ++ .../servicefabricmesh/ResourceRequests.java | 74 ++ .../ResourceRequirements.java | 69 ++ .../ServiceReplicaProperties.java | 128 +++ .../ServiceResourceStatus.java | 53 ++ .../management/servicefabricmesh/Setting.java | 69 ++ .../servicefabricmesh/VolumeProperties.java | 102 +++ .../VolumeProviderParametersAzureFile.java | 95 ++ .../ApplicationResourceDescriptionInner.java | 226 +++++ .../implementation/ApplicationsInner.java | 829 ++++++++++++++++++ .../implementation/CodePackagesInner.java | 274 ++++++ .../implementation/ContainerLogsInner.java | 43 + .../NetworkResourceDescriptionInner.java | 116 +++ .../implementation/NetworksInner.java | 829 ++++++++++++++++++ .../implementation/OperationResultInner.java | 122 +++ .../implementation/OperationsInner.java | 290 ++++++ .../implementation/PageImpl.java | 75 ++ .../implementation/ReplicasInner.java | 424 +++++++++ ...ServiceFabricMeshManagementClientImpl.java | 280 ++++++ .../ServiceReplicaDescriptionInner.java | 44 + .../ServiceResourceDescriptionInner.java | 233 +++++ .../implementation/ServicesInner.java | 409 +++++++++ .../VolumeResourceDescriptionInner.java | 123 +++ .../implementation/VolumesInner.java | 825 +++++++++++++++++ .../implementation/package-info.java | 11 + .../servicefabricmesh/package-info.java | 11 + 54 files changed, 8498 insertions(+) create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationResourceStatus.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AvailableOperationDisplay.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AzureInternalMonitoringPipelineSinkDescription.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerCodePackageProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerEvent.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerInstanceView.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerLabel.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerState.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ContainerVolume.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsDescription.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsRef.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/DiagnosticsSinkProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EnvironmentVariable.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModel.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorModelException.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HealthState.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ImageRegistryCredential.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressConfig.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/IngressQoSLevel.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Layer4IngressConfig.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ManagedProxyResource.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkRef.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemTypes.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ProvisionedResourceProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceLimits.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequests.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceRequirements.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceReplicaProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceResourceStatus.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/Setting.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProviderParametersAzureFile.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ApplicationsInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/CodePackagesInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ContainerLogsInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworkResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/NetworksInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationResultInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/OperationsInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/PageImpl.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ReplicasInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceFabricMeshManagementClientImpl.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicaDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServicesInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumeResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/VolumesInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/package-info.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/package-info.java 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..fb73ff7f6976 --- /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 List 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 List 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(List 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; From 55e933a43be8d38c5cfa1fe8b2162ac03a1b92fa Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 26 Nov 2018 11:13:42 -0800 Subject: [PATCH 2/3] Generated from 900022b1ef3374db36243518a867b1b4d1dc8b31 (#2642) typo: seperate -> separate --- .../AddRemoveReplicaScalingMechanism.java | 103 +++ .../ApplicationScopedVolume.java | 43 + ...icationScopedVolumeCreationParameters.java | 51 ++ ...tionParametersServiceFabricVolumeDisk.java | 48 + .../ApplicationScopedVolumeKind.java | 38 + .../AutoScalingMechanism.java | 25 + .../AutoScalingMechanismKind.java | 38 + .../servicefabricmesh/AutoScalingMetric.java | 25 + .../AutoScalingMetricKind.java | 38 + .../servicefabricmesh/AutoScalingPolicy.java | 96 ++ .../AutoScalingResourceMetric.java | 52 ++ .../AutoScalingResourceMetricName.java | 41 + .../servicefabricmesh/AutoScalingTrigger.java | 24 + .../AutoScalingTriggerKind.java | 38 + .../AverageLoadScalingTrigger.java | 127 +++ .../servicefabricmesh/EndpointRef.java | 43 + .../servicefabricmesh/ErrorDetailsModel.java | 69 ++ .../servicefabricmesh/ErrorErrorModel.java | 122 +++ .../servicefabricmesh/GatewayDestination.java | 95 ++ .../servicefabricmesh/GatewayProperties.java | 195 +++++ .../servicefabricmesh/HeaderMatchType.java | 38 + .../servicefabricmesh/HttpConfig.java | 97 ++ .../servicefabricmesh/HttpHostConfig.java | 72 ++ .../servicefabricmesh/HttpRouteConfig.java | 95 ++ .../HttpRouteMatchHeader.java | 95 ++ .../servicefabricmesh/HttpRouteMatchPath.java | 103 +++ .../servicefabricmesh/HttpRouteMatchRule.java | 70 ++ .../InlinedValueSecretResourceProperties.java | 24 + .../LocalNetworkResourceProperties.java | 48 + .../servicefabricmesh/NetworkKind.java | 38 + .../NetworkResourceProperties.java | 82 ++ .../NetworkResourcePropertiesBase.java | 25 + .../OperatingSystemType.java | 41 + .../ReliableCollectionsRef.java | 73 ++ .../servicefabricmesh/ResourceStatus.java | 53 ++ .../servicefabricmesh/SecretKind.java | 38 + .../SecretResourceProperties.java | 110 +++ .../SecretResourcePropertiesBase.java | 24 + .../SecretValueProperties.java | 43 + .../servicefabricmesh/ServiceProperties.java | 161 ++++ .../servicefabricmesh/SizeTypes.java | 44 + .../servicefabricmesh/TcpConfig.java | 96 ++ .../servicefabricmesh/VolumeProvider.java | 38 + .../servicefabricmesh/VolumeReference.java | 96 ++ .../GatewayResourceDescriptionInner.java | 217 +++++ .../implementation/GatewaysInner.java | 827 ++++++++++++++++++ .../SecretResourceDescriptionInner.java | 45 + .../implementation/SecretValueInner.java | 43 + .../SecretValueResourceDescriptionInner.java | 62 ++ .../implementation/SecretValuesInner.java | 719 +++++++++++++++ .../implementation/SecretsInner.java | 827 ++++++++++++++++++ .../implementation/ServiceReplicasInner.java | 424 +++++++++ 52 files changed, 6079 insertions(+) create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AddRemoveReplicaScalingMechanism.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolume.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParameters.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanism.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanismKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetric.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetricKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingPolicy.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetric.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetricName.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTrigger.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTriggerKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AverageLoadScalingTrigger.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointRef.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorDetailsModel.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorErrorModel.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayDestination.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HeaderMatchType.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpConfig.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteConfig.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchHeader.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchPath.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchRule.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/InlinedValueSecretResourceProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/LocalNetworkResourceProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourceProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourcePropertiesBase.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemType.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ReliableCollectionsRef.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceStatus.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretKind.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourceProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourcePropertiesBase.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretValueProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceProperties.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SizeTypes.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/TcpConfig.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProvider.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeReference.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewayResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewaysInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueResourceDescriptionInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretsInner.java create mode 100644 azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicasInner.java diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AddRemoveReplicaScalingMechanism.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AddRemoveReplicaScalingMechanism.java new file mode 100644 index 000000000000..b3d53b9a5dd8 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AddRemoveReplicaScalingMechanism.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the horizontal auto scaling mechanism that adds or removes + * replicas (containers or container groups). + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AddRemoveReplica") +public class AddRemoveReplicaScalingMechanism extends AutoScalingMechanism { + /** + * Minimum number of containers (scale down won't be performed below this + * number). + */ + @JsonProperty(value = "minCount", required = true) + private int minCount; + + /** + * Maximum number of containers (scale up won't be performed above this + * number). + */ + @JsonProperty(value = "maxCount", required = true) + private int maxCount; + + /** + * Each time auto scaling is performed, this number of containers will be + * added or removed. + */ + @JsonProperty(value = "scaleIncrement", required = true) + private int scaleIncrement; + + /** + * Get minimum number of containers (scale down won't be performed below this number). + * + * @return the minCount value + */ + public int minCount() { + return this.minCount; + } + + /** + * Set minimum number of containers (scale down won't be performed below this number). + * + * @param minCount the minCount value to set + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withMinCount(int minCount) { + this.minCount = minCount; + return this; + } + + /** + * Get maximum number of containers (scale up won't be performed above this number). + * + * @return the maxCount value + */ + public int maxCount() { + return this.maxCount; + } + + /** + * Set maximum number of containers (scale up won't be performed above this number). + * + * @param maxCount the maxCount value to set + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withMaxCount(int maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + * Get each time auto scaling is performed, this number of containers will be added or removed. + * + * @return the scaleIncrement value + */ + public int scaleIncrement() { + return this.scaleIncrement; + } + + /** + * Set each time auto scaling is performed, this number of containers will be added or removed. + * + * @param scaleIncrement the scaleIncrement value to set + * @return the AddRemoveReplicaScalingMechanism object itself. + */ + public AddRemoveReplicaScalingMechanism withScaleIncrement(int scaleIncrement) { + this.scaleIncrement = scaleIncrement; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolume.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolume.java new file mode 100644 index 000000000000..108edd46333b --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolume.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 volume whose lifetime is scoped to the application's lifetime. + */ +public class ApplicationScopedVolume extends VolumeReference { + /** + * Describes parameters for creating application-scoped volumes. + */ + @JsonProperty(value = "creationParameters", required = true) + private ApplicationScopedVolumeCreationParameters creationParameters; + + /** + * Get describes parameters for creating application-scoped volumes. + * + * @return the creationParameters value + */ + public ApplicationScopedVolumeCreationParameters creationParameters() { + return this.creationParameters; + } + + /** + * Set describes parameters for creating application-scoped volumes. + * + * @param creationParameters the creationParameters value to set + * @return the ApplicationScopedVolume object itself. + */ + public ApplicationScopedVolume withCreationParameters(ApplicationScopedVolumeCreationParameters creationParameters) { + this.creationParameters = creationParameters; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParameters.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParameters.java new file mode 100644 index 000000000000..0303a42f17a7 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParameters.java @@ -0,0 +1,51 @@ +/** + * 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; + +/** + * Describes parameters for creating application-scoped volumes. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ApplicationScopedVolumeCreationParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ServiceFabricVolumeDisk", value = ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.class) +}) +public class ApplicationScopedVolumeCreationParameters { + /** + * User readable description of the volume. + */ + @JsonProperty(value = "description") + private String description; + + /** + * 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 ApplicationScopedVolumeCreationParameters object itself. + */ + public ApplicationScopedVolumeCreationParameters withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java new file mode 100644 index 000000000000..cd8359be8ee7 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk.java @@ -0,0 +1,48 @@ +/** + * 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; + +/** + * Describes parameters for creating application-scoped volumes provided by + * Service Fabric Volume Disks. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("ServiceFabricVolumeDisk") +public class ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk extends ApplicationScopedVolumeCreationParameters { + /** + * Volume size. Possible values include: 'Small', 'Medium', 'Large'. + */ + @JsonProperty(value = "sizeDisk", required = true) + private SizeTypes sizeDisk; + + /** + * Get volume size. Possible values include: 'Small', 'Medium', 'Large'. + * + * @return the sizeDisk value + */ + public SizeTypes sizeDisk() { + return this.sizeDisk; + } + + /** + * Set volume size. Possible values include: 'Small', 'Medium', 'Large'. + * + * @param sizeDisk the sizeDisk value to set + * @return the ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk object itself. + */ + public ApplicationScopedVolumeCreationParametersServiceFabricVolumeDisk withSizeDisk(SizeTypes sizeDisk) { + this.sizeDisk = sizeDisk; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeKind.java new file mode 100644 index 000000000000..a4e79ceaf0d0 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ApplicationScopedVolumeKind.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 ApplicationScopedVolumeKind. + */ +public final class ApplicationScopedVolumeKind extends ExpandableStringEnum { + /** Static value ServiceFabricVolumeDisk for ApplicationScopedVolumeKind. */ + public static final ApplicationScopedVolumeKind SERVICE_FABRIC_VOLUME_DISK = fromString("ServiceFabricVolumeDisk"); + + /** + * Creates or finds a ApplicationScopedVolumeKind from its string representation. + * @param name a name to look for + * @return the corresponding ApplicationScopedVolumeKind + */ + @JsonCreator + public static ApplicationScopedVolumeKind fromString(String name) { + return fromString(name, ApplicationScopedVolumeKind.class); + } + + /** + * @return known ApplicationScopedVolumeKind values + */ + public static Collection values() { + return values(ApplicationScopedVolumeKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanism.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanism.java new file mode 100644 index 000000000000..8cb5d2998bfe --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanism.java @@ -0,0 +1,25 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the mechanism for performing auto scaling operation. Derived + * classes will describe the actual mechanism. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AutoScalingMechanism") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AddRemoveReplica", value = AddRemoveReplicaScalingMechanism.class) +}) +public class AutoScalingMechanism { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanismKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanismKind.java new file mode 100644 index 000000000000..bd74314a20ba --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMechanismKind.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 AutoScalingMechanismKind. + */ +public final class AutoScalingMechanismKind extends ExpandableStringEnum { + /** Static value AddRemoveReplica for AutoScalingMechanismKind. */ + public static final AutoScalingMechanismKind ADD_REMOVE_REPLICA = fromString("AddRemoveReplica"); + + /** + * Creates or finds a AutoScalingMechanismKind from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingMechanismKind + */ + @JsonCreator + public static AutoScalingMechanismKind fromString(String name) { + return fromString(name, AutoScalingMechanismKind.class); + } + + /** + * @return known AutoScalingMechanismKind values + */ + public static Collection values() { + return values(AutoScalingMechanismKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetric.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetric.java new file mode 100644 index 000000000000..887fcdef79d7 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetric.java @@ -0,0 +1,25 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the metric that is used for triggering auto scaling operation. + * Derived classes will describe resources or metrics. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AutoScalingMetric") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Resource", value = AutoScalingResourceMetric.class) +}) +public class AutoScalingMetric { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetricKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetricKind.java new file mode 100644 index 000000000000..3053403d4e9c --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingMetricKind.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 AutoScalingMetricKind. + */ +public final class AutoScalingMetricKind extends ExpandableStringEnum { + /** Static value Resource for AutoScalingMetricKind. */ + public static final AutoScalingMetricKind RESOURCE = fromString("Resource"); + + /** + * Creates or finds a AutoScalingMetricKind from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingMetricKind + */ + @JsonCreator + public static AutoScalingMetricKind fromString(String name) { + return fromString(name, AutoScalingMetricKind.class); + } + + /** + * @return known AutoScalingMetricKind values + */ + public static Collection values() { + return values(AutoScalingMetricKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingPolicy.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingPolicy.java new file mode 100644 index 000000000000..6adef9a1d5f4 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingPolicy.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 the auto scaling policy. + */ +public class AutoScalingPolicy { + /** + * The name of the auto scaling policy. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Determines when auto scaling operation will be invoked. + */ + @JsonProperty(value = "trigger", required = true) + private AutoScalingTrigger trigger; + + /** + * The mechanism that is used to scale when auto scaling operation is + * invoked. + */ + @JsonProperty(value = "mechanism", required = true) + private AutoScalingMechanism mechanism; + + /** + * Get the name of the auto scaling policy. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the auto scaling policy. + * + * @param name the name value to set + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withName(String name) { + this.name = name; + return this; + } + + /** + * Get determines when auto scaling operation will be invoked. + * + * @return the trigger value + */ + public AutoScalingTrigger trigger() { + return this.trigger; + } + + /** + * Set determines when auto scaling operation will be invoked. + * + * @param trigger the trigger value to set + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withTrigger(AutoScalingTrigger trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the mechanism that is used to scale when auto scaling operation is invoked. + * + * @return the mechanism value + */ + public AutoScalingMechanism mechanism() { + return this.mechanism; + } + + /** + * Set the mechanism that is used to scale when auto scaling operation is invoked. + * + * @param mechanism the mechanism value to set + * @return the AutoScalingPolicy object itself. + */ + public AutoScalingPolicy withMechanism(AutoScalingMechanism mechanism) { + this.mechanism = mechanism; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetric.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetric.java new file mode 100644 index 000000000000..5e996a8c3a45 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetric.java @@ -0,0 +1,52 @@ +/** + * 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; + +/** + * Describes the resource that is used for triggering auto scaling. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Resource") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "ProxyResource", value = ProxyResource.class), + @JsonSubTypes.Type(name = "TrackedResource", value = TrackedResource.class) +}) +public class AutoScalingResourceMetric extends AutoScalingMetric { + /** + * Name of the resource. Possible values include: 'cpu', 'memoryInGB'. + */ + @JsonProperty(value = "name", required = true) + private AutoScalingResourceMetricName name; + + /** + * Get name of the resource. Possible values include: 'cpu', 'memoryInGB'. + * + * @return the name value + */ + public AutoScalingResourceMetricName name() { + return this.name; + } + + /** + * Set name of the resource. Possible values include: 'cpu', 'memoryInGB'. + * + * @param name the name value to set + * @return the AutoScalingResourceMetric object itself. + */ + public AutoScalingResourceMetric withName(AutoScalingResourceMetricName name) { + this.name = name; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetricName.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetricName.java new file mode 100644 index 000000000000..eb0c2a23379d --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingResourceMetricName.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 AutoScalingResourceMetricName. + */ +public final class AutoScalingResourceMetricName extends ExpandableStringEnum { + /** Static value cpu for AutoScalingResourceMetricName. */ + public static final AutoScalingResourceMetricName CPU = fromString("cpu"); + + /** Static value memoryInGB for AutoScalingResourceMetricName. */ + public static final AutoScalingResourceMetricName MEMORY_IN_GB = fromString("memoryInGB"); + + /** + * Creates or finds a AutoScalingResourceMetricName from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingResourceMetricName + */ + @JsonCreator + public static AutoScalingResourceMetricName fromString(String name) { + return fromString(name, AutoScalingResourceMetricName.class); + } + + /** + * @return known AutoScalingResourceMetricName values + */ + public static Collection values() { + return values(AutoScalingResourceMetricName.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTrigger.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTrigger.java new file mode 100644 index 000000000000..7a5f651c1e3a --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTrigger.java @@ -0,0 +1,24 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Describes the trigger for performing auto scaling operation. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AutoScalingTrigger") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "AverageLoad", value = AverageLoadScalingTrigger.class) +}) +public class AutoScalingTrigger { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTriggerKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTriggerKind.java new file mode 100644 index 000000000000..eb8bebf94638 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AutoScalingTriggerKind.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 AutoScalingTriggerKind. + */ +public final class AutoScalingTriggerKind extends ExpandableStringEnum { + /** Static value AverageLoad for AutoScalingTriggerKind. */ + public static final AutoScalingTriggerKind AVERAGE_LOAD = fromString("AverageLoad"); + + /** + * Creates or finds a AutoScalingTriggerKind from its string representation. + * @param name a name to look for + * @return the corresponding AutoScalingTriggerKind + */ + @JsonCreator + public static AutoScalingTriggerKind fromString(String name) { + return fromString(name, AutoScalingTriggerKind.class); + } + + /** + * @return known AutoScalingTriggerKind values + */ + public static Collection values() { + return values(AutoScalingTriggerKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AverageLoadScalingTrigger.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AverageLoadScalingTrigger.java new file mode 100644 index 000000000000..027dd6c1e5ad --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/AverageLoadScalingTrigger.java @@ -0,0 +1,127 @@ +/** + * 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; + +/** + * Describes the average load trigger used for auto scaling. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("AverageLoad") +public class AverageLoadScalingTrigger extends AutoScalingTrigger { + /** + * Description of the metric that is used for scaling. + */ + @JsonProperty(value = "metric", required = true) + private AutoScalingMetric metric; + + /** + * Lower load threshold (if average load is below this threshold, service + * will scale down). + */ + @JsonProperty(value = "lowerLoadThreshold", required = true) + private double lowerLoadThreshold; + + /** + * Upper load threshold (if average load is above this threshold, service + * will scale up). + */ + @JsonProperty(value = "upperLoadThreshold", required = true) + private double upperLoadThreshold; + + /** + * Scale interval that indicates how often will this trigger be checked. + */ + @JsonProperty(value = "scaleIntervalInSeconds", required = true) + private int scaleIntervalInSeconds; + + /** + * Get description of the metric that is used for scaling. + * + * @return the metric value + */ + public AutoScalingMetric metric() { + return this.metric; + } + + /** + * Set description of the metric that is used for scaling. + * + * @param metric the metric value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withMetric(AutoScalingMetric metric) { + this.metric = metric; + return this; + } + + /** + * Get lower load threshold (if average load is below this threshold, service will scale down). + * + * @return the lowerLoadThreshold value + */ + public double lowerLoadThreshold() { + return this.lowerLoadThreshold; + } + + /** + * Set lower load threshold (if average load is below this threshold, service will scale down). + * + * @param lowerLoadThreshold the lowerLoadThreshold value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withLowerLoadThreshold(double lowerLoadThreshold) { + this.lowerLoadThreshold = lowerLoadThreshold; + return this; + } + + /** + * Get upper load threshold (if average load is above this threshold, service will scale up). + * + * @return the upperLoadThreshold value + */ + public double upperLoadThreshold() { + return this.upperLoadThreshold; + } + + /** + * Set upper load threshold (if average load is above this threshold, service will scale up). + * + * @param upperLoadThreshold the upperLoadThreshold value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withUpperLoadThreshold(double upperLoadThreshold) { + this.upperLoadThreshold = upperLoadThreshold; + return this; + } + + /** + * Get scale interval that indicates how often will this trigger be checked. + * + * @return the scaleIntervalInSeconds value + */ + public int scaleIntervalInSeconds() { + return this.scaleIntervalInSeconds; + } + + /** + * Set scale interval that indicates how often will this trigger be checked. + * + * @param scaleIntervalInSeconds the scaleIntervalInSeconds value to set + * @return the AverageLoadScalingTrigger object itself. + */ + public AverageLoadScalingTrigger withScaleIntervalInSeconds(int scaleIntervalInSeconds) { + this.scaleIntervalInSeconds = scaleIntervalInSeconds; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointRef.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointRef.java new file mode 100644 index 000000000000..1103dc370746 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/EndpointRef.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 reference to a service endpoint. + */ +public class EndpointRef { + /** + * Name of the endpoint. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get name of the endpoint. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the endpoint. + * + * @param name the name value to set + * @return the EndpointRef object itself. + */ + public EndpointRef withName(String name) { + this.name = name; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorDetailsModel.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorDetailsModel.java new file mode 100644 index 000000000000..799287bf78da --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorDetailsModel.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; + +/** + * Error model details information. + */ +public class ErrorDetailsModel { + /** + * The code property. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * Error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorDetailsModel object itself. + */ + public ErrorDetailsModel withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ErrorDetailsModel object itself. + */ + public ErrorDetailsModel withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorErrorModel.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorErrorModel.java new file mode 100644 index 000000000000..06942e899580 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ErrorErrorModel.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; + +/** + * Error model information. + */ +public class ErrorErrorModel { + /** + * The code property. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * Error message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The innerError property. + */ + @JsonProperty(value = "innerError") + private String innerError; + + /** + * List of error message details. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorErrorModel object itself. + */ + public ErrorErrorModel withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ErrorErrorModel object itself. + */ + public ErrorErrorModel withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the innerError value. + * + * @return the innerError value + */ + public String innerError() { + return this.innerError; + } + + /** + * Set the innerError value. + * + * @param innerError the innerError value to set + * @return the ErrorErrorModel object itself. + */ + public ErrorErrorModel withInnerError(String innerError) { + this.innerError = innerError; + return this; + } + + /** + * Get list of error message details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set list of error message details. + * + * @param details the details value to set + * @return the ErrorErrorModel object itself. + */ + public ErrorErrorModel withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayDestination.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayDestination.java new file mode 100644 index 000000000000..31cc1eb81f8b --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayDestination.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 destination endpoint for routing traffic. + */ +public class GatewayDestination { + /** + * Name of the service fabric Mesh application. + */ + @JsonProperty(value = "applicationName", required = true) + private String applicationName; + + /** + * service that contains the endpoint. + */ + @JsonProperty(value = "serviceName", required = true) + private String serviceName; + + /** + * name of the endpoint in the service. + */ + @JsonProperty(value = "endpointName", required = true) + private String endpointName; + + /** + * Get name of the service fabric Mesh application. + * + * @return the applicationName value + */ + public String applicationName() { + return this.applicationName; + } + + /** + * Set name of the service fabric Mesh application. + * + * @param applicationName the applicationName value to set + * @return the GatewayDestination object itself. + */ + public GatewayDestination withApplicationName(String applicationName) { + this.applicationName = applicationName; + return this; + } + + /** + * Get service that contains the endpoint. + * + * @return the serviceName value + */ + public String serviceName() { + return this.serviceName; + } + + /** + * Set service that contains the endpoint. + * + * @param serviceName the serviceName value to set + * @return the GatewayDestination object itself. + */ + public GatewayDestination withServiceName(String serviceName) { + this.serviceName = serviceName; + return this; + } + + /** + * Get name of the endpoint in the service. + * + * @return the endpointName value + */ + public String endpointName() { + return this.endpointName; + } + + /** + * Set name of the endpoint in the service. + * + * @param endpointName the endpointName value to set + * @return the GatewayDestination object itself. + */ + public GatewayDestination withEndpointName(String endpointName) { + this.endpointName = endpointName; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayProperties.java new file mode 100644 index 000000000000..9b82a058ddab --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/GatewayProperties.java @@ -0,0 +1,195 @@ +/** + * 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 properties of a gateway resource. + */ +public class GatewayProperties { + /** + * User readable description of the gateway. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Network the gateway should listen on for requests. + */ + @JsonProperty(value = "sourceNetwork", required = true) + private NetworkRef sourceNetwork; + + /** + * Network that the Application is using. + */ + @JsonProperty(value = "destinationNetwork", required = true) + private NetworkRef destinationNetwork; + + /** + * Configuration for tcp connectivity for this gateway. + */ + @JsonProperty(value = "tcp") + private List tcp; + + /** + * Configuration for http connectivity for this gateway. + */ + @JsonProperty(value = "http") + private List http; + + /** + * Status of the resource. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the gateway. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * IP address of the gateway. This is populated in the response and is + * ignored for incoming requests. + */ + @JsonProperty(value = "ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * Get user readable description of the gateway. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the gateway. + * + * @param description the description value to set + * @return the GatewayProperties object itself. + */ + public GatewayProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network the gateway should listen on for requests. + * + * @return the sourceNetwork value + */ + public NetworkRef sourceNetwork() { + return this.sourceNetwork; + } + + /** + * Set network the gateway should listen on for requests. + * + * @param sourceNetwork the sourceNetwork value to set + * @return the GatewayProperties object itself. + */ + public GatewayProperties withSourceNetwork(NetworkRef sourceNetwork) { + this.sourceNetwork = sourceNetwork; + return this; + } + + /** + * Get network that the Application is using. + * + * @return the destinationNetwork value + */ + public NetworkRef destinationNetwork() { + return this.destinationNetwork; + } + + /** + * Set network that the Application is using. + * + * @param destinationNetwork the destinationNetwork value to set + * @return the GatewayProperties object itself. + */ + public GatewayProperties withDestinationNetwork(NetworkRef destinationNetwork) { + this.destinationNetwork = destinationNetwork; + return this; + } + + /** + * Get configuration for tcp connectivity for this gateway. + * + * @return the tcp value + */ + public List tcp() { + return this.tcp; + } + + /** + * Set configuration for tcp connectivity for this gateway. + * + * @param tcp the tcp value to set + * @return the GatewayProperties object itself. + */ + public GatewayProperties withTcp(List tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get configuration for http connectivity for this gateway. + * + * @return the http value + */ + public List http() { + return this.http; + } + + /** + * Set configuration for http connectivity for this gateway. + * + * @param http the http value to set + * @return the GatewayProperties object itself. + */ + public GatewayProperties withHttp(List http) { + this.http = http; + return this; + } + + /** + * Get status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the gateway. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get iP address of the gateway. This is populated in the response and is ignored for incoming requests. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HeaderMatchType.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HeaderMatchType.java new file mode 100644 index 000000000000..c16f3a40312e --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HeaderMatchType.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 HeaderMatchType. + */ +public final class HeaderMatchType extends ExpandableStringEnum { + /** Static value exact for HeaderMatchType. */ + public static final HeaderMatchType EXACT = fromString("exact"); + + /** + * Creates or finds a HeaderMatchType from its string representation. + * @param name a name to look for + * @return the corresponding HeaderMatchType + */ + @JsonCreator + public static HeaderMatchType fromString(String name) { + return fromString(name, HeaderMatchType.class); + } + + /** + * @return known HeaderMatchType values + */ + public static Collection values() { + return values(HeaderMatchType.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpConfig.java new file mode 100644 index 000000000000..2274ce332f9d --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpConfig.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 http configuration for external connectivity for this network. + */ +public class HttpConfig { + /** + * http gateway config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Specifies the port at which the service endpoint below needs to be + * exposed. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * description for routing. + */ + @JsonProperty(value = "hosts", required = true) + private List hosts; + + /** + * Get http gateway config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set http gateway config name. + * + * @param name the name value to set + * @return the HttpConfig object itself. + */ + public HttpConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the port at which the service endpoint below needs to be exposed. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set specifies the port at which the service endpoint below needs to be exposed. + * + * @param port the port value to set + * @return the HttpConfig object itself. + */ + public HttpConfig withPort(int port) { + this.port = port; + return this; + } + + /** + * Get description for routing. + * + * @return the hosts value + */ + public List hosts() { + return this.hosts; + } + + /** + * Set description for routing. + * + * @param hosts the hosts value to set + * @return the HttpConfig object itself. + */ + public HttpConfig withHosts(List hosts) { + this.hosts = hosts; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java new file mode 100644 index 000000000000..79107fdc96b5 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java @@ -0,0 +1,72 @@ +/** + * 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 hostname properties for http routing. + */ +public class HttpHostConfig { + /** + * http hostname config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Route information to use for routing. Routes are processed in the order + * they are specified. Specify routes that are more specific before routes + * that can hamdle general cases. + */ + @JsonProperty(value = "routes", required = true) + private List routes; + + /** + * Get http hostname config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set http hostname config name. + * + * @param name the name value to set + * @return the HttpHostConfig object itself. + */ + public HttpHostConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can hamdle general cases. + * + * @return the routes value + */ + public List routes() { + return this.routes; + } + + /** + * Set route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can hamdle general cases. + * + * @param routes the routes value to set + * @return the HttpHostConfig object itself. + */ + public HttpHostConfig withRoutes(List routes) { + this.routes = routes; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteConfig.java new file mode 100644 index 000000000000..499ff5672a51 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteConfig.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 the hostname properties for http routing. + */ +public class HttpRouteConfig { + /** + * http route name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Describes a rule for http route matching. + */ + @JsonProperty(value = "match", required = true) + private HttpRouteMatchRule match; + + /** + * Describes destination endpoint for routing traffic. + */ + @JsonProperty(value = "destination", required = true) + private GatewayDestination destination; + + /** + * Get http route name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set http route name. + * + * @param name the name value to set + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get describes a rule for http route matching. + * + * @return the match value + */ + public HttpRouteMatchRule match() { + return this.match; + } + + /** + * Set describes a rule for http route matching. + * + * @param match the match value to set + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withMatch(HttpRouteMatchRule match) { + this.match = match; + return this; + } + + /** + * Get describes destination endpoint for routing traffic. + * + * @return the destination value + */ + public GatewayDestination destination() { + return this.destination; + } + + /** + * Set describes destination endpoint for routing traffic. + * + * @param destination the destination value to set + * @return the HttpRouteConfig object itself. + */ + public HttpRouteConfig withDestination(GatewayDestination destination) { + this.destination = destination; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchHeader.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchHeader.java new file mode 100644 index 000000000000..2838b26accaa --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchHeader.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 header information for http route matching. + */ +public class HttpRouteMatchHeader { + /** + * Name of header to match in request. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Value of header to match in request. + */ + @JsonProperty(value = "value") + private String value; + + /** + * how to match header value. Possible values include: 'exact'. + */ + @JsonProperty(value = "type") + private HeaderMatchType type; + + /** + * Get name of header to match in request. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of header to match in request. + * + * @param name the name value to set + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withName(String name) { + this.name = name; + return this; + } + + /** + * Get value of header to match in request. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set value of header to match in request. + * + * @param value the value value to set + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withValue(String value) { + this.value = value; + return this; + } + + /** + * Get how to match header value. Possible values include: 'exact'. + * + * @return the type value + */ + public HeaderMatchType type() { + return this.type; + } + + /** + * Set how to match header value. Possible values include: 'exact'. + * + * @param type the type value to set + * @return the HttpRouteMatchHeader object itself. + */ + public HttpRouteMatchHeader withType(HeaderMatchType type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchPath.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchPath.java new file mode 100644 index 000000000000..8b95d2464d35 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchPath.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Path to match for routing. + */ +public class HttpRouteMatchPath { + /** + * Uri path to match for request. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * replacement string for matched part of the Uri. + */ + @JsonProperty(value = "rewrite") + private String rewrite; + + /** + * how to match value in the Uri. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of HttpRouteMatchPath class. + * @param value uri path to match for request. + */ + public HttpRouteMatchPath() { + type = "prefix"; + } + + /** + * Get uri path to match for request. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set uri path to match for request. + * + * @param value the value value to set + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withValue(String value) { + this.value = value; + return this; + } + + /** + * Get replacement string for matched part of the Uri. + * + * @return the rewrite value + */ + public String rewrite() { + return this.rewrite; + } + + /** + * Set replacement string for matched part of the Uri. + * + * @param rewrite the rewrite value to set + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withRewrite(String rewrite) { + this.rewrite = rewrite; + return this; + } + + /** + * Get how to match value in the Uri. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set how to match value in the Uri. + * + * @param type the type value to set + * @return the HttpRouteMatchPath object itself. + */ + public HttpRouteMatchPath withType(String type) { + this.type = type; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchRule.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchRule.java new file mode 100644 index 000000000000..36a094d67449 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpRouteMatchRule.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabricmesh; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a rule for http route matching. + */ +public class HttpRouteMatchRule { + /** + * Path to match for routing. + */ + @JsonProperty(value = "path", required = true) + private HttpRouteMatchPath path; + + /** + * headers and their values to match in request. + */ + @JsonProperty(value = "headers") + private List headers; + + /** + * Get path to match for routing. + * + * @return the path value + */ + public HttpRouteMatchPath path() { + return this.path; + } + + /** + * Set path to match for routing. + * + * @param path the path value to set + * @return the HttpRouteMatchRule object itself. + */ + public HttpRouteMatchRule withPath(HttpRouteMatchPath path) { + this.path = path; + return this; + } + + /** + * Get headers and their values to match in request. + * + * @return the headers value + */ + public List headers() { + return this.headers; + } + + /** + * Set headers and their values to match in request. + * + * @param headers the headers value to set + * @return the HttpRouteMatchRule object itself. + */ + public HttpRouteMatchRule withHeaders(List headers) { + this.headers = headers; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/InlinedValueSecretResourceProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/InlinedValueSecretResourceProperties.java new file mode 100644 index 000000000000..b80d7a35116c --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/InlinedValueSecretResourceProperties.java @@ -0,0 +1,24 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Describes the properties of a secret resource whose value is provided + * explicitly as plaintext. The secret resource may have multiple values, each + * being uniquely versioned. The secret value of each version is stored + * encrypted, and delivered as plaintext into the context of applications + * referencing it. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("inlinedValue") +public class InlinedValueSecretResourceProperties extends SecretResourceProperties { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/LocalNetworkResourceProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/LocalNetworkResourceProperties.java new file mode 100644 index 000000000000..f6140f4bd40e --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/LocalNetworkResourceProperties.java @@ -0,0 +1,48 @@ +/** + * 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; + +/** + * Information about a Service Fabric container network local to a single + * Service Fabric cluster. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("Local") +public class LocalNetworkResourceProperties extends NetworkResourceProperties { + /** + * Address space for the local container network. + */ + @JsonProperty(value = "networkAddressPrefix") + private String networkAddressPrefix; + + /** + * Get address space for the local container network. + * + * @return the networkAddressPrefix value + */ + public String networkAddressPrefix() { + return this.networkAddressPrefix; + } + + /** + * Set address space for the local container network. + * + * @param networkAddressPrefix the networkAddressPrefix value to set + * @return the LocalNetworkResourceProperties object itself. + */ + public LocalNetworkResourceProperties withNetworkAddressPrefix(String networkAddressPrefix) { + this.networkAddressPrefix = networkAddressPrefix; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkKind.java new file mode 100644 index 000000000000..ea3aaa803fdb --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkKind.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 NetworkKind. + */ +public final class NetworkKind extends ExpandableStringEnum { + /** Static value Local for NetworkKind. */ + public static final NetworkKind LOCAL = fromString("Local"); + + /** + * Creates or finds a NetworkKind from its string representation. + * @param name a name to look for + * @return the corresponding NetworkKind + */ + @JsonCreator + public static NetworkKind fromString(String name) { + return fromString(name, NetworkKind.class); + } + + /** + * @return known NetworkKind values + */ + public static Collection values() { + return values(NetworkKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourceProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourceProperties.java new file mode 100644 index 000000000000..a188970d7816 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourceProperties.java @@ -0,0 +1,82 @@ +/** + * 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; + +/** + * Describes properties of a network resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("NetworkResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Local", value = LocalNetworkResourceProperties.class) +}) +public class NetworkResourceProperties extends NetworkResourcePropertiesBase { + /** + * User readable description of the network. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Status of the network. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the network. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * 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 NetworkResourceProperties object itself. + */ + public NetworkResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get status of the network. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the network. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourcePropertiesBase.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourcePropertiesBase.java new file mode 100644 index 000000000000..f3a9175cfb3d --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/NetworkResourcePropertiesBase.java @@ -0,0 +1,25 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This type describes the properties of a network resource, including its + * kind. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("NetworkResourcePropertiesBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "NetworkResourceProperties", value = NetworkResourceProperties.class) +}) +public class NetworkResourcePropertiesBase extends ProvisionedResourceProperties { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemType.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemType.java new file mode 100644 index 000000000000..9576422d8ce5 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/OperatingSystemType.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 OperatingSystemType. + */ +public final class OperatingSystemType extends ExpandableStringEnum { + /** Static value Linux for OperatingSystemType. */ + public static final OperatingSystemType LINUX = fromString("Linux"); + + /** Static value Windows for OperatingSystemType. */ + public static final OperatingSystemType WINDOWS = fromString("Windows"); + + /** + * Creates or finds a OperatingSystemType from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemType + */ + @JsonCreator + public static OperatingSystemType fromString(String name) { + return fromString(name, OperatingSystemType.class); + } + + /** + * @return known OperatingSystemType values + */ + public static Collection values() { + return values(OperatingSystemType.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ReliableCollectionsRef.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ReliableCollectionsRef.java new file mode 100644 index 000000000000..1fc9e1f2c880 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ReliableCollectionsRef.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabricmesh; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Specifying this parameter adds support for reliable collections. + */ +public class ReliableCollectionsRef { + /** + * Name of ReliableCollection resource. Right now it's not used and you can + * use any string. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * False (the default) if ReliableCollections state is persisted to disk as + * usual. True if you do not want to persist state, in which case + * replication is still enabled and you can use ReliableCollections as + * distributed cache. + */ + @JsonProperty(value = "doNotPersistState") + private Boolean doNotPersistState; + + /** + * Get name of ReliableCollection resource. Right now it's not used and you can use any string. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of ReliableCollection resource. Right now it's not used and you can use any string. + * + * @param name the name value to set + * @return the ReliableCollectionsRef object itself. + */ + public ReliableCollectionsRef withName(String name) { + this.name = name; + return this; + } + + /** + * Get false (the default) if ReliableCollections state is persisted to disk as usual. True if you do not want to persist state, in which case replication is still enabled and you can use ReliableCollections as distributed cache. + * + * @return the doNotPersistState value + */ + public Boolean doNotPersistState() { + return this.doNotPersistState; + } + + /** + * Set false (the default) if ReliableCollections state is persisted to disk as usual. True if you do not want to persist state, in which case replication is still enabled and you can use ReliableCollections as distributed cache. + * + * @param doNotPersistState the doNotPersistState value to set + * @return the ReliableCollectionsRef object itself. + */ + public ReliableCollectionsRef withDoNotPersistState(Boolean doNotPersistState) { + this.doNotPersistState = doNotPersistState; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceStatus.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceStatus.java new file mode 100644 index 000000000000..e33ab7972f2b --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ResourceStatus.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 ResourceStatus. + */ +public final class ResourceStatus extends ExpandableStringEnum { + /** Static value Unknown for ResourceStatus. */ + public static final ResourceStatus UNKNOWN = fromString("Unknown"); + + /** Static value Ready for ResourceStatus. */ + public static final ResourceStatus READY = fromString("Ready"); + + /** Static value Upgrading for ResourceStatus. */ + public static final ResourceStatus UPGRADING = fromString("Upgrading"); + + /** Static value Creating for ResourceStatus. */ + public static final ResourceStatus CREATING = fromString("Creating"); + + /** Static value Deleting for ResourceStatus. */ + public static final ResourceStatus DELETING = fromString("Deleting"); + + /** Static value Failed for ResourceStatus. */ + public static final ResourceStatus FAILED = fromString("Failed"); + + /** + * Creates or finds a ResourceStatus from its string representation. + * @param name a name to look for + * @return the corresponding ResourceStatus + */ + @JsonCreator + public static ResourceStatus fromString(String name) { + return fromString(name, ResourceStatus.class); + } + + /** + * @return known ResourceStatus values + */ + public static Collection values() { + return values(ResourceStatus.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretKind.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretKind.java new file mode 100644 index 000000000000..c7f0f2dfb205 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretKind.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 SecretKind. + */ +public final class SecretKind extends ExpandableStringEnum { + /** Static value inlinedValue for SecretKind. */ + public static final SecretKind INLINED_VALUE = fromString("inlinedValue"); + + /** + * Creates or finds a SecretKind from its string representation. + * @param name a name to look for + * @return the corresponding SecretKind + */ + @JsonCreator + public static SecretKind fromString(String name) { + return fromString(name, SecretKind.class); + } + + /** + * @return known SecretKind values + */ + public static Collection values() { + return values(SecretKind.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourceProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourceProperties.java new file mode 100644 index 000000000000..152cec0f3dde --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourceProperties.java @@ -0,0 +1,110 @@ +/** + * 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; + +/** + * Describes the properties of a secret resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecretResourceProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "inlinedValue", value = InlinedValueSecretResourceProperties.class) +}) +public class SecretResourceProperties extends SecretResourcePropertiesBase { + /** + * User readable description of the secret. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Status of the resource. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the secret. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * The type of the content stored in the secret value. The value of this + * property is opaque to Service Fabric. Once set, the value of this + * property cannot be changed. + */ + @JsonProperty(value = "contentType") + private String contentType; + + /** + * Get user readable description of the secret. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the secret. + * + * @param description the description value to set + * @return the SecretResourceProperties object itself. + */ + public SecretResourceProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the secret. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get the type of the content stored in the secret value. The value of this property is opaque to Service Fabric. Once set, the value of this property cannot be changed. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the type of the content stored in the secret value. The value of this property is opaque to Service Fabric. Once set, the value of this property cannot be changed. + * + * @param contentType the contentType value to set + * @return the SecretResourceProperties object itself. + */ + public SecretResourceProperties withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourcePropertiesBase.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourcePropertiesBase.java new file mode 100644 index 000000000000..c5134f69af91 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretResourcePropertiesBase.java @@ -0,0 +1,24 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * This type describes the properties of a secret resource, including its kind. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +@JsonTypeName("SecretResourcePropertiesBase") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "SecretResourceProperties", value = SecretResourceProperties.class) +}) +public class SecretResourcePropertiesBase extends ProvisionedResourceProperties { +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretValueProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretValueProperties.java new file mode 100644 index 000000000000..3ba2919204e5 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SecretValueProperties.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; + +/** + * This type describes properties of secret value resource. + */ +public class SecretValueProperties { + /** + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the actual value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the actual value of the secret. + * + * @param value the value value to set + * @return the SecretValueProperties object itself. + */ + public SecretValueProperties withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceProperties.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceProperties.java new file mode 100644 index 000000000000..2c2344fe8293 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/ServiceProperties.java @@ -0,0 +1,161 @@ +/** + * 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 properties of a service resource. + */ +public class ServiceProperties { + /** + * User readable description of the service. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The number of replicas of the service to create. Defaults to 1 if not + * specified. + */ + @JsonProperty(value = "replicaCount") + private Integer replicaCount; + + /** + * Auto scaling policies. + */ + @JsonProperty(value = "autoScalingPolicies") + private List autoScalingPolicies; + + /** + * Status of the service. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the service. + */ + @JsonProperty(value = "statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * 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 service's health state is not 'Ok', this additional details + * from service fabric Health Manager for the user to know why the service + * is marked unhealthy. + */ + @JsonProperty(value = "unhealthyEvaluation", access = JsonProperty.Access.WRITE_ONLY) + private String unhealthyEvaluation; + + /** + * 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 ServiceProperties object itself. + */ + public ServiceProperties 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 ServiceProperties object itself. + */ + public ServiceProperties withReplicaCount(Integer replicaCount) { + this.replicaCount = replicaCount; + return this; + } + + /** + * Get auto scaling policies. + * + * @return the autoScalingPolicies value + */ + public List autoScalingPolicies() { + return this.autoScalingPolicies; + } + + /** + * Set auto scaling policies. + * + * @param autoScalingPolicies the autoScalingPolicies value to set + * @return the ServiceProperties object itself. + */ + public ServiceProperties withAutoScalingPolicies(List autoScalingPolicies) { + this.autoScalingPolicies = autoScalingPolicies; + return this; + } + + /** + * Get status of the service. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the service. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * 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 service's health state is not 'Ok', this additional details from service fabric Health Manager for the user to know why the service is marked unhealthy. + * + * @return the unhealthyEvaluation value + */ + public String unhealthyEvaluation() { + return this.unhealthyEvaluation; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SizeTypes.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SizeTypes.java new file mode 100644 index 000000000000..2fe03ec41a9b --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/SizeTypes.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 java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SizeTypes. + */ +public final class SizeTypes extends ExpandableStringEnum { + /** Static value Small for SizeTypes. */ + public static final SizeTypes SMALL = fromString("Small"); + + /** Static value Medium for SizeTypes. */ + public static final SizeTypes MEDIUM = fromString("Medium"); + + /** Static value Large for SizeTypes. */ + public static final SizeTypes LARGE = fromString("Large"); + + /** + * Creates or finds a SizeTypes from its string representation. + * @param name a name to look for + * @return the corresponding SizeTypes + */ + @JsonCreator + public static SizeTypes fromString(String name) { + return fromString(name, SizeTypes.class); + } + + /** + * @return known SizeTypes values + */ + public static Collection values() { + return values(SizeTypes.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/TcpConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/TcpConfig.java new file mode 100644 index 000000000000..4cbd2deaa5ef --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/TcpConfig.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 the tcp configuration for external connectivity for this network. + */ +public class TcpConfig { + /** + * tcp gateway config name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Specifies the port at which the service endpoint below needs to be + * exposed. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Describes destination endpoint for routing traffic. + */ + @JsonProperty(value = "destination", required = true) + private GatewayDestination destination; + + /** + * Get tcp gateway config name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set tcp gateway config name. + * + * @param name the name value to set + * @return the TcpConfig object itself. + */ + public TcpConfig withName(String name) { + this.name = name; + return this; + } + + /** + * Get specifies the port at which the service endpoint below needs to be exposed. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set specifies the port at which the service endpoint below needs to be exposed. + * + * @param port the port value to set + * @return the TcpConfig object itself. + */ + public TcpConfig withPort(int port) { + this.port = port; + return this; + } + + /** + * Get describes destination endpoint for routing traffic. + * + * @return the destination value + */ + public GatewayDestination destination() { + return this.destination; + } + + /** + * Set describes destination endpoint for routing traffic. + * + * @param destination the destination value to set + * @return the TcpConfig object itself. + */ + public TcpConfig withDestination(GatewayDestination destination) { + this.destination = destination; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProvider.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProvider.java new file mode 100644 index 000000000000..f96cef64b666 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeProvider.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 VolumeProvider. + */ +public final class VolumeProvider extends ExpandableStringEnum { + /** Static value SFAzureFile for VolumeProvider. */ + public static final VolumeProvider SFAZURE_FILE = fromString("SFAzureFile"); + + /** + * Creates or finds a VolumeProvider from its string representation. + * @param name a name to look for + * @return the corresponding VolumeProvider + */ + @JsonCreator + public static VolumeProvider fromString(String name) { + return fromString(name, VolumeProvider.class); + } + + /** + * @return known VolumeProvider values + */ + public static Collection values() { + return values(VolumeProvider.class); + } +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeReference.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeReference.java new file mode 100644 index 000000000000..6c65b941a0ab --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/VolumeReference.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 a reference to a volume resource. + */ +public class VolumeReference { + /** + * Name of the volume being referenced. + */ + @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 being referenced. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set name of the volume being referenced. + * + * @param name the name value to set + * @return the VolumeReference object itself. + */ + public VolumeReference 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 VolumeReference object itself. + */ + public VolumeReference 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 VolumeReference object itself. + */ + public VolumeReference withDestinationPath(String destinationPath) { + this.destinationPath = destinationPath; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewayResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewayResourceDescriptionInner.java new file mode 100644 index 000000000000..4beea8230eb5 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewayResourceDescriptionInner.java @@ -0,0 +1,217 @@ +/** + * 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.NetworkRef; +import java.util.List; +import com.microsoft.azure.management.servicefabricmesh.TcpConfig; +import com.microsoft.azure.management.servicefabricmesh.HttpConfig; +import com.microsoft.azure.management.servicefabricmesh.ResourceStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * This type describes a gateway resource. + */ +@JsonFlatten +public class GatewayResourceDescriptionInner extends Resource { + /** + * State of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * User readable description of the gateway. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * Network the gateway should listen on for requests. + */ + @JsonProperty(value = "properties.sourceNetwork", required = true) + private NetworkRef sourceNetwork; + + /** + * Network that the Application is using. + */ + @JsonProperty(value = "properties.destinationNetwork", required = true) + private NetworkRef destinationNetwork; + + /** + * Configuration for tcp connectivity for this gateway. + */ + @JsonProperty(value = "properties.tcp") + private List tcp; + + /** + * Configuration for http connectivity for this gateway. + */ + @JsonProperty(value = "properties.http") + private List http; + + /** + * Status of the resource. Possible values include: 'Unknown', 'Ready', + * 'Upgrading', 'Creating', 'Deleting', 'Failed'. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private ResourceStatus status; + + /** + * Gives additional information about the current status of the gateway. + */ + @JsonProperty(value = "properties.statusDetails", access = JsonProperty.Access.WRITE_ONLY) + private String statusDetails; + + /** + * IP address of the gateway. This is populated in the response and is + * ignored for incoming requests. + */ + @JsonProperty(value = "properties.ipAddress", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddress; + + /** + * Get state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get user readable description of the gateway. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set user readable description of the gateway. + * + * @param description the description value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get network the gateway should listen on for requests. + * + * @return the sourceNetwork value + */ + public NetworkRef sourceNetwork() { + return this.sourceNetwork; + } + + /** + * Set network the gateway should listen on for requests. + * + * @param sourceNetwork the sourceNetwork value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withSourceNetwork(NetworkRef sourceNetwork) { + this.sourceNetwork = sourceNetwork; + return this; + } + + /** + * Get network that the Application is using. + * + * @return the destinationNetwork value + */ + public NetworkRef destinationNetwork() { + return this.destinationNetwork; + } + + /** + * Set network that the Application is using. + * + * @param destinationNetwork the destinationNetwork value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withDestinationNetwork(NetworkRef destinationNetwork) { + this.destinationNetwork = destinationNetwork; + return this; + } + + /** + * Get configuration for tcp connectivity for this gateway. + * + * @return the tcp value + */ + public List tcp() { + return this.tcp; + } + + /** + * Set configuration for tcp connectivity for this gateway. + * + * @param tcp the tcp value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withTcp(List tcp) { + this.tcp = tcp; + return this; + } + + /** + * Get configuration for http connectivity for this gateway. + * + * @return the http value + */ + public List http() { + return this.http; + } + + /** + * Set configuration for http connectivity for this gateway. + * + * @param http the http value to set + * @return the GatewayResourceDescriptionInner object itself. + */ + public GatewayResourceDescriptionInner withHttp(List http) { + this.http = http; + return this; + } + + /** + * Get status of the resource. Possible values include: 'Unknown', 'Ready', 'Upgrading', 'Creating', 'Deleting', 'Failed'. + * + * @return the status value + */ + public ResourceStatus status() { + return this.status; + } + + /** + * Get gives additional information about the current status of the gateway. + * + * @return the statusDetails value + */ + public String statusDetails() { + return this.statusDetails; + } + + /** + * Get iP address of the gateway. This is populated in the response and is ignored for incoming requests. + * + * @return the ipAddress value + */ + public String ipAddress() { + return this.ipAddress; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewaysInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewaysInner.java new file mode 100644 index 000000000000..308cc3e1a871 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/GatewaysInner.java @@ -0,0 +1,827 @@ +/** + * 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 Gateways. + */ +public class GatewaysInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private GatewaysService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of GatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GatewaysInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(GatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Gateways to be + * used by Retrofit to perform actually REST calls. + */ + interface GatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.Gateways create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways/{gatewayResourceName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "gatewayResourceName", encoded = true) String gatewayResourceName, @Query("api-version") String apiVersion, @Body GatewayResourceDescriptionInner gatewayResourceDescription, @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.Gateways getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways/{gatewayResourceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "gatewayResourceName", encoded = true) String gatewayResourceName, @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.Gateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways/{gatewayResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "gatewayResourceName", encoded = true) String gatewayResourceName, @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.Gateways listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/gateways") + 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.Gateways list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/gateways") + 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.Gateways 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.Gateways listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a gateway resource. + * Creates a gateway resource with the specified name, description and properties. If a gateway resource with the same name exists, then it is updated with the specified description and properties. Use gateway resources to create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway 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 GatewayResourceDescriptionInner object if successful. + */ + public GatewayResourceDescriptionInner create(String resourceGroupName, String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, gatewayResourceName, gatewayResourceDescription).toBlocking().single().body(); + } + + /** + * Creates or updates a gateway resource. + * Creates a gateway resource with the specified name, description and properties. If a gateway resource with the same name exists, then it is updated with the specified description and properties. Use gateway resources to create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway 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 gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, gatewayResourceName, gatewayResourceDescription), serviceCallback); + } + + /** + * Creates or updates a gateway resource. + * Creates a gateway resource with the specified name, description and properties. If a gateway resource with the same name exists, then it is updated with the specified description and properties. Use gateway resources to create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable createAsync(String resourceGroupName, String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, gatewayResourceName, gatewayResourceDescription).map(new Func1, GatewayResourceDescriptionInner>() { + @Override + public GatewayResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a gateway resource. + * Creates a gateway resource with the specified name, description and properties. If a gateway resource with the same name exists, then it is updated with the specified description and properties. Use gateway resources to create a gateway for public connectivity for services within your application. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @param gatewayResourceDescription Description for creating a Gateway resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String gatewayResourceName, GatewayResourceDescriptionInner gatewayResourceDescription) { + 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 (gatewayResourceName == null) { + throw new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null."); + } + if (gatewayResourceDescription == null) { + throw new IllegalArgumentException("Parameter gatewayResourceDescription is required and cannot be null."); + } + Validator.validate(gatewayResourceDescription); + return service.create(this.client.subscriptionId(), resourceGroupName, gatewayResourceName, this.client.apiVersion(), gatewayResourceDescription, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the gateway resource with the given name. + * Gets the information about the gateway resource with the given name. The information include the description and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @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 GatewayResourceDescriptionInner object if successful. + */ + public GatewayResourceDescriptionInner getByResourceGroup(String resourceGroupName, String gatewayResourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayResourceName).toBlocking().single().body(); + } + + /** + * Gets the gateway resource with the given name. + * Gets the information about the gateway resource with the given name. The information include the description and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @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 gatewayResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayResourceName), serviceCallback); + } + + /** + * Gets the gateway resource with the given name. + * Gets the information about the gateway resource with the given name. The information include the description and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String gatewayResourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, gatewayResourceName).map(new Func1, GatewayResourceDescriptionInner>() { + @Override + public GatewayResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the gateway resource with the given name. + * Gets the information about the gateway resource with the given name. The information include the description and other properties of the gateway. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GatewayResourceDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String gatewayResourceName) { + 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 (gatewayResourceName == null) { + throw new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, gatewayResourceName, 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 gateway resource. + * Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @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 gatewayResourceName) { + deleteWithServiceResponseAsync(resourceGroupName, gatewayResourceName).toBlocking().single().body(); + } + + /** + * Deletes the gateway resource. + * Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @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 gatewayResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, gatewayResourceName), serviceCallback); + } + + /** + * Deletes the gateway resource. + * Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String gatewayResourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, gatewayResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the gateway resource. + * Deletes the gateway resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param gatewayResourceName The identity of the gateway. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String gatewayResourceName) { + 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 (gatewayResourceName == null) { + throw new IllegalArgumentException("Parameter gatewayResourceName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, gatewayResourceName, 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(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GatewayResourceDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given resource group. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the Gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + * @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<GatewayResourceDescriptionInner> 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 gateway resources in a given subscription. + * Gets the information about all gateway resources in a given resource group. The information include the description and other properties of the gateway. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<GatewayResourceDescriptionInner> 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/SecretResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretResourceDescriptionInner.java new file mode 100644 index 000000000000..0ed7fcc0db77 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretResourceDescriptionInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabricmesh.implementation; + +import com.microsoft.azure.management.servicefabricmesh.SecretResourceProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Resource; + +/** + * This type describes a secret resource. + */ +public class SecretResourceDescriptionInner extends Resource { + /** + * Describes the properties of a secret resource. + */ + @JsonProperty(value = "properties", required = true) + private SecretResourceProperties properties; + + /** + * Get describes the properties of a secret resource. + * + * @return the properties value + */ + public SecretResourceProperties properties() { + return this.properties; + } + + /** + * Set describes the properties of a secret resource. + * + * @param properties the properties value to set + * @return the SecretResourceDescriptionInner object itself. + */ + public SecretResourceDescriptionInner withProperties(SecretResourceProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueInner.java new file mode 100644 index 000000000000..5e490a7201cf --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueInner.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; + +/** + * This type represents the unencrypted value of the secret. + */ +public class SecretValueInner { + /** + * The actual value of the secret. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the actual value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the actual value of the secret. + * + * @param value the value value to set + * @return the SecretValueInner object itself. + */ + public SecretValueInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueResourceDescriptionInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueResourceDescriptionInner.java new file mode 100644 index 000000000000..e0e32bba0171 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValueResourceDescriptionInner.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.servicefabricmesh.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * This type describes a value of a secret resource. The name of this resource + * is the version identifier corresponding to this secret value. + */ +@JsonFlatten +public class SecretValueResourceDescriptionInner extends Resource { + /** + * State of the resource. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The actual value of the secret. + */ + @JsonProperty(value = "properties.value") + private String value; + + /** + * Get state of the resource. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the actual value of the secret. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the actual value of the secret. + * + * @param value the value value to set + * @return the SecretValueResourceDescriptionInner object itself. + */ + public SecretValueResourceDescriptionInner withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java new file mode 100644 index 000000000000..5a82df27d107 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java @@ -0,0 +1,719 @@ +/** + * 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.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.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SecretValues. + */ +public class SecretValuesInner { + /** The Retrofit service to perform REST calls. */ + private SecretValuesService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of SecretValuesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecretValuesInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(SecretValuesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SecretValues to be + * used by Retrofit to perform actually REST calls. + */ + interface SecretValuesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.SecretValues create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @Query("api-version") String apiVersion, @Body SecretValueResourceDescriptionInner secretValueResourceDescription, @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.SecretValues get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @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.SecretValues delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @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.SecretValues list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @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.SecretValues listValue" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}/values/{secretValueResourceName}/list_value") + Observable> listValue(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @Path(value = "secretValueResourceName", encoded = true) String secretValueResourceName, @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.SecretValues listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * Creates a new value of the specified secret resource. The name of the value is typically the version identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret 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 SecretValueResourceDescriptionInner object if successful. + */ + public SecretValueResourceDescriptionInner create(String resourceGroupName, String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription).toBlocking().single().body(); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * Creates a new value of the specified secret resource. The name of the value is typically the version identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret 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 secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription), serviceCallback); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * Creates a new value of the specified secret resource. The name of the value is typically the version identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable createAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName, secretValueResourceDescription).map(new Func1, SecretValueResourceDescriptionInner>() { + @Override + public SecretValueResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Adds the specified value as a new version of the specified secret resource. + * Creates a new value of the specified secret resource. The name of the value is typically the version identifier. Once created the value cannot be changed. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @param secretValueResourceDescription Description for creating a value of a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName, SecretValueResourceDescriptionInner secretValueResourceDescription) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + if (secretValueResourceDescription == null) { + throw new IllegalArgumentException("Parameter secretValueResourceDescription is required and cannot be null."); + } + Validator.validate(secretValueResourceDescription); + return service.create(this.client.subscriptionId(), resourceGroupName, secretResourceName, secretValueResourceName, this.client.apiVersion(), secretValueResourceDescription, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the specified secret value resource. + * Get the information about the specified named secret value resources. The information does not include the actual value of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @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 SecretValueResourceDescriptionInner object if successful. + */ + public SecretValueResourceDescriptionInner get(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return getWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName).toBlocking().single().body(); + } + + /** + * Gets the specified secret value resource. + * Get the information about the specified named secret value resources. The information does not include the actual value of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @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 secretResourceName, String secretValueResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName), serviceCallback); + } + + /** + * Gets the specified secret value resource. + * Get the information about the specified named secret value resources. The information does not include the actual value of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable getAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return getWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName).map(new Func1, SecretValueResourceDescriptionInner>() { + @Override + public SecretValueResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified secret value resource. + * Get the information about the specified named secret value resources. The information does not include the actual value of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueResourceDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, secretResourceName, secretValueResourceName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Deletes the specified value of the named secret resource. + * Deletes the secret value resource identified by the name. The name of the resource is typically the version associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @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 secretResourceName, String secretValueResourceName) { + deleteWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName).toBlocking().single().body(); + } + + /** + * Deletes the specified value of the named secret resource. + * Deletes the secret value resource identified by the name. The name of the resource is typically the version associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @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 secretResourceName, String secretValueResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName), serviceCallback); + } + + /** + * Deletes the specified value of the named secret resource. + * Deletes the secret value resource identified by the name. The name of the resource is typically the version associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified value of the named secret resource. + * Deletes the secret value resource identified by the name. The name of the resource is typically the version associated with that value. Deletion will fail if the specified value is in use. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, secretResourceName, secretValueResourceName, 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(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret 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 PagedList<SecretValueResourceDescriptionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String secretResourceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, secretResourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret 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> listAsync(final String resourceGroupName, final String secretResourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, secretResourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretValueResourceDescriptionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String secretResourceName) { + return listWithServiceResponseAsync(resourceGroupName, secretResourceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretValueResourceDescriptionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String secretResourceName) { + return listSinglePageAsync(resourceGroupName, secretResourceName) + .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)); + } + }); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + ServiceResponse> * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretValueResourceDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String secretResourceName) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, secretResourceName, 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); + } + + /** + * Lists the specified value of the secret resource. + * Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @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 SecretValueInner object if successful. + */ + public SecretValueInner listValue(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return listValueWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName).toBlocking().single().body(); + } + + /** + * Lists the specified value of the secret resource. + * Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @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 listValueAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listValueWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName), serviceCallback); + } + + /** + * Lists the specified value of the secret resource. + * Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueInner object + */ + public Observable listValueAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + return listValueWithServiceResponseAsync(resourceGroupName, secretResourceName, secretValueResourceName).map(new Func1, SecretValueInner>() { + @Override + public SecretValueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the specified value of the secret resource. + * Lists the decrypted value of the specified named value of the secret resource. This is a privileged operation. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretValueResourceName The name of the secret resource value which is typically the version identifier for the value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretValueInner object + */ + public Observable> listValueWithServiceResponseAsync(String resourceGroupName, String secretResourceName, String secretValueResourceName) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretValueResourceName == null) { + throw new IllegalArgumentException("Parameter secretValueResourceName is required and cannot be null."); + } + return service.listValue(this.client.subscriptionId(), resourceGroupName, secretResourceName, secretValueResourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listValueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listValueDelegate(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); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @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<SecretValueResourceDescriptionInner> 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(); + } + }; + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @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); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @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<SecretValueResourceDescriptionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + * @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<SecretValueResourceDescriptionInner> 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)); + } + }); + } + + /** + * List names of all values of the the specified secret resource. + * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretValueResourceDescriptionInner> 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/SecretsInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretsInner.java new file mode 100644 index 000000000000..f228439b22a7 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretsInner.java @@ -0,0 +1,827 @@ +/** + * 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 Secrets. + */ +public class SecretsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private SecretsService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of SecretsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SecretsInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(SecretsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Secrets to be + * used by Retrofit to perform actually REST calls. + */ + interface SecretsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.Secrets create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @Query("api-version") String apiVersion, @Body SecretResourceDescriptionInner secretResourceDescription, @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.Secrets getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @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.Secrets delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets/{secretResourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "secretResourceName", encoded = true) String secretResourceName, @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.Secrets listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/secrets") + 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.Secrets list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabricMesh/secrets") + 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.Secrets 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.Secrets listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates or updates a secret resource. + * Creates a secret resource with the specified name, description and properties. If a secret resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret 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 SecretResourceDescriptionInner object if successful. + */ + public SecretResourceDescriptionInner create(String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, secretResourceName, secretResourceDescription).toBlocking().single().body(); + } + + /** + * Creates or updates a secret resource. + * Creates a secret resource with the specified name, description and properties. If a secret resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret 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 secretResourceName, SecretResourceDescriptionInner secretResourceDescription, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, secretResourceName, secretResourceDescription), serviceCallback); + } + + /** + * Creates or updates a secret resource. + * Creates a secret resource with the specified name, description and properties. If a secret resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable createAsync(String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + return createWithServiceResponseAsync(resourceGroupName, secretResourceName, secretResourceDescription).map(new Func1, SecretResourceDescriptionInner>() { + @Override + public SecretResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a secret resource. + * Creates a secret resource with the specified name, description and properties. If a secret resource with the same name exists, then it is updated with the specified description and properties. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @param secretResourceDescription Description for creating a secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String secretResourceName, SecretResourceDescriptionInner secretResourceDescription) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + if (secretResourceDescription == null) { + throw new IllegalArgumentException("Parameter secretResourceDescription is required and cannot be null."); + } + Validator.validate(secretResourceDescription); + return service.create(this.client.subscriptionId(), resourceGroupName, secretResourceName, this.client.apiVersion(), secretResourceDescription, 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()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets the secret resource with the given name. + * Gets the information about the secret resource with the given name. The information include the description and other properties of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret 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 SecretResourceDescriptionInner object if successful. + */ + public SecretResourceDescriptionInner getByResourceGroup(String resourceGroupName, String secretResourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, secretResourceName).toBlocking().single().body(); + } + + /** + * Gets the secret resource with the given name. + * Gets the information about the secret resource with the given name. The information include the description and other properties of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret 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 getByResourceGroupAsync(String resourceGroupName, String secretResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, secretResourceName), serviceCallback); + } + + /** + * Gets the secret resource with the given name. + * Gets the information about the secret resource with the given name. The information include the description and other properties of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String secretResourceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, secretResourceName).map(new Func1, SecretResourceDescriptionInner>() { + @Override + public SecretResourceDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the secret resource with the given name. + * Gets the information about the secret resource with the given name. The information include the description and other properties of the secret. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SecretResourceDescriptionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String secretResourceName) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, secretResourceName, 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 secret resource. + * Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret 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 + */ + public void delete(String resourceGroupName, String secretResourceName) { + deleteWithServiceResponseAsync(resourceGroupName, secretResourceName).toBlocking().single().body(); + } + + /** + * Deletes the secret resource. + * Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret 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 deleteAsync(String resourceGroupName, String secretResourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, secretResourceName), serviceCallback); + } + + /** + * Deletes the secret resource. + * Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String secretResourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, secretResourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the secret resource. + * Deletes the secret resource identified by the name. + * + * @param resourceGroupName Azure resource group name + * @param secretResourceName The name of the secret resource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String secretResourceName) { + 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 (secretResourceName == null) { + throw new IllegalArgumentException("Parameter secretResourceName is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, secretResourceName, 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(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorModelException.class) + .build(response); + } + + /** + * Gets all the secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + ServiceResponse> * @param resourceGroupName Azure resource group name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretResourceDescriptionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given resource group. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the Secret. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + * @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<SecretResourceDescriptionInner> 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 secret resources in a given subscription. + * Gets the information about all secret resources in a given resource group. The information include the description and other properties of the secret. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<SecretResourceDescriptionInner> 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/ServiceReplicasInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicasInner.java new file mode 100644 index 000000000000..f2b0ad134053 --- /dev/null +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/ServiceReplicasInner.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.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 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 ServiceReplicas. + */ +public class ServiceReplicasInner { + /** The Retrofit service to perform REST calls. */ + private ServiceReplicasService service; + /** The service client containing this operation class. */ + private ServiceFabricMeshManagementClientImpl client; + + /** + * Initializes an instance of ServiceReplicasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ServiceReplicasInner(Retrofit retrofit, ServiceFabricMeshManagementClientImpl client) { + this.service = retrofit.create(ServiceReplicasService.class); + this.client = client; + } + + /** + * The interface defining all the services for ServiceReplicas to be + * used by Retrofit to perform actually REST calls. + */ + interface ServiceReplicasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.servicefabricmesh.ServiceReplicas get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services/{serviceResourceName}/replicas/{replicaName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @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.ServiceReplicas list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabricMesh/applications/{applicationResourceName}/services/{serviceResourceName}/replicas") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path(value = "applicationResourceName", encoded = true) String applicationResourceName, @Path(value = "serviceResourceName", encoded = true) String serviceResourceName, @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.ServiceReplicas listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the given replica of the service of an application. + * Gets the information about the service replica with the given name. The information include the description and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica 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 ServiceReplicaDescriptionInner object if successful. + */ + public ServiceReplicaDescriptionInner get(String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName) { + return getWithServiceResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName, replicaName).toBlocking().single().body(); + } + + /** + * Gets the given replica of the service of an application. + * Gets the information about the service replica with the given name. The information include the description and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName, replicaName), serviceCallback); + } + + /** + * Gets the given replica of the service of an application. + * Gets the information about the service replica with the given name. The information include the description and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceReplicaDescriptionInner object + */ + public Observable getAsync(String resourceGroupName, String applicationResourceName, String serviceResourceName, String replicaName) { + return getWithServiceResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName, replicaName).map(new Func1, ServiceReplicaDescriptionInner>() { + @Override + public ServiceReplicaDescriptionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the given replica of the service of an application. + * Gets the information about the service replica with the given name. The information include the description and other properties of the service replica. + * + * @param resourceGroupName Azure resource group name + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @param replicaName Service Fabric replica name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ServiceReplicaDescriptionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String applicationResourceName, String serviceResourceName, 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 (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName 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, applicationResourceName, serviceResourceName, 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 ErrorModelException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorModelException.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 resourceGroupName Azure resource group name + * @param applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @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<ServiceReplicaDescriptionInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String applicationResourceName, final String serviceResourceName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, applicationResourceName, serviceResourceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(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 applicationResourceName The identity of the application. + * @param serviceResourceName 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> listAsync(final String resourceGroupName, final String applicationResourceName, final String serviceResourceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, applicationResourceName, serviceResourceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceReplicaDescriptionInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String applicationResourceName, final String serviceResourceName) { + return listWithServiceResponseAsync(resourceGroupName, applicationResourceName, serviceResourceName) + .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 applicationResourceName The identity of the application. + * @param serviceResourceName The identity of the service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ServiceReplicaDescriptionInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String applicationResourceName, final String serviceResourceName) { + return listSinglePageAsync(resourceGroupName, applicationResourceName, serviceResourceName) + .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 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 applicationResourceName The identity of the application. + ServiceResponse> * @param serviceResourceName 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>> listSinglePageAsync(final String resourceGroupName, final String applicationResourceName, final String serviceResourceName) { + 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 (applicationResourceName == null) { + throw new IllegalArgumentException("Parameter applicationResourceName is required and cannot be null."); + } + if (serviceResourceName == null) { + throw new IllegalArgumentException("Parameter serviceResourceName is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, applicationResourceName, serviceResourceName, 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 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 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<ServiceReplicaDescriptionInner> 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 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> 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 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> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(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>> 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 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>> 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); + } + +} From 7b7bedf134ff5d40ddb14545426d84950f80acaf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 5 Dec 2018 18:04:07 -0800 Subject: [PATCH 3/3] Generated from 45097e384f4fbb60b8d771ceb1f58a1d8a4defe2 (#2741) typo: servicefabricmesh/resource-manager/Microsoft.ServiceFabricMesh - Double word "the" - deletd -> deleted - unecrypted -> unencrypted - hamdle -> handle - ReliableCollectionsRef capitalization --- .../servicefabricmesh/HttpHostConfig.java | 6 +++--- .../implementation/SecretValuesInner.java | 20 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java index 79107fdc96b5..5f8cce65ed63 100644 --- a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/HttpHostConfig.java @@ -24,7 +24,7 @@ public class HttpHostConfig { /** * Route information to use for routing. Routes are processed in the order * they are specified. Specify routes that are more specific before routes - * that can hamdle general cases. + * that can handle general cases. */ @JsonProperty(value = "routes", required = true) private List routes; @@ -50,7 +50,7 @@ public HttpHostConfig withName(String name) { } /** - * Get route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can hamdle general cases. + * Get route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can handle general cases. * * @return the routes value */ @@ -59,7 +59,7 @@ public List routes() { } /** - * Set route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can hamdle general cases. + * Set route information to use for routing. Routes are processed in the order they are specified. Specify routes that are more specific before routes that can handle general cases. * * @param routes the routes value to set * @return the HttpHostConfig object itself. diff --git a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java index 5a82df27d107..cbf50a198ace 100644 --- a/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java +++ b/azure-mgmt-servicefabricmesh/src/main/java/com/microsoft/azure/management/servicefabricmesh/implementation/SecretValuesInner.java @@ -382,7 +382,7 @@ private ServiceResponse deleteDelegate(Response response) th } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * * @param resourceGroupName Azure resource group name @@ -403,7 +403,7 @@ public Page nextPage(String nextPageLink) { } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * * @param resourceGroupName Azure resource group name @@ -425,7 +425,7 @@ public Observable>> ca } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * * @param resourceGroupName Azure resource group name @@ -444,7 +444,7 @@ public Page call(ServiceResponse>> ca } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * ServiceResponse> * @param resourceGroupName Azure resource group name @@ -601,7 +601,7 @@ private ServiceResponse listValueDelegate(Response nextPage(String nextPageLink) { } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -643,7 +643,7 @@ public Observable>> ca } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * * @param nextPageLink The NextLink from the previous successful call to List operation. @@ -661,7 +661,7 @@ public Page call(ServiceResponse>> ca } /** - * List names of all values of the the specified secret resource. + * List names of all values of the specified secret resource. * Gets information about all secret value resources of the specified secret resource. The information includes the names of the secret value resources, but not the actual values. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.