@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getThingName() == null) ? 0 : getThingName().hashCode()); hashCode = prime * hashCode + ((getPrincipal() == null) ? 0 : getPrincipal().hashCode()); return hashCode; }
/** * <p> * The principal, such as a certificate or other credential. * </p> * * @param principal * The principal, such as a certificate or other credential. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachThingPrincipalRequest withPrincipal(String principal) { setPrincipal(principal); return this; }
/** * <p> * The name of the thing. * </p> * * @param thingName * The name of the thing. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachThingPrincipalRequest withThingName(String thingName) { setThingName(thingName); return this; }
getClient().attachThingPrincipal(new AttachThingPrincipalRequest(). withPrincipal(resp2.getCertificateArn()).withThingName(id));
getClient().attachThingPrincipal(new AttachThingPrincipalRequest(). withPrincipal(resp2.getCertificateArn()).withThingName(id));
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachThingPrincipalRequest == false) return false; AttachThingPrincipalRequest other = (AttachThingPrincipalRequest) obj; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == 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; }
/** * <p> * The name of the thing. * </p> * * @param thingName * The name of the thing. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachThingPrincipalRequest withThingName(String thingName) { setThingName(thingName); return this; }
/** * <p> * The principal, such as a certificate or other credential. * </p> * * @param principal * The principal, such as a certificate or other credential. * @return Returns a reference to this object so that method calls can be chained together. */ public AttachThingPrincipalRequest withPrincipal(String principal) { setPrincipal(principal); 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 (getThingName() != null) sb.append("ThingName: ").append(getThingName()).append(","); if (getPrincipal() != null) sb.append("Principal: ").append(getPrincipal()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(AttachThingPrincipalRequest attachThingPrincipalRequest, ProtocolMarshaller protocolMarshaller) { if (attachThingPrincipalRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attachThingPrincipalRequest.getThingName(), THINGNAME_BINDING); protocolMarshaller.marshall(attachThingPrincipalRequest.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 + ((getThingName() == null) ? 0 : getThingName().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 AttachThingPrincipalRequest == false) return false; AttachThingPrincipalRequest other = (AttachThingPrincipalRequest) obj; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == 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 (getThingName() != null) sb.append("thingName: " + getThingName() + ","); if (getPrincipal() != null) sb.append("principal: " + getPrincipal()); sb.append("}"); return sb.toString(); }
public Request<AttachThingPrincipalRequest> marshall( AttachThingPrincipalRequest attachThingPrincipalRequest) { if (attachThingPrincipalRequest == null) { throw new AmazonClientException( "Invalid argument passed to marshall(AttachThingPrincipalRequest)"); } Request<AttachThingPrincipalRequest> request = new DefaultRequest<AttachThingPrincipalRequest>( attachThingPrincipalRequest, "AWSIot"); request.setHttpMethod(HttpMethodName.PUT); if (attachThingPrincipalRequest.getPrincipal() != null) { request.addHeader("x-amzn-principal", StringUtils.fromString(attachThingPrincipalRequest.getPrincipal())); } String uriResourcePath = "/things/{thingName}/principals"; uriResourcePath = uriResourcePath.replace( "{thingName}", (attachThingPrincipalRequest.getThingName() == null) ? "" : StringUtils .fromString(attachThingPrincipalRequest.getThingName())); 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 + ((getThingName() == null) ? 0 : getThingName().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 + ((getThingName() == null) ? 0 : getThingName().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 AttachThingPrincipalRequest == false) return false; AttachThingPrincipalRequest other = (AttachThingPrincipalRequest) obj; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == 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; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttachThingPrincipalRequest == false) return false; AttachThingPrincipalRequest other = (AttachThingPrincipalRequest) obj; if (other.getThingName() == null ^ this.getThingName() == null) return false; if (other.getThingName() != null && other.getThingName().equals(this.getThingName()) == 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 (getThingName() != null) sb.append("thingName: " + getThingName() + ","); 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 (getThingName() != null) sb.append("ThingName: ").append(getThingName()).append(","); if (getPrincipal() != null) sb.append("Principal: ").append(getPrincipal()); sb.append("}"); return sb.toString(); }