
com.amazonaws.services.wafv2.model.ManagedRuleGroupConfig Maven / Gradle / Ivy
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.wafv2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Additional information that's used by a managed rule group. Most managed rule groups don't require this.
*
*
* Use this for the account takeover prevention managed rule group AWSManagedRulesATPRuleSet
, to provide
* information about the sign-in page of your application.
*
*
* You can provide multiple individual ManagedRuleGroupConfig
objects for any rule group configuration, for
* example UsernameField
and PasswordField
. The configuration that you provide depends on the
* needs of the managed rule group. For the ATP managed rule group, you provide the following individual configuration
* objects: LoginPath
, PasswordField
, PayloadType
and UsernameField
.
*
*
* For example specifications, see the examples section of CreateWebACL.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ManagedRuleGroupConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
*
*/
private String loginPath;
/**
*
* The payload type for your login endpoint, either JSON or form encoded.
*
*/
private String payloadType;
/**
*
* Details about your login page username field.
*
*/
private UsernameField usernameField;
/**
*
* Details about your login page password field.
*
*/
private PasswordField passwordField;
/**
*
* The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
*
*
* @param loginPath
* The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
*/
public void setLoginPath(String loginPath) {
this.loginPath = loginPath;
}
/**
*
* The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
*
*
* @return The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
*/
public String getLoginPath() {
return this.loginPath;
}
/**
*
* The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
*
*
* @param loginPath
* The path of the login endpoint for your application. For example, for the URL
* https://example.com/web/login
, you would provide the path /web/login
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ManagedRuleGroupConfig withLoginPath(String loginPath) {
setLoginPath(loginPath);
return this;
}
/**
*
* The payload type for your login endpoint, either JSON or form encoded.
*
*
* @param payloadType
* The payload type for your login endpoint, either JSON or form encoded.
* @see PayloadType
*/
public void setPayloadType(String payloadType) {
this.payloadType = payloadType;
}
/**
*
* The payload type for your login endpoint, either JSON or form encoded.
*
*
* @return The payload type for your login endpoint, either JSON or form encoded.
* @see PayloadType
*/
public String getPayloadType() {
return this.payloadType;
}
/**
*
* The payload type for your login endpoint, either JSON or form encoded.
*
*
* @param payloadType
* The payload type for your login endpoint, either JSON or form encoded.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PayloadType
*/
public ManagedRuleGroupConfig withPayloadType(String payloadType) {
setPayloadType(payloadType);
return this;
}
/**
*
* The payload type for your login endpoint, either JSON or form encoded.
*
*
* @param payloadType
* The payload type for your login endpoint, either JSON or form encoded.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PayloadType
*/
public ManagedRuleGroupConfig withPayloadType(PayloadType payloadType) {
this.payloadType = payloadType.toString();
return this;
}
/**
*
* Details about your login page username field.
*
*
* @param usernameField
* Details about your login page username field.
*/
public void setUsernameField(UsernameField usernameField) {
this.usernameField = usernameField;
}
/**
*
* Details about your login page username field.
*
*
* @return Details about your login page username field.
*/
public UsernameField getUsernameField() {
return this.usernameField;
}
/**
*
* Details about your login page username field.
*
*
* @param usernameField
* Details about your login page username field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ManagedRuleGroupConfig withUsernameField(UsernameField usernameField) {
setUsernameField(usernameField);
return this;
}
/**
*
* Details about your login page password field.
*
*
* @param passwordField
* Details about your login page password field.
*/
public void setPasswordField(PasswordField passwordField) {
this.passwordField = passwordField;
}
/**
*
* Details about your login page password field.
*
*
* @return Details about your login page password field.
*/
public PasswordField getPasswordField() {
return this.passwordField;
}
/**
*
* Details about your login page password field.
*
*
* @param passwordField
* Details about your login page password field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ManagedRuleGroupConfig withPasswordField(PasswordField passwordField) {
setPasswordField(passwordField);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getLoginPath() != null)
sb.append("LoginPath: ").append(getLoginPath()).append(",");
if (getPayloadType() != null)
sb.append("PayloadType: ").append(getPayloadType()).append(",");
if (getUsernameField() != null)
sb.append("UsernameField: ").append(getUsernameField()).append(",");
if (getPasswordField() != null)
sb.append("PasswordField: ").append(getPasswordField());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ManagedRuleGroupConfig == false)
return false;
ManagedRuleGroupConfig other = (ManagedRuleGroupConfig) obj;
if (other.getLoginPath() == null ^ this.getLoginPath() == null)
return false;
if (other.getLoginPath() != null && other.getLoginPath().equals(this.getLoginPath()) == false)
return false;
if (other.getPayloadType() == null ^ this.getPayloadType() == null)
return false;
if (other.getPayloadType() != null && other.getPayloadType().equals(this.getPayloadType()) == false)
return false;
if (other.getUsernameField() == null ^ this.getUsernameField() == null)
return false;
if (other.getUsernameField() != null && other.getUsernameField().equals(this.getUsernameField()) == false)
return false;
if (other.getPasswordField() == null ^ this.getPasswordField() == null)
return false;
if (other.getPasswordField() != null && other.getPasswordField().equals(this.getPasswordField()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLoginPath() == null) ? 0 : getLoginPath().hashCode());
hashCode = prime * hashCode + ((getPayloadType() == null) ? 0 : getPayloadType().hashCode());
hashCode = prime * hashCode + ((getUsernameField() == null) ? 0 : getUsernameField().hashCode());
hashCode = prime * hashCode + ((getPasswordField() == null) ? 0 : getPasswordField().hashCode());
return hashCode;
}
@Override
public ManagedRuleGroupConfig clone() {
try {
return (ManagedRuleGroupConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.wafv2.model.transform.ManagedRuleGroupConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}