|
| 1 | +// Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | +// Licensed under the MIT License. |
| 3 | +// Code generated by Microsoft (R) TypeSpec Code Generator. |
| 4 | +package com.azure.ai.openai.implementation.models; |
| 5 | + |
| 6 | +import com.azure.ai.openai.models.AzureOpenAIOperationState; |
| 7 | +import com.azure.core.annotation.Generated; |
| 8 | +import com.azure.core.annotation.Immutable; |
| 9 | +import com.azure.core.models.ResponseError; |
| 10 | +import com.fasterxml.jackson.annotation.JsonCreator; |
| 11 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 12 | +import java.time.Instant; |
| 13 | +import java.time.OffsetDateTime; |
| 14 | +import java.time.ZoneOffset; |
| 15 | + |
| 16 | +/** A polling status update or final response payload for an image operation. */ |
| 17 | +@Immutable |
| 18 | +public final class BatchImageGenerationOperationResponse { |
| 19 | + |
| 20 | + /* |
| 21 | + * The ID of the operation. |
| 22 | + */ |
| 23 | + @Generated |
| 24 | + @JsonProperty(value = "id") |
| 25 | + private String id; |
| 26 | + |
| 27 | + /* |
| 28 | + * A timestamp when this job or item was created (in unix epochs). |
| 29 | + */ |
| 30 | + @Generated |
| 31 | + @JsonProperty(value = "created") |
| 32 | + private long createdAt; |
| 33 | + |
| 34 | + /* |
| 35 | + * A timestamp when this operation and its associated images expire and will be deleted (in unix epochs). |
| 36 | + */ |
| 37 | + @Generated |
| 38 | + @JsonProperty(value = "expires") |
| 39 | + private Long expires; |
| 40 | + |
| 41 | + /* |
| 42 | + * The result of the operation if the operation succeeded. |
| 43 | + */ |
| 44 | + @Generated |
| 45 | + @JsonProperty(value = "result") |
| 46 | + private ImageGenerations result; |
| 47 | + |
| 48 | + /* |
| 49 | + * The status of the operation |
| 50 | + */ |
| 51 | + @Generated |
| 52 | + @JsonProperty(value = "status") |
| 53 | + private AzureOpenAIOperationState status; |
| 54 | + |
| 55 | + /* |
| 56 | + * The error if the operation failed. |
| 57 | + */ |
| 58 | + @Generated |
| 59 | + @JsonProperty(value = "error") |
| 60 | + private ResponseError error; |
| 61 | + |
| 62 | + /** |
| 63 | + * Creates an instance of BatchImageGenerationOperationResponse class. |
| 64 | + * |
| 65 | + * @param id the id value to set. |
| 66 | + * @param createdAt the createdAt value to set. |
| 67 | + * @param status the status value to set. |
| 68 | + */ |
| 69 | + @Generated |
| 70 | + private BatchImageGenerationOperationResponse( |
| 71 | + String id, OffsetDateTime createdAt, AzureOpenAIOperationState status) { |
| 72 | + this.id = id; |
| 73 | + this.createdAt = createdAt.toEpochSecond(); |
| 74 | + this.status = status; |
| 75 | + } |
| 76 | + |
| 77 | + @Generated |
| 78 | + @JsonCreator |
| 79 | + private BatchImageGenerationOperationResponse( |
| 80 | + @JsonProperty(value = "id") String id, |
| 81 | + @JsonProperty(value = "created") long createdAt, |
| 82 | + @JsonProperty(value = "status") AzureOpenAIOperationState status) { |
| 83 | + this(id, OffsetDateTime.ofInstant(Instant.ofEpochSecond(createdAt), ZoneOffset.UTC), status); |
| 84 | + } |
| 85 | + |
| 86 | + /** |
| 87 | + * Get the id property: The ID of the operation. |
| 88 | + * |
| 89 | + * @return the id value. |
| 90 | + */ |
| 91 | + @Generated |
| 92 | + public String getId() { |
| 93 | + return this.id; |
| 94 | + } |
| 95 | + |
| 96 | + /** |
| 97 | + * Get the createdAt property: A timestamp when this job or item was created (in unix epochs). |
| 98 | + * |
| 99 | + * @return the createdAt value. |
| 100 | + */ |
| 101 | + @Generated |
| 102 | + public OffsetDateTime getCreatedAt() { |
| 103 | + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); |
| 104 | + } |
| 105 | + |
| 106 | + /** |
| 107 | + * Get the expires property: A timestamp when this operation and its associated images expire and will be deleted |
| 108 | + * (in unix epochs). |
| 109 | + * |
| 110 | + * @return the expires value. |
| 111 | + */ |
| 112 | + @Generated |
| 113 | + public Long getExpires() { |
| 114 | + return this.expires; |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * Get the result property: The result of the operation if the operation succeeded. |
| 119 | + * |
| 120 | + * @return the result value. |
| 121 | + */ |
| 122 | + @Generated |
| 123 | + public ImageGenerations getResult() { |
| 124 | + return this.result; |
| 125 | + } |
| 126 | + |
| 127 | + /** |
| 128 | + * Get the status property: The status of the operation. |
| 129 | + * |
| 130 | + * @return the status value. |
| 131 | + */ |
| 132 | + @Generated |
| 133 | + public AzureOpenAIOperationState getStatus() { |
| 134 | + return this.status; |
| 135 | + } |
| 136 | + |
| 137 | + /** |
| 138 | + * Get the error property: The error if the operation failed. |
| 139 | + * |
| 140 | + * @return the error value. |
| 141 | + */ |
| 142 | + @Generated |
| 143 | + public ResponseError getError() { |
| 144 | + return this.error; |
| 145 | + } |
| 146 | +} |
0 commit comments