diff --git a/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/PeeringServicePrefix.java b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/PeeringServicePrefix.java new file mode 100644 index 000000000000..aaf2a996f067 --- /dev/null +++ b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/PeeringServicePrefix.java @@ -0,0 +1,143 @@ +/** + * 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.peering.v2019_08_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.peering.v2019_08_01_preview.implementation.PeeringServicePrefixInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.peering.v2019_08_01_preview.implementation.PeeringManager; +import java.util.List; + +/** + * Type representing PeeringServicePrefix. + */ +public interface PeeringServicePrefix extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the errorMessage value. + */ + String errorMessage(); + + /** + * @return the events value. + */ + List events(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the learnedType value. + */ + LearnedType learnedType(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the prefix value. + */ + String prefix(); + + /** + * @return the prefixValidationState value. + */ + PrefixValidationState prefixValidationState(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PeeringServicePrefix definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithPeeringService, DefinitionStages.WithPrefix, DefinitionStages.WithCreate { + } + + /** + * Grouping of PeeringServicePrefix definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PeeringServicePrefix definition. + */ + interface Blank extends WithPeeringService { + } + + /** + * The stage of the peeringserviceprefix definition allowing to specify PeeringService. + */ + interface WithPeeringService { + /** + * Specifies resourceGroupName, peeringServiceName. + * @param resourceGroupName The name of the resource group + * @param peeringServiceName The name of the peering service + * @return the next definition stage + */ + WithPrefix withExistingPeeringService(String resourceGroupName, String peeringServiceName); + } + + /** + * The stage of the peeringserviceprefix definition allowing to specify Prefix. + */ + interface WithPrefix { + /** + * Specifies prefix. + * @param prefix The prefix from which your traffic originates + * @return the next definition stage + */ + WithCreate withPrefix(String prefix); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a PeeringServicePrefix update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrefix { + } + + /** + * Grouping of PeeringServicePrefix update stages. + */ + interface UpdateStages { + /** + * The stage of the peeringserviceprefix update allowing to specify Prefix. + */ + interface WithPrefix { + /** + * Specifies prefix. + * @param prefix The prefix from which your traffic originates + * @return the next update stage + */ + Update withPrefix(String prefix); + } + + } +} diff --git a/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/PeeringServicePrefixEvent.java b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/PeeringServicePrefixEvent.java new file mode 100644 index 000000000000..0c9d4d68eca4 --- /dev/null +++ b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/PeeringServicePrefixEvent.java @@ -0,0 +1,93 @@ +/** + * 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.peering.v2019_08_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The peering service prefix event class. + */ +public class PeeringServicePrefixEvent { + /** + * The event type of the peering service prefix event. + */ + @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) + private String eventType; + + /** + * The event timestamp of the peering service prefix event. + */ + @JsonProperty(value = "eventTimeStamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime eventTimeStamp; + + /** + * The event description of the peering service prefix event. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /** + * The event level of the peering service prefix event. + */ + @JsonProperty(value = "eventLevel", access = JsonProperty.Access.WRITE_ONLY) + private String eventLevel; + + /** + * Additional information for the peering service prefix event. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private String additionalInfo; + + /** + * Get the event type of the peering service prefix event. + * + * @return the eventType value + */ + public String eventType() { + return this.eventType; + } + + /** + * Get the event timestamp of the peering service prefix event. + * + * @return the eventTimeStamp value + */ + public DateTime eventTimeStamp() { + return this.eventTimeStamp; + } + + /** + * Get the event description of the peering service prefix event. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Get the event level of the peering service prefix event. + * + * @return the eventLevel value + */ + public String eventLevel() { + return this.eventLevel; + } + + /** + * Get additional information for the peering service prefix event. + * + * @return the additionalInfo value + */ + public String additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringManagementClientImpl.java b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringManagementClientImpl.java index d988a7383c29..9d7f37fc982d 100644 --- a/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringManagementClientImpl.java +++ b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringManagementClientImpl.java @@ -359,7 +359,8 @@ interface PeeringManagementClientService { /** * Checks if the peering service provider is present within 1000 miles of customer's location. * - * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput indicating customer location and service provider. + * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput + indicating customer location and service provider. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -372,7 +373,8 @@ public String checkServiceProviderAvailability(CheckServiceProviderAvailabilityI /** * Checks if the peering service provider is present within 1000 miles of customer's location. * - * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput indicating customer location and service provider. + * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput + indicating customer location and service 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 @@ -384,7 +386,8 @@ public ServiceFuture checkServiceProviderAvailabilityAsync(CheckServiceP /** * Checks if the peering service provider is present within 1000 miles of customer's location. * - * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput indicating customer location and service provider. + * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput + indicating customer location and service provider. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ @@ -400,7 +403,8 @@ public String call(ServiceResponse response) { /** * Checks if the peering service provider is present within 1000 miles of customer's location. * - * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput indicating customer location and service provider. + * @param checkServiceProviderAvailabilityInput The CheckServiceProviderAvailabilityInput + indicating customer location and service provider. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the String object */ diff --git a/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringServicePrefixImpl.java b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringServicePrefixImpl.java new file mode 100644 index 000000000000..da17fd32ca8e --- /dev/null +++ b/peering/resource-manager/v2019_08_01_preview/src/main/java/com/microsoft/azure/management/peering/v2019_08_01_preview/implementation/PeeringServicePrefixImpl.java @@ -0,0 +1,141 @@ +/** + * 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.peering.v2019_08_01_preview.implementation; + +import com.microsoft.azure.management.peering.v2019_08_01_preview.PeeringServicePrefix; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.peering.v2019_08_01_preview.PeeringServicePrefixEvent; +import com.microsoft.azure.management.peering.v2019_08_01_preview.LearnedType; +import com.microsoft.azure.management.peering.v2019_08_01_preview.PrefixValidationState; +import com.microsoft.azure.management.peering.v2019_08_01_preview.ProvisioningState; + +class PeeringServicePrefixImpl extends CreatableUpdatableImpl implements PeeringServicePrefix, PeeringServicePrefix.Definition, PeeringServicePrefix.Update { + private final PeeringManager manager; + private String resourceGroupName; + private String peeringServiceName; + private String prefixName; + private String cprefix; + private String uprefix; + + PeeringServicePrefixImpl(String name, PeeringManager manager) { + super(name, new PeeringServicePrefixInner()); + this.manager = manager; + // Set resource name + this.prefixName = name; + // + } + + PeeringServicePrefixImpl(PeeringServicePrefixInner inner, PeeringManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.prefixName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.peeringServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "peeringServices"); + this.prefixName = IdParsingUtils.getValueFromIdByName(inner.id(), "prefixes"); + // + } + + @Override + public PeeringManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrefixesInner client = this.manager().inner().prefixes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.peeringServiceName, this.prefixName, this.cprefix) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrefixesInner client = this.manager().inner().prefixes(); + return client.createOrUpdateAsync(this.resourceGroupName, this.peeringServiceName, this.prefixName, this.uprefix) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrefixesInner client = this.manager().inner().prefixes(); + return client.getAsync(this.resourceGroupName, this.peeringServiceName, this.prefixName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String errorMessage() { + return this.inner().errorMessage(); + } + + @Override + public List events() { + return this.inner().events(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public LearnedType learnedType() { + return this.inner().learnedType(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String prefix() { + return this.inner().prefix(); + } + + @Override + public PrefixValidationState prefixValidationState() { + return this.inner().prefixValidationState(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PeeringServicePrefixImpl withExistingPeeringService(String resourceGroupName, String peeringServiceName) { + this.resourceGroupName = resourceGroupName; + this.peeringServiceName = peeringServiceName; + return this; + } + + @Override + public PeeringServicePrefixImpl withPrefix(String prefix) { + if (isInCreateMode()) { + this.cprefix = prefix; + } else { + this.uprefix = prefix; + } + return this; + } + +}