|
| 1 | +/** |
| 2 | + * This file was auto-generated by Fern from our API Definition. |
| 3 | + */ |
| 4 | +package com.assemblyai.api.resources.transcripts.types; |
| 5 | + |
| 6 | +import com.assemblyai.api.core.ObjectMappers; |
| 7 | +import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| 8 | +import com.fasterxml.jackson.annotation.JsonAnySetter; |
| 9 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
| 10 | +import com.fasterxml.jackson.annotation.JsonInclude; |
| 11 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 12 | +import com.fasterxml.jackson.annotation.JsonSetter; |
| 13 | +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| 14 | +import java.util.HashMap; |
| 15 | +import java.util.Map; |
| 16 | +import java.util.Objects; |
| 17 | + |
| 18 | +@JsonInclude(JsonInclude.Include.NON_EMPTY) |
| 19 | +@JsonDeserialize(builder = TranscriptReadyNotification.Builder.class) |
| 20 | +public final class TranscriptReadyNotification { |
| 21 | + private final String transcriptId; |
| 22 | + |
| 23 | + private final TranscriptReadyStatus status; |
| 24 | + |
| 25 | + private final Map<String, Object> additionalProperties; |
| 26 | + |
| 27 | + private TranscriptReadyNotification( |
| 28 | + String transcriptId, TranscriptReadyStatus status, Map<String, Object> additionalProperties) { |
| 29 | + this.transcriptId = transcriptId; |
| 30 | + this.status = status; |
| 31 | + this.additionalProperties = additionalProperties; |
| 32 | + } |
| 33 | + |
| 34 | + /** |
| 35 | + * @return The ID of the transcript |
| 36 | + */ |
| 37 | + @JsonProperty("transcript_id") |
| 38 | + public String getTranscriptId() { |
| 39 | + return transcriptId; |
| 40 | + } |
| 41 | + |
| 42 | + /** |
| 43 | + * @return The status of the transcript. Either completed or error. |
| 44 | + */ |
| 45 | + @JsonProperty("status") |
| 46 | + public TranscriptReadyStatus getStatus() { |
| 47 | + return status; |
| 48 | + } |
| 49 | + |
| 50 | + @java.lang.Override |
| 51 | + public boolean equals(Object other) { |
| 52 | + if (this == other) return true; |
| 53 | + return other instanceof TranscriptReadyNotification && equalTo((TranscriptReadyNotification) other); |
| 54 | + } |
| 55 | + |
| 56 | + @JsonAnyGetter |
| 57 | + public Map<String, Object> getAdditionalProperties() { |
| 58 | + return this.additionalProperties; |
| 59 | + } |
| 60 | + |
| 61 | + private boolean equalTo(TranscriptReadyNotification other) { |
| 62 | + return transcriptId.equals(other.transcriptId) && status.equals(other.status); |
| 63 | + } |
| 64 | + |
| 65 | + @java.lang.Override |
| 66 | + public int hashCode() { |
| 67 | + return Objects.hash(this.transcriptId, this.status); |
| 68 | + } |
| 69 | + |
| 70 | + @java.lang.Override |
| 71 | + public String toString() { |
| 72 | + return ObjectMappers.stringify(this); |
| 73 | + } |
| 74 | + |
| 75 | + public static TranscriptIdStage builder() { |
| 76 | + return new Builder(); |
| 77 | + } |
| 78 | + |
| 79 | + public interface TranscriptIdStage { |
| 80 | + StatusStage transcriptId(String transcriptId); |
| 81 | + |
| 82 | + Builder from(TranscriptReadyNotification other); |
| 83 | + } |
| 84 | + |
| 85 | + public interface StatusStage { |
| 86 | + _FinalStage status(TranscriptReadyStatus status); |
| 87 | + } |
| 88 | + |
| 89 | + public interface _FinalStage { |
| 90 | + TranscriptReadyNotification build(); |
| 91 | + } |
| 92 | + |
| 93 | + @JsonIgnoreProperties(ignoreUnknown = true) |
| 94 | + public static final class Builder implements TranscriptIdStage, StatusStage, _FinalStage { |
| 95 | + private String transcriptId; |
| 96 | + |
| 97 | + private TranscriptReadyStatus status; |
| 98 | + |
| 99 | + @JsonAnySetter |
| 100 | + private Map<String, Object> additionalProperties = new HashMap<>(); |
| 101 | + |
| 102 | + private Builder() {} |
| 103 | + |
| 104 | + @java.lang.Override |
| 105 | + public Builder from(TranscriptReadyNotification other) { |
| 106 | + transcriptId(other.getTranscriptId()); |
| 107 | + status(other.getStatus()); |
| 108 | + return this; |
| 109 | + } |
| 110 | + |
| 111 | + /** |
| 112 | + * <p>The ID of the transcript</p> |
| 113 | + * @return Reference to {@code this} so that method calls can be chained together. |
| 114 | + */ |
| 115 | + @java.lang.Override |
| 116 | + @JsonSetter("transcript_id") |
| 117 | + public StatusStage transcriptId(String transcriptId) { |
| 118 | + this.transcriptId = transcriptId; |
| 119 | + return this; |
| 120 | + } |
| 121 | + |
| 122 | + /** |
| 123 | + * <p>The status of the transcript. Either completed or error.</p> |
| 124 | + * @return Reference to {@code this} so that method calls can be chained together. |
| 125 | + */ |
| 126 | + @java.lang.Override |
| 127 | + @JsonSetter("status") |
| 128 | + public _FinalStage status(TranscriptReadyStatus status) { |
| 129 | + this.status = status; |
| 130 | + return this; |
| 131 | + } |
| 132 | + |
| 133 | + @java.lang.Override |
| 134 | + public TranscriptReadyNotification build() { |
| 135 | + return new TranscriptReadyNotification(transcriptId, status, additionalProperties); |
| 136 | + } |
| 137 | + } |
| 138 | +} |
0 commit comments