com.amazonaws.services.networkfirewall.model.PutResourcePolicyRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-networkfirewall Show documentation
/*
* Copyright 2019-2024 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.networkfirewall.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PutResourcePolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies with.
*
*/
private String resourceArn;
/**
*
* The IAM policy statement that lists the accounts that you want to share your rule group or firewall policy with
* and the operations that you want the accounts to be able to perform.
*
*
* For a rule group resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies that you
* want to share with the account that you specified in Arn
.
*
*/
private String policy;
/**
*
* The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies with.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies
* with.
*/
public void setResourceArn(String resourceArn) {
this.resourceArn = resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies with.
*
*
* @return The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies
* with.
*/
public String getResourceArn() {
return this.resourceArn;
}
/**
*
* The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies with.
*
*
* @param resourceArn
* The Amazon Resource Name (ARN) of the account that you want to share rule groups and firewall policies
* with.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutResourcePolicyRequest withResourceArn(String resourceArn) {
setResourceArn(resourceArn);
return this;
}
/**
*
* The IAM policy statement that lists the accounts that you want to share your rule group or firewall policy with
* and the operations that you want the accounts to be able to perform.
*
*
* For a rule group resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies that you
* want to share with the account that you specified in Arn
.
*
*
* @param policy
* The IAM policy statement that lists the accounts that you want to share your rule group or firewall policy
* with and the operations that you want the accounts to be able to perform.
*
* For a rule group resource, you can specify the following operations in the Actions section of the
* statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the
* statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies
* that you want to share with the account that you specified in Arn
.
*/
public void setPolicy(String policy) {
this.policy = policy;
}
/**
*
* The IAM policy statement that lists the accounts that you want to share your rule group or firewall policy with
* and the operations that you want the accounts to be able to perform.
*
*
* For a rule group resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies that you
* want to share with the account that you specified in Arn
.
*
*
* @return The IAM policy statement that lists the accounts that you want to share your rule group or firewall
* policy with and the operations that you want the accounts to be able to perform.
*
* For a rule group resource, you can specify the following operations in the Actions section of the
* statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the
* statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies
* that you want to share with the account that you specified in Arn
.
*/
public String getPolicy() {
return this.policy;
}
/**
*
* The IAM policy statement that lists the accounts that you want to share your rule group or firewall policy with
* and the operations that you want the accounts to be able to perform.
*
*
* For a rule group resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies that you
* want to share with the account that you specified in Arn
.
*
*
* @param policy
* The IAM policy statement that lists the accounts that you want to share your rule group or firewall policy
* with and the operations that you want the accounts to be able to perform.
*
* For a rule group resource, you can specify the following operations in the Actions section of the
* statement:
*
*
* -
*
* network-firewall:CreateFirewallPolicy
*
*
* -
*
* network-firewall:UpdateFirewallPolicy
*
*
* -
*
* network-firewall:ListRuleGroups
*
*
*
*
* For a firewall policy resource, you can specify the following operations in the Actions section of the
* statement:
*
*
* -
*
* network-firewall:AssociateFirewallPolicy
*
*
* -
*
* network-firewall:ListFirewallPolicies
*
*
*
*
* In the Resource section of the statement, you specify the ARNs for the rule groups and firewall policies
* that you want to share with the account that you specified in Arn
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutResourcePolicyRequest withPolicy(String policy) {
setPolicy(policy);
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 (getResourceArn() != null)
sb.append("ResourceArn: ").append(getResourceArn()).append(",");
if (getPolicy() != null)
sb.append("Policy: ").append(getPolicy());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutResourcePolicyRequest == false)
return false;
PutResourcePolicyRequest other = (PutResourcePolicyRequest) obj;
if (other.getResourceArn() == null ^ this.getResourceArn() == null)
return false;
if (other.getResourceArn() != null && other.getResourceArn().equals(this.getResourceArn()) == false)
return false;
if (other.getPolicy() == null ^ this.getPolicy() == null)
return false;
if (other.getPolicy() != null && other.getPolicy().equals(this.getPolicy()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getResourceArn() == null) ? 0 : getResourceArn().hashCode());
hashCode = prime * hashCode + ((getPolicy() == null) ? 0 : getPolicy().hashCode());
return hashCode;
}
@Override
public PutResourcePolicyRequest clone() {
return (PutResourcePolicyRequest) super.clone();
}
}