
com.azure.resourcemanager.billing.fluent.models.DocumentDownloadResultInner Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.billing.fluent.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* A secure URL that can be used to download a an entity until the URL expires.
*/
@Immutable
public final class DocumentDownloadResultInner implements JsonSerializable {
/*
* The time in UTC when the download URL will expire.
*/
private String expiryTime;
/*
* The URL to the PDF or .zip file.
*/
private String url;
/**
* Creates an instance of DocumentDownloadResultInner class.
*/
public DocumentDownloadResultInner() {
}
/**
* Get the expiryTime property: The time in UTC when the download URL will expire.
*
* @return the expiryTime value.
*/
public String expiryTime() {
return this.expiryTime;
}
/**
* Get the url property: The URL to the PDF or .zip file.
*
* @return the url value.
*/
public String url() {
return this.url;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DocumentDownloadResultInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DocumentDownloadResultInner if the JsonReader was pointing to an instance of it, or null
* if it was pointing to JSON null.
* @throws IOException If an error occurs while reading the DocumentDownloadResultInner.
*/
public static DocumentDownloadResultInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DocumentDownloadResultInner deserializedDocumentDownloadResultInner = new DocumentDownloadResultInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("expiryTime".equals(fieldName)) {
deserializedDocumentDownloadResultInner.expiryTime = reader.getString();
} else if ("url".equals(fieldName)) {
deserializedDocumentDownloadResultInner.url = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedDocumentDownloadResultInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy