@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); return hashCode; }
/** * <p> * The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a * maximum length of 2048, excluding whitespace. * </p> * * @param policyDocument * The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a * maximum length of 2048, excluding whitespace. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyRequest withPolicyDocument(String policyDocument) { setPolicyDocument(policyDocument); 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 CreatePolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
createPolicyRequest = new CreatePolicyRequest(); createPolicyRequest.setPolicyName(IOT_POLICY_NAME); createPolicyRequest.setPolicyDocument(policyDocument); createPolicyResult = iotClient.createPolicy(createPolicyRequest); } catch (Exception ex) {
getClient().createPolicy(new CreatePolicyRequest(). withPolicyDocument(policyString).withPolicyName(id + "-Policy"));
createPolicyRequest = new CreatePolicyRequest(); createPolicyRequest.setPolicyName(IOT_POLICY_NAME); createPolicyRequest.setPolicyDocument(policyDocument); createPolicyResult = iotClient.createPolicy(createPolicyRequest); } catch (Exception ex) {
getClient().createPolicy(new CreatePolicyRequest(). withPolicyDocument(policyString).withPolicyName(id + "-Policy"));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreatePolicyRequest == false) return false; CreatePolicyRequest other = (CreatePolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null) return false; if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == false) return false; return true; }
createPolicyRequest = new CreatePolicyRequest(); createPolicyRequest.setPolicyName(IOT_POLICY_NAME); createPolicyRequest.setPolicyDocument(policyDocument); createPolicyResult = iotClient.createPolicy(createPolicyRequest); } catch (Exception ex) {
/** * <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 CreatePolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a * maximum length of 2048, excluding whitespace. * </p> * * @param policyDocument * The JSON document that describes the policy. <b>policyDocument</b> must have a minimum length of 1, with a * maximum length of 2048, excluding whitespace. * @return Returns a reference to this object so that method calls can be chained together. */ public CreatePolicyRequest 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 (getPolicyDocument() != null) sb.append("PolicyDocument: ").append(getPolicyDocument()); sb.append("}"); return sb.toString(); }
createPolicyRequest = new CreatePolicyRequest(); createPolicyRequest.setPolicyName(IOT_POLICY_NAME); createPolicyRequest.setPolicyDocument(policyDocument); createPolicyResult = iotClient.createPolicy(createPolicyRequest); } catch (Exception ex) {
/** * Marshall the given parameter object. */ public void marshall(CreatePolicyRequest createPolicyRequest, ProtocolMarshaller protocolMarshaller) { if (createPolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createPolicyRequest.getPolicyName(), POLICYNAME_BINDING); protocolMarshaller.marshall(createPolicyRequest.getPolicyDocument(), POLICYDOCUMENT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
createPolicyRequest = new CreatePolicyRequest(); createPolicyRequest.setPolicyName(IOT_POLICY_NAME); createPolicyRequest.setPolicyDocument(policyDocument); createPolicyResult = iotClient.createPolicy(createPolicyRequest); } catch (Exception ex) {
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreatePolicyRequest == false) return false; CreatePolicyRequest other = (CreatePolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null) return false; if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == 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 (getPolicyDocument() != null) sb.append("policyDocument: " + getPolicyDocument()); sb.append("}"); return sb.toString(); }
uriResourcePath = uriResourcePath.replace( "{policyName}", (createPolicyRequest.getPolicyName() == null) ? "" : StringUtils .fromString(createPolicyRequest.getPolicyName())); request.setResourcePath(uriResourcePath); try { jsonWriter.beginObject(); if (createPolicyRequest.getPolicyDocument() != null) { String policyDocument = createPolicyRequest.getPolicyDocument(); jsonWriter.name("policyDocument"); jsonWriter.value(policyDocument);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); return hashCode; }