@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); return hashCode; }
/** * <p> * The name of the policy to attach. * </p> * * @param policyName * The name of the policy to attach. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-security-identity.html">identity</a> to * which the policy is attached. * </p> * * @param target * The <a * href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-security-identity.html">identity</a> to * which the policy is attached. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPolicyRequest withTarget(String target) { setTarget(target); return this; }
getClient().attachPolicy(new AttachPolicyRequest().withPolicyName(id + "-Policy"));
getClient().attachPolicy(new AttachPolicyRequest().withPolicyName(id + "-Policy"));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPolicyRequest == false) return false; AttachPolicyRequest other = (AttachPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getTarget() == null ^ this.getTarget() == null) return false; if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false) return false; return true; }
/** * <p> * The name of the policy to attach. * </p> * * @param policyName * The name of the policy to attach. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The <a href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-security-identity.html">identity</a> to * which the policy is attached. * </p> * * @param target * The <a * href="https://docs.aws.amazon.com/iot/latest/developerguide/iot-security-identity.html">identity</a> to * which the policy is attached. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachPolicyRequest withTarget(String target) { setTarget(target); 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 (getPolicyName() != null) sb.append("PolicyName: ").append(getPolicyName()).append(","); if (getTarget() != null) sb.append("Target: ").append(getTarget()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(AttachPolicyRequest attachPolicyRequest, ProtocolMarshaller protocolMarshaller) { if (attachPolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attachPolicyRequest.getPolicyName(), POLICYNAME_BINDING); protocolMarshaller.marshall(attachPolicyRequest.getTarget(), TARGET_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPolicyRequest == false) return false; AttachPolicyRequest other = (AttachPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getTarget() == null ^ this.getTarget() == null) return false; if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getPolicyName() != null) sb.append("policyName: " + getPolicyName() + ","); if (getTarget() != null) sb.append("target: " + getTarget()); sb.append("}"); return sb.toString(); }
uriResourcePath = uriResourcePath.replace( "{policyName}", (attachPolicyRequest.getPolicyName() == null) ? "" : StringUtils .fromString(attachPolicyRequest.getPolicyName())); request.setResourcePath(uriResourcePath); try { jsonWriter.beginObject(); if (attachPolicyRequest.getTarget() != null) { String target = attachPolicyRequest.getTarget(); jsonWriter.name("target"); jsonWriter.value(target);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPolicyRequest == false) return false; AttachPolicyRequest other = (AttachPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getTarget() == null ^ this.getTarget() == null) return false; if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false) return false; return true; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPolicyRequest == false) return false; AttachPolicyRequest other = (AttachPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getTarget() == null ^ this.getTarget() == null) return false; if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getPolicyName() != null) sb.append("policyName: " + getPolicyName() + ","); if (getTarget() != null) sb.append("target: " + getTarget()); sb.append("}"); return sb.toString(); }
/** * 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 (getPolicyName() != null) sb.append("PolicyName: ").append(getPolicyName()).append(","); if (getTarget() != null) sb.append("Target: ").append(getTarget()); sb.append("}"); return sb.toString(); }