com.azure.resourcemanager.network.models.FirewallPolicyRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-network Show documentation
Show all versions of azure-resourcemanager-network Show documentation
This package contains Microsoft Azure Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
// 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 com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* Properties of a rule.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "ruleType", defaultImpl = FirewallPolicyRule.class, visible = true)
@JsonTypeName("FirewallPolicyRule")
@JsonSubTypes({
@JsonSubTypes.Type(name = "ApplicationRule", value = ApplicationRule.class),
@JsonSubTypes.Type(name = "NatRule", value = NatRule.class),
@JsonSubTypes.Type(name = "NetworkRule", value = NetworkRule.class) })
@Fluent
public class FirewallPolicyRule {
/*
* Rule Type.
*/
@JsonTypeId
@JsonProperty(value = "ruleType", required = true)
private FirewallPolicyRuleType ruleType;
/*
* Name of the rule.
*/
@JsonProperty(value = "name")
private String name;
/*
* Description of the rule.
*/
@JsonProperty(value = "description")
private String description;
/**
* Creates an instance of FirewallPolicyRule class.
*/
public FirewallPolicyRule() {
this.ruleType = FirewallPolicyRuleType.fromString("FirewallPolicyRule");
}
/**
* Get the ruleType property: Rule Type.
*
* @return the ruleType value.
*/
public FirewallPolicyRuleType ruleType() {
return this.ruleType;
}
/**
* Get the name property: Name of the rule.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Name of the rule.
*
* @param name the name value to set.
* @return the FirewallPolicyRule object itself.
*/
public FirewallPolicyRule withName(String name) {
this.name = name;
return this;
}
/**
* Get the description property: Description of the rule.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: Description of the rule.
*
* @param description the description value to set.
* @return the FirewallPolicyRule object itself.
*/
public FirewallPolicyRule withDescription(String description) {
this.description = description;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
}