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

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

Go to download

This package contains Microsoft Azure Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt

There is a newer version: 2.44.0
Show newest version
// 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.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

/**
 * Action to be taken on a route matching a RouteMap criterion.
 */
@Fluent
public final class Action {
    /*
     * Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'
     */
    @JsonProperty(value = "type")
    private RouteMapActionType type;

    /*
     * List of parameters relevant to the action.For instance if type is drop then parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be added
     */
    @JsonProperty(value = "parameters")
    private List parameters;

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

    /**
     * Get the type property: Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'.
     *
     * @return the type value.
     */
    public RouteMapActionType type() {
        return this.type;
    }

    /**
     * Set the type property: Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'.
     *
     * @param type the type value to set.
     * @return the Action object itself.
     */
    public Action withType(RouteMapActionType type) {
        this.type = type;
        return this;
    }

    /**
     * Get the parameters property: List of parameters relevant to the action.For instance if type is drop then
     * parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be
     * added.
     *
     * @return the parameters value.
     */
    public List parameters() {
        return this.parameters;
    }

    /**
     * Set the parameters property: List of parameters relevant to the action.For instance if type is drop then
     * parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be
     * added.
     *
     * @param parameters the parameters value to set.
     * @return the Action object itself.
     */
    public Action withParameters(List parameters) {
        this.parameters = parameters;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (parameters() != null) {
            parameters().forEach(e -> e.validate());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy