@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyArn() == null) ? 0 : getPolicyArn().hashCode()); hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); hashCode = prime * hashCode + ((getPolicyVersionId() == null) ? 0 : getPolicyVersionId().hashCode()); return hashCode; }
/** * <p> * The policy ARN. * </p> * * @param policyArn * The policy ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyArn(String policyArn) { setPolicyArn(policyArn); return this; }
/** * <p> * The JSON document that describes the policy. * </p> * * @param policyDocument * The JSON document that describes the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyDocument(String policyDocument) { setPolicyDocument(policyDocument); return this; }
public CreatePolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { CreatePolicyResult createPolicyResult = new CreatePolicyResult(); if (context.testExpression("policyName", targetDepth)) { context.nextToken(); createPolicyResult.setPolicyName(context.getUnmarshaller(String.class).unmarshall(context)); createPolicyResult.setPolicyArn(context.getUnmarshaller(String.class).unmarshall(context)); createPolicyResult.setPolicyDocument(context.getUnmarshaller(String.class).unmarshall(context)); createPolicyResult.setPolicyVersionId(context.getUnmarshaller(String.class).unmarshall(context));
policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest); detachPrincipalPolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.detachPrincipalPolicy(detachPrincipalPolicyRequest); deletePolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.deletePolicy(deletePolicyRequest);
/** * <p> * The policy version ID. * </p> * * @param policyVersionId * The policy version ID. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyVersionId(String policyVersionId) { setPolicyVersionId(policyVersionId); return this; }
/** * <p> * The policy name. * </p> * * @param policyName * The policy name. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyName(String policyName) { setPolicyName(policyName); return this; }
public CreatePolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { CreatePolicyResult createPolicyResult = new CreatePolicyResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("policyName")) { createPolicyResult.setPolicyName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("policyArn")) { createPolicyResult.setPolicyArn(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("policyDocument")) { createPolicyResult.setPolicyDocument(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("policyVersionId")) { createPolicyResult.setPolicyVersionId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return createPolicyResult; }
policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest); detachPrincipalPolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.detachPrincipalPolicy(detachPrincipalPolicyRequest); deletePolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.deletePolicy(deletePolicyRequest);
/** * <p> * The policy version ID. * </p> * * @param policyVersionId * The policy version ID. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyVersionId(String policyVersionId) { setPolicyVersionId(policyVersionId); return this; }
/** * <p> * The policy name. * </p> * * @param policyName * The policy name. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyName(String policyName) { setPolicyName(policyName); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreatePolicyResult == false) return false; CreatePolicyResult other = (CreatePolicyResult) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPolicyArn() == null ^ this.getPolicyArn() == null) return false; if (other.getPolicyArn() != null && other.getPolicyArn().equals(this.getPolicyArn()) == false) return false; if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null) return false; if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == false) return false; if (other.getPolicyVersionId() == null ^ this.getPolicyVersionId() == null) return false; if (other.getPolicyVersionId() != null && other.getPolicyVersionId().equals(this.getPolicyVersionId()) == false) return false; return true; }
public CreatePolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { CreatePolicyResult createPolicyResult = new CreatePolicyResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("policyName")) { createPolicyResult.setPolicyName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("policyArn")) { createPolicyResult.setPolicyArn(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("policyDocument")) { createPolicyResult.setPolicyDocument(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("policyVersionId")) { createPolicyResult.setPolicyVersionId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return createPolicyResult; }
policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest); detachPrincipalPolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.detachPrincipalPolicy(detachPrincipalPolicyRequest); deletePolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.deletePolicy(deletePolicyRequest);
/** * <p> * The policy ARN. * </p> * * @param policyArn * The policy ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyArn(String policyArn) { setPolicyArn(policyArn); return this; }
/** * <p> * The JSON document that describes the policy. * </p> * * @param policyDocument * The JSON document that describes the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyResult withPolicyDocument(String policyDocument) { setPolicyDocument(policyDocument); 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 (getPolicyArn() != null) sb.append("PolicyArn: ").append(getPolicyArn()).append(","); if (getPolicyDocument() != null) sb.append("PolicyDocument: ").append(getPolicyDocument()).append(","); if (getPolicyVersionId() != null) sb.append("PolicyVersionId: ").append(getPolicyVersionId()); sb.append("}"); return sb.toString(); }
public CreatePolicyResult unmarshall(JsonUnmarshallerContext context) throws Exception { CreatePolicyResult createPolicyResult = new CreatePolicyResult(); if (context.testExpression("policyName", targetDepth)) { context.nextToken(); createPolicyResult.setPolicyName(context.getUnmarshaller(String.class).unmarshall(context)); createPolicyResult.setPolicyArn(context.getUnmarshaller(String.class).unmarshall(context)); createPolicyResult.setPolicyDocument(context.getUnmarshaller(String.class).unmarshall(context)); createPolicyResult.setPolicyVersionId(context.getUnmarshaller(String.class).unmarshall(context));
policyRequest.setPolicyName(createPolicyResult.getPolicyName()); policyRequest.setPrincipal(certResult.getCertificateArn()); iotClient.attachPrincipalPolicy(policyRequest); detachPrincipalPolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.detachPrincipalPolicy(detachPrincipalPolicyRequest); deletePolicyRequest.setPolicyName(createPolicyResult.getPolicyName()); iotClient.deletePolicy(deletePolicyRequest);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyArn() == null) ? 0 : getPolicyArn().hashCode()); hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); hashCode = prime * hashCode + ((getPolicyVersionId() == null) ? 0 : getPolicyVersionId().hashCode()); return hashCode; }