/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.rekognition.model; import java.io.Serializable; import javax.annotation.Generated; @Generated("com.amazonaws:aws-java-sdk-code-generator") public class GetLabelDetectionResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* The current status of the label detection job. *

*/ private String jobStatus; /** *

* If the job fails, StatusMessage provides a descriptive error message. *

*/ private String statusMessage; /** *

* Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every * page of paginated responses from a Amazon Rekognition video operation. *

*/ private VideoMetadata videoMetadata; /** *

* If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent * request to retrieve the next set of labels. *

*/ private String nextToken; /** *

* An array of labels detected in the video. Each element contains the detected label and the time, in milliseconds * from the start of the video, that the label was detected. *

*/ private java.util.List labels; /** *

* Version number of the label detection model that was used to detect labels. *

*/ private String labelModelVersion; /** *

* Job identifier for the label detection operation for which you want to obtain results. The job identifer is * returned by an initial call to StartLabelDetection. *

*/ private String jobId; private Video video; /** *

* A job identifier specified in the call to StartLabelDetection and returned in the job completion notification * sent to your Amazon Simple Notification Service topic. *

*/ private String jobTag; /** *

* Information about the paramters used when getting a response. Includes information on aggregation and sorting * methods. *

*/ private GetLabelDetectionRequestMetadata getRequestMetadata; /** *

* The current status of the label detection job. *

* * @param jobStatus * The current status of the label detection job. * @see VideoJobStatus */ public void setJobStatus(String jobStatus) { this.jobStatus = jobStatus; } /** *

* The current status of the label detection job. *

* * @return The current status of the label detection job. * @see VideoJobStatus */ public String getJobStatus() { return this.jobStatus; } /** *

* The current status of the label detection job. *

* * @param jobStatus * The current status of the label detection job. * @return Returns a reference to this object so that method calls can be chained together. * @see VideoJobStatus */ public GetLabelDetectionResult withJobStatus(String jobStatus) { setJobStatus(jobStatus); return this; } /** *

* The current status of the label detection job. *

* * @param jobStatus * The current status of the label detection job. * @return Returns a reference to this object so that method calls can be chained together. * @see VideoJobStatus */ public GetLabelDetectionResult withJobStatus(VideoJobStatus jobStatus) { this.jobStatus = jobStatus.toString(); return this; } /** *

* If the job fails, StatusMessage provides a descriptive error message. *

* * @param statusMessage * If the job fails, StatusMessage provides a descriptive error message. */ public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } /** *

* If the job fails, StatusMessage provides a descriptive error message. *

* * @return If the job fails, StatusMessage provides a descriptive error message. */ public String getStatusMessage() { return this.statusMessage; } /** *

* If the job fails, StatusMessage provides a descriptive error message. *

* * @param statusMessage * If the job fails, StatusMessage provides a descriptive error message. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withStatusMessage(String statusMessage) { setStatusMessage(statusMessage); return this; } /** *

* Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every * page of paginated responses from a Amazon Rekognition video operation. *

* * @param videoMetadata * Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned * in every page of paginated responses from a Amazon Rekognition video operation. */ public void setVideoMetadata(VideoMetadata videoMetadata) { this.videoMetadata = videoMetadata; } /** *

* Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every * page of paginated responses from a Amazon Rekognition video operation. *

* * @return Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned * in every page of paginated responses from a Amazon Rekognition video operation. */ public VideoMetadata getVideoMetadata() { return this.videoMetadata; } /** *

* Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every * page of paginated responses from a Amazon Rekognition video operation. *

* * @param videoMetadata * Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned * in every page of paginated responses from a Amazon Rekognition video operation. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withVideoMetadata(VideoMetadata videoMetadata) { setVideoMetadata(videoMetadata); return this; } /** *

* If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent * request to retrieve the next set of labels. *

* * @param nextToken * If the response is truncated, Amazon Rekognition Video returns this token that you can use in the * subsequent request to retrieve the next set of labels. */ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** *

* If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent * request to retrieve the next set of labels. *

* * @return If the response is truncated, Amazon Rekognition Video returns this token that you can use in the * subsequent request to retrieve the next set of labels. */ public String getNextToken() { return this.nextToken; } /** *

* If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent * request to retrieve the next set of labels. *

* * @param nextToken * If the response is truncated, Amazon Rekognition Video returns this token that you can use in the * subsequent request to retrieve the next set of labels. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withNextToken(String nextToken) { setNextToken(nextToken); return this; } /** *

* An array of labels detected in the video. Each element contains the detected label and the time, in milliseconds * from the start of the video, that the label was detected. *

* * @return An array of labels detected in the video. Each element contains the detected label and the time, in * milliseconds from the start of the video, that the label was detected. */ public java.util.List getLabels() { return labels; } /** *

* An array of labels detected in the video. Each element contains the detected label and the time, in milliseconds * from the start of the video, that the label was detected. *

* * @param labels * An array of labels detected in the video. Each element contains the detected label and the time, in * milliseconds from the start of the video, that the label was detected. */ public void setLabels(java.util.Collection labels) { if (labels == null) { this.labels = null; return; } this.labels = new java.util.ArrayList(labels); } /** *

* An array of labels detected in the video. Each element contains the detected label and the time, in milliseconds * from the start of the video, that the label was detected. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setLabels(java.util.Collection)} or {@link #withLabels(java.util.Collection)} if you want to override the * existing values. *

* * @param labels * An array of labels detected in the video. Each element contains the detected label and the time, in * milliseconds from the start of the video, that the label was detected. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withLabels(LabelDetection... labels) { if (this.labels == null) { setLabels(new java.util.ArrayList(labels.length)); } for (LabelDetection ele : labels) { this.labels.add(ele); } return this; } /** *

* An array of labels detected in the video. Each element contains the detected label and the time, in milliseconds * from the start of the video, that the label was detected. *

* * @param labels * An array of labels detected in the video. Each element contains the detected label and the time, in * milliseconds from the start of the video, that the label was detected. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withLabels(java.util.Collection labels) { setLabels(labels); return this; } /** *

* Version number of the label detection model that was used to detect labels. *

* * @param labelModelVersion * Version number of the label detection model that was used to detect labels. */ public void setLabelModelVersion(String labelModelVersion) { this.labelModelVersion = labelModelVersion; } /** *

* Version number of the label detection model that was used to detect labels. *

* * @return Version number of the label detection model that was used to detect labels. */ public String getLabelModelVersion() { return this.labelModelVersion; } /** *

* Version number of the label detection model that was used to detect labels. *

* * @param labelModelVersion * Version number of the label detection model that was used to detect labels. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withLabelModelVersion(String labelModelVersion) { setLabelModelVersion(labelModelVersion); return this; } /** *

* Job identifier for the label detection operation for which you want to obtain results. The job identifer is * returned by an initial call to StartLabelDetection. *

* * @param jobId * Job identifier for the label detection operation for which you want to obtain results. The job identifer * is returned by an initial call to StartLabelDetection. */ public void setJobId(String jobId) { this.jobId = jobId; } /** *

* Job identifier for the label detection operation for which you want to obtain results. The job identifer is * returned by an initial call to StartLabelDetection. *

* * @return Job identifier for the label detection operation for which you want to obtain results. The job identifer * is returned by an initial call to StartLabelDetection. */ public String getJobId() { return this.jobId; } /** *

* Job identifier for the label detection operation for which you want to obtain results. The job identifer is * returned by an initial call to StartLabelDetection. *

* * @param jobId * Job identifier for the label detection operation for which you want to obtain results. The job identifer * is returned by an initial call to StartLabelDetection. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withJobId(String jobId) { setJobId(jobId); return this; } /** * @param video */ public void setVideo(Video video) { this.video = video; } /** * @return */ public Video getVideo() { return this.video; } /** * @param video * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withVideo(Video video) { setVideo(video); return this; } /** *

* A job identifier specified in the call to StartLabelDetection and returned in the job completion notification * sent to your Amazon Simple Notification Service topic. *

* * @param jobTag * A job identifier specified in the call to StartLabelDetection and returned in the job completion * notification sent to your Amazon Simple Notification Service topic. */ public void setJobTag(String jobTag) { this.jobTag = jobTag; } /** *

* A job identifier specified in the call to StartLabelDetection and returned in the job completion notification * sent to your Amazon Simple Notification Service topic. *

* * @return A job identifier specified in the call to StartLabelDetection and returned in the job completion * notification sent to your Amazon Simple Notification Service topic. */ public String getJobTag() { return this.jobTag; } /** *

* A job identifier specified in the call to StartLabelDetection and returned in the job completion notification * sent to your Amazon Simple Notification Service topic. *

* * @param jobTag * A job identifier specified in the call to StartLabelDetection and returned in the job completion * notification sent to your Amazon Simple Notification Service topic. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withJobTag(String jobTag) { setJobTag(jobTag); return this; } /** *

* Information about the paramters used when getting a response. Includes information on aggregation and sorting * methods. *

* * @param getRequestMetadata * Information about the paramters used when getting a response. Includes information on aggregation and * sorting methods. */ public void setGetRequestMetadata(GetLabelDetectionRequestMetadata getRequestMetadata) { this.getRequestMetadata = getRequestMetadata; } /** *

* Information about the paramters used when getting a response. Includes information on aggregation and sorting * methods. *

* * @return Information about the paramters used when getting a response. Includes information on aggregation and * sorting methods. */ public GetLabelDetectionRequestMetadata getGetRequestMetadata() { return this.getRequestMetadata; } /** *

* Information about the paramters used when getting a response. Includes information on aggregation and sorting * methods. *

* * @param getRequestMetadata * Information about the paramters used when getting a response. Includes information on aggregation and * sorting methods. * @return Returns a reference to this object so that method calls can be chained together. */ public GetLabelDetectionResult withGetRequestMetadata(GetLabelDetectionRequestMetadata getRequestMetadata) { setGetRequestMetadata(getRequestMetadata); 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 (getJobStatus() != null) sb.append("JobStatus: ").append(getJobStatus()).append(","); if (getStatusMessage() != null) sb.append("StatusMessage: ").append(getStatusMessage()).append(","); if (getVideoMetadata() != null) sb.append("VideoMetadata: ").append(getVideoMetadata()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()).append(","); if (getLabels() != null) sb.append("Labels: ").append(getLabels()).append(","); if (getLabelModelVersion() != null) sb.append("LabelModelVersion: ").append(getLabelModelVersion()).append(","); if (getJobId() != null) sb.append("JobId: ").append(getJobId()).append(","); if (getVideo() != null) sb.append("Video: ").append(getVideo()).append(","); if (getJobTag() != null) sb.append("JobTag: ").append(getJobTag()).append(","); if (getGetRequestMetadata() != null) sb.append("GetRequestMetadata: ").append(getGetRequestMetadata()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetLabelDetectionResult == false) return false; GetLabelDetectionResult other = (GetLabelDetectionResult) obj; if (other.getJobStatus() == null ^ this.getJobStatus() == null) return false; if (other.getJobStatus() != null && other.getJobStatus().equals(this.getJobStatus()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) return false; if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false) return false; if (other.getVideoMetadata() == null ^ this.getVideoMetadata() == null) return false; if (other.getVideoMetadata() != null && other.getVideoMetadata().equals(this.getVideoMetadata()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; if (other.getLabels() == null ^ this.getLabels() == null) return false; if (other.getLabels() != null && other.getLabels().equals(this.getLabels()) == false) return false; if (other.getLabelModelVersion() == null ^ this.getLabelModelVersion() == null) return false; if (other.getLabelModelVersion() != null && other.getLabelModelVersion().equals(this.getLabelModelVersion()) == false) return false; if (other.getJobId() == null ^ this.getJobId() == null) return false; if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == false) return false; if (other.getVideo() == null ^ this.getVideo() == null) return false; if (other.getVideo() != null && other.getVideo().equals(this.getVideo()) == false) return false; if (other.getJobTag() == null ^ this.getJobTag() == null) return false; if (other.getJobTag() != null && other.getJobTag().equals(this.getJobTag()) == false) return false; if (other.getGetRequestMetadata() == null ^ this.getGetRequestMetadata() == null) return false; if (other.getGetRequestMetadata() != null && other.getGetRequestMetadata().equals(this.getGetRequestMetadata()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getJobStatus() == null) ? 0 : getJobStatus().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getVideoMetadata() == null) ? 0 : getVideoMetadata().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getLabels() == null) ? 0 : getLabels().hashCode()); hashCode = prime * hashCode + ((getLabelModelVersion() == null) ? 0 : getLabelModelVersion().hashCode()); hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode()); hashCode = prime * hashCode + ((getVideo() == null) ? 0 : getVideo().hashCode()); hashCode = prime * hashCode + ((getJobTag() == null) ? 0 : getJobTag().hashCode()); hashCode = prime * hashCode + ((getGetRequestMetadata() == null) ? 0 : getGetRequestMetadata().hashCode()); return hashCode; } @Override public GetLabelDetectionResult clone() { try { return (GetLabelDetectionResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }