com.azure.resourcemanager.network.models.ApplicationRule 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.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;
/**
* Rule of type application.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "ruleType", defaultImpl = ApplicationRule.class, visible = true)
@JsonTypeName("ApplicationRule")
@Fluent
public final class ApplicationRule extends FirewallPolicyRule {
/*
* Rule Type.
*/
@JsonTypeId
@JsonProperty(value = "ruleType", required = true)
private FirewallPolicyRuleType ruleType = FirewallPolicyRuleType.APPLICATION_RULE;
/*
* List of source IP addresses for this rule.
*/
@JsonProperty(value = "sourceAddresses")
private List sourceAddresses;
/*
* List of destination IP addresses or Service Tags.
*/
@JsonProperty(value = "destinationAddresses")
private List destinationAddresses;
/*
* Array of Application Protocols.
*/
@JsonProperty(value = "protocols")
private List protocols;
/*
* List of FQDNs for this rule.
*/
@JsonProperty(value = "targetFqdns")
private List targetFqdns;
/*
* List of Urls for this rule condition.
*/
@JsonProperty(value = "targetUrls")
private List targetUrls;
/*
* List of FQDN Tags for this rule.
*/
@JsonProperty(value = "fqdnTags")
private List fqdnTags;
/*
* List of source IpGroups for this rule.
*/
@JsonProperty(value = "sourceIpGroups")
private List sourceIpGroups;
/*
* Terminate TLS connections for this rule.
*/
@JsonProperty(value = "terminateTLS")
private Boolean terminateTls;
/*
* List of destination azure web categories.
*/
@JsonProperty(value = "webCategories")
private List webCategories;
/*
* List of HTTP/S headers to insert.
*/
@JsonProperty(value = "httpHeadersToInsert")
private List httpHeadersToInsert;
/**
* Creates an instance of ApplicationRule class.
*/
public ApplicationRule() {
}
/**
* Get the ruleType property: Rule Type.
*
* @return the ruleType value.
*/
@Override
public FirewallPolicyRuleType ruleType() {
return this.ruleType;
}
/**
* Get the sourceAddresses property: List of source IP addresses for this rule.
*
* @return the sourceAddresses value.
*/
public List sourceAddresses() {
return this.sourceAddresses;
}
/**
* Set the sourceAddresses property: List of source IP addresses for this rule.
*
* @param sourceAddresses the sourceAddresses value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withSourceAddresses(List sourceAddresses) {
this.sourceAddresses = sourceAddresses;
return this;
}
/**
* Get the destinationAddresses property: List of destination IP addresses or Service Tags.
*
* @return the destinationAddresses value.
*/
public List destinationAddresses() {
return this.destinationAddresses;
}
/**
* Set the destinationAddresses property: List of destination IP addresses or Service Tags.
*
* @param destinationAddresses the destinationAddresses value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withDestinationAddresses(List destinationAddresses) {
this.destinationAddresses = destinationAddresses;
return this;
}
/**
* Get the protocols property: Array of Application Protocols.
*
* @return the protocols value.
*/
public List protocols() {
return this.protocols;
}
/**
* Set the protocols property: Array of Application Protocols.
*
* @param protocols the protocols value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withProtocols(List protocols) {
this.protocols = protocols;
return this;
}
/**
* Get the targetFqdns property: List of FQDNs for this rule.
*
* @return the targetFqdns value.
*/
public List targetFqdns() {
return this.targetFqdns;
}
/**
* Set the targetFqdns property: List of FQDNs for this rule.
*
* @param targetFqdns the targetFqdns value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withTargetFqdns(List targetFqdns) {
this.targetFqdns = targetFqdns;
return this;
}
/**
* Get the targetUrls property: List of Urls for this rule condition.
*
* @return the targetUrls value.
*/
public List targetUrls() {
return this.targetUrls;
}
/**
* Set the targetUrls property: List of Urls for this rule condition.
*
* @param targetUrls the targetUrls value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withTargetUrls(List targetUrls) {
this.targetUrls = targetUrls;
return this;
}
/**
* Get the fqdnTags property: List of FQDN Tags for this rule.
*
* @return the fqdnTags value.
*/
public List fqdnTags() {
return this.fqdnTags;
}
/**
* Set the fqdnTags property: List of FQDN Tags for this rule.
*
* @param fqdnTags the fqdnTags value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withFqdnTags(List fqdnTags) {
this.fqdnTags = fqdnTags;
return this;
}
/**
* Get the sourceIpGroups property: List of source IpGroups for this rule.
*
* @return the sourceIpGroups value.
*/
public List sourceIpGroups() {
return this.sourceIpGroups;
}
/**
* Set the sourceIpGroups property: List of source IpGroups for this rule.
*
* @param sourceIpGroups the sourceIpGroups value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withSourceIpGroups(List sourceIpGroups) {
this.sourceIpGroups = sourceIpGroups;
return this;
}
/**
* Get the terminateTls property: Terminate TLS connections for this rule.
*
* @return the terminateTls value.
*/
public Boolean terminateTls() {
return this.terminateTls;
}
/**
* Set the terminateTls property: Terminate TLS connections for this rule.
*
* @param terminateTls the terminateTls value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withTerminateTls(Boolean terminateTls) {
this.terminateTls = terminateTls;
return this;
}
/**
* Get the webCategories property: List of destination azure web categories.
*
* @return the webCategories value.
*/
public List webCategories() {
return this.webCategories;
}
/**
* Set the webCategories property: List of destination azure web categories.
*
* @param webCategories the webCategories value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withWebCategories(List webCategories) {
this.webCategories = webCategories;
return this;
}
/**
* Get the httpHeadersToInsert property: List of HTTP/S headers to insert.
*
* @return the httpHeadersToInsert value.
*/
public List httpHeadersToInsert() {
return this.httpHeadersToInsert;
}
/**
* Set the httpHeadersToInsert property: List of HTTP/S headers to insert.
*
* @param httpHeadersToInsert the httpHeadersToInsert value to set.
* @return the ApplicationRule object itself.
*/
public ApplicationRule withHttpHeadersToInsert(List httpHeadersToInsert) {
this.httpHeadersToInsert = httpHeadersToInsert;
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ApplicationRule withName(String name) {
super.withName(name);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ApplicationRule withDescription(String description) {
super.withDescription(description);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
if (protocols() != null) {
protocols().forEach(e -> e.validate());
}
if (httpHeadersToInsert() != null) {
httpHeadersToInsert().forEach(e -> e.validate());
}
}
}