All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.network.models.ExpressRouteCircuitRoutesTableSummary Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The routes table associated with the ExpressRouteCircuit.
 */
@Fluent
public final class ExpressRouteCircuitRoutesTableSummary
    implements JsonSerializable {
    /*
     * IP address of the neighbor.
     */
    private String neighbor;

    /*
     * BGP version number spoken to the neighbor.
     */
    private Integer v;

    /*
     * Autonomous system number.
     */
    private Integer as;

    /*
     * The length of time that the BGP session has been in the Established state, or the current status if not in the
     * Established state.
     */
    private String upDown;

    /*
     * Current state of the BGP session, and the number of prefixes that have been received from a neighbor or peer
     * group.
     */
    private String statePfxRcd;

    /**
     * Creates an instance of ExpressRouteCircuitRoutesTableSummary class.
     */
    public ExpressRouteCircuitRoutesTableSummary() {
    }

    /**
     * Get the neighbor property: IP address of the neighbor.
     * 
     * @return the neighbor value.
     */
    public String neighbor() {
        return this.neighbor;
    }

    /**
     * Set the neighbor property: IP address of the neighbor.
     * 
     * @param neighbor the neighbor value to set.
     * @return the ExpressRouteCircuitRoutesTableSummary object itself.
     */
    public ExpressRouteCircuitRoutesTableSummary withNeighbor(String neighbor) {
        this.neighbor = neighbor;
        return this;
    }

    /**
     * Get the v property: BGP version number spoken to the neighbor.
     * 
     * @return the v value.
     */
    public Integer v() {
        return this.v;
    }

    /**
     * Set the v property: BGP version number spoken to the neighbor.
     * 
     * @param v the v value to set.
     * @return the ExpressRouteCircuitRoutesTableSummary object itself.
     */
    public ExpressRouteCircuitRoutesTableSummary withV(Integer v) {
        this.v = v;
        return this;
    }

    /**
     * Get the as property: Autonomous system number.
     * 
     * @return the as value.
     */
    public Integer as() {
        return this.as;
    }

    /**
     * Set the as property: Autonomous system number.
     * 
     * @param as the as value to set.
     * @return the ExpressRouteCircuitRoutesTableSummary object itself.
     */
    public ExpressRouteCircuitRoutesTableSummary withAs(Integer as) {
        this.as = as;
        return this;
    }

    /**
     * Get the upDown property: The length of time that the BGP session has been in the Established state, or the
     * current status if not in the Established state.
     * 
     * @return the upDown value.
     */
    public String upDown() {
        return this.upDown;
    }

    /**
     * Set the upDown property: The length of time that the BGP session has been in the Established state, or the
     * current status if not in the Established state.
     * 
     * @param upDown the upDown value to set.
     * @return the ExpressRouteCircuitRoutesTableSummary object itself.
     */
    public ExpressRouteCircuitRoutesTableSummary withUpDown(String upDown) {
        this.upDown = upDown;
        return this;
    }

    /**
     * Get the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been
     * received from a neighbor or peer group.
     * 
     * @return the statePfxRcd value.
     */
    public String statePfxRcd() {
        return this.statePfxRcd;
    }

    /**
     * Set the statePfxRcd property: Current state of the BGP session, and the number of prefixes that have been
     * received from a neighbor or peer group.
     * 
     * @param statePfxRcd the statePfxRcd value to set.
     * @return the ExpressRouteCircuitRoutesTableSummary object itself.
     */
    public ExpressRouteCircuitRoutesTableSummary withStatePfxRcd(String statePfxRcd) {
        this.statePfxRcd = statePfxRcd;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("neighbor", this.neighbor);
        jsonWriter.writeNumberField("v", this.v);
        jsonWriter.writeNumberField("as", this.as);
        jsonWriter.writeStringField("upDown", this.upDown);
        jsonWriter.writeStringField("statePfxRcd", this.statePfxRcd);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ExpressRouteCircuitRoutesTableSummary from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ExpressRouteCircuitRoutesTableSummary if the JsonReader was pointing to an instance of it,
     * or null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the ExpressRouteCircuitRoutesTableSummary.
     */
    public static ExpressRouteCircuitRoutesTableSummary fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ExpressRouteCircuitRoutesTableSummary deserializedExpressRouteCircuitRoutesTableSummary
                = new ExpressRouteCircuitRoutesTableSummary();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("neighbor".equals(fieldName)) {
                    deserializedExpressRouteCircuitRoutesTableSummary.neighbor = reader.getString();
                } else if ("v".equals(fieldName)) {
                    deserializedExpressRouteCircuitRoutesTableSummary.v = reader.getNullable(JsonReader::getInt);
                } else if ("as".equals(fieldName)) {
                    deserializedExpressRouteCircuitRoutesTableSummary.as = reader.getNullable(JsonReader::getInt);
                } else if ("upDown".equals(fieldName)) {
                    deserializedExpressRouteCircuitRoutesTableSummary.upDown = reader.getString();
                } else if ("statePfxRcd".equals(fieldName)) {
                    deserializedExpressRouteCircuitRoutesTableSummary.statePfxRcd = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedExpressRouteCircuitRoutesTableSummary;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy