@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
/** * 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 (getPrincipal() != null) sb.append("Principal: ").append(getPrincipal()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPrincipalPolicyRequest == false) return false; AttachPrincipalPolicyRequest other = (AttachPrincipalPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPrincipal() == null ^ this.getPrincipal() == null) return false; if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(AttachPrincipalPolicyRequest attachPrincipalPolicyRequest, ProtocolMarshaller protocolMarshaller) { if (attachPrincipalPolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attachPrincipalPolicyRequest.getPolicyName(), POLICYNAME_BINDING); protocolMarshaller.marshall(attachPrincipalPolicyRequest.getPrincipal(), PRINCIPAL_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 + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
/** * 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 (getPrincipal() != null) sb.append("principal: " + getPrincipal()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPrincipalPolicyRequest == false) return false; AttachPrincipalPolicyRequest other = (AttachPrincipalPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPrincipal() == null ^ this.getPrincipal() == null) return false; if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == false) return false; return true; } }
public Request<AttachPrincipalPolicyRequest> marshall( AttachPrincipalPolicyRequest attachPrincipalPolicyRequest) { if (attachPrincipalPolicyRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(AttachPrincipalPolicyRequest)"); } Request<AttachPrincipalPolicyRequest> request = new DefaultRequest<AttachPrincipalPolicyRequest>( attachPrincipalPolicyRequest, "AWSIot"); request.setHttpMethod(HttpMethodName.PUT); if (attachPrincipalPolicyRequest.getPrincipal() != null) { request.addHeader("x-amzn-iot-principal", StringUtils.fromString(attachPrincipalPolicyRequest.getPrincipal())); } String uriResourcePath = "/principal-policies/{policyName}"; uriResourcePath = uriResourcePath.replace( "{policyName}", (attachPrincipalPolicyRequest.getPolicyName() == null) ? "" : StringUtils .fromString(attachPrincipalPolicyRequest.getPolicyName())); request.setResourcePath(uriResourcePath); request.addHeader("Content-Length", "0"); request.setContent(new ByteArrayInputStream(new byte[0])); if (!request.getHeaders().containsKey("Content-Type")) { request.addHeader("Content-Type", "application/x-amz-json-1.0"); } return request; } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().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 + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPrincipalPolicyRequest == false) return false; AttachPrincipalPolicyRequest other = (AttachPrincipalPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPrincipal() == null ^ this.getPrincipal() == null) return false; if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == 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 (getPrincipal() != null) sb.append("principal: " + getPrincipal()); 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 (getPrincipal() != null) sb.append("Principal: ").append(getPrincipal()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachPrincipalPolicyRequest == false) return false; AttachPrincipalPolicyRequest other = (AttachPrincipalPolicyRequest) obj; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPrincipal() == null ^ this.getPrincipal() == null) return false; if (other.getPrincipal() != null && other.getPrincipal().equals(this.getPrincipal()) == false) return false; return true; } }
/** * Marshall the given parameter object. */ public void marshall(AttachPrincipalPolicyRequest attachPrincipalPolicyRequest, ProtocolMarshaller protocolMarshaller) { if (attachPrincipalPolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attachPrincipalPolicyRequest.getPolicyName(), POLICYNAME_BINDING); protocolMarshaller.marshall(attachPrincipalPolicyRequest.getPrincipal(), PRINCIPAL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
public Request<AttachPrincipalPolicyRequest> marshall( AttachPrincipalPolicyRequest attachPrincipalPolicyRequest) { if (attachPrincipalPolicyRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(AttachPrincipalPolicyRequest)"); } Request<AttachPrincipalPolicyRequest> request = new DefaultRequest<AttachPrincipalPolicyRequest>( attachPrincipalPolicyRequest, "AWSIot"); request.setHttpMethod(HttpMethodName.PUT); if (attachPrincipalPolicyRequest.getPrincipal() != null) { request.addHeader("x-amzn-iot-principal", StringUtils.fromString(attachPrincipalPolicyRequest.getPrincipal())); } String uriResourcePath = "/principal-policies/{policyName}"; uriResourcePath = uriResourcePath.replace( "{policyName}", (attachPrincipalPolicyRequest.getPolicyName() == null) ? "" : StringUtils .fromString(attachPrincipalPolicyRequest.getPolicyName())); request.setResourcePath(uriResourcePath); request.addHeader("Content-Length", "0"); request.setContent(new ByteArrayInputStream(new byte[0])); if (!request.getHeaders().containsKey("Content-Type")) { request.addHeader("Content-Type", "application/x-amz-json-1.0"); } return request; } }