public ListSecurityPoliciesRequest withResource(String... resource) {
        if (this.resource == null) {
            setResource(new java.util.ArrayList<String>(resource.length));
        }
        for (String ele : resource) {
            this.resource.add(ele);
        }
        return this;
    }
<p>
Resource filters (can be collection or indexes) that policies can apply to.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setResource(java.util.Collection)} or {@link #withResource(java.util.Collection)} if you want to override
the existing values.
</p>

@param resource
       Resource filters (can be collection or indexes) that policies can apply to.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-opensearchserverless/src/main/java/com/amazonaws/services/opensearchserverless/model/ListSecurityPoliciesRequest.java