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

com.azure.resourcemanager.network.models.NextHopParameters 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.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Parameters that define the source and destination endpoint.
 */
@Fluent
public final class NextHopParameters {
    /*
     * The resource identifier of the target resource against which the action is to be performed.
     */
    @JsonProperty(value = "targetResourceId", required = true)
    private String targetResourceId;

    /*
     * The source IP address.
     */
    @JsonProperty(value = "sourceIPAddress", required = true)
    private String sourceIpAddress;

    /*
     * The destination IP address.
     */
    @JsonProperty(value = "destinationIPAddress", required = true)
    private String destinationIpAddress;

    /*
     * The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of the nics, then this parameter must be specified. Otherwise optional).
     */
    @JsonProperty(value = "targetNicResourceId")
    private String targetNicResourceId;

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

    /**
     * Get the targetResourceId property: The resource identifier of the target resource against which the action is to
     * be performed.
     * 
     * @return the targetResourceId value.
     */
    public String targetResourceId() {
        return this.targetResourceId;
    }

    /**
     * Set the targetResourceId property: The resource identifier of the target resource against which the action is to
     * be performed.
     * 
     * @param targetResourceId the targetResourceId value to set.
     * @return the NextHopParameters object itself.
     */
    public NextHopParameters withTargetResourceId(String targetResourceId) {
        this.targetResourceId = targetResourceId;
        return this;
    }

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

    /**
     * Set the sourceIpAddress property: The source IP address.
     * 
     * @param sourceIpAddress the sourceIpAddress value to set.
     * @return the NextHopParameters object itself.
     */
    public NextHopParameters withSourceIpAddress(String sourceIpAddress) {
        this.sourceIpAddress = sourceIpAddress;
        return this;
    }

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

    /**
     * Set the destinationIpAddress property: The destination IP address.
     * 
     * @param destinationIpAddress the destinationIpAddress value to set.
     * @return the NextHopParameters object itself.
     */
    public NextHopParameters withDestinationIpAddress(String destinationIpAddress) {
        this.destinationIpAddress = destinationIpAddress;
        return this;
    }

    /**
     * Get the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of
     * the nics, then this parameter must be specified. Otherwise optional).
     * 
     * @return the targetNicResourceId value.
     */
    public String targetNicResourceId() {
        return this.targetNicResourceId;
    }

    /**
     * Set the targetNicResourceId property: The NIC ID. (If VM has multiple NICs and IP forwarding is enabled on any of
     * the nics, then this parameter must be specified. Otherwise optional).
     * 
     * @param targetNicResourceId the targetNicResourceId value to set.
     * @return the NextHopParameters object itself.
     */
    public NextHopParameters withTargetNicResourceId(String targetNicResourceId) {
        this.targetNicResourceId = targetNicResourceId;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (targetResourceId() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property targetResourceId in model NextHopParameters"));
        }
        if (sourceIpAddress() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property sourceIpAddress in model NextHopParameters"));
        }
        if (destinationIpAddress() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property destinationIpAddress in model NextHopParameters"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(NextHopParameters.class);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy