com.azure.resourcemanager.security.models.ScanSummary 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.security.models;
import com.azure.core.annotation.Fluent;
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 summary of the scan results.
*/
@Fluent
public final class ScanSummary implements JsonSerializable {
/*
* A summary of the scan results of the blobs that were scanned.
*/
private BlobsScanSummary blobs;
/*
* The estimated cost of the scan. Only available for a scan which has terminated.
*/
private Double estimatedScanCostUsd;
/**
* Creates an instance of ScanSummary class.
*/
public ScanSummary() {
}
/**
* Get the blobs property: A summary of the scan results of the blobs that were scanned.
*
* @return the blobs value.
*/
public BlobsScanSummary blobs() {
return this.blobs;
}
/**
* Set the blobs property: A summary of the scan results of the blobs that were scanned.
*
* @param blobs the blobs value to set.
* @return the ScanSummary object itself.
*/
public ScanSummary withBlobs(BlobsScanSummary blobs) {
this.blobs = blobs;
return this;
}
/**
* Get the estimatedScanCostUsd property: The estimated cost of the scan. Only available for a scan which has
* terminated.
*
* @return the estimatedScanCostUsd value.
*/
public Double estimatedScanCostUsd() {
return this.estimatedScanCostUsd;
}
/**
* Set the estimatedScanCostUsd property: The estimated cost of the scan. Only available for a scan which has
* terminated.
*
* @param estimatedScanCostUsd the estimatedScanCostUsd value to set.
* @return the ScanSummary object itself.
*/
public ScanSummary withEstimatedScanCostUsd(Double estimatedScanCostUsd) {
this.estimatedScanCostUsd = estimatedScanCostUsd;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (blobs() != null) {
blobs().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("blobs", this.blobs);
jsonWriter.writeNumberField("estimatedScanCostUSD", this.estimatedScanCostUsd);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ScanSummary from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ScanSummary 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 ScanSummary.
*/
public static ScanSummary fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ScanSummary deserializedScanSummary = new ScanSummary();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("blobs".equals(fieldName)) {
deserializedScanSummary.blobs = BlobsScanSummary.fromJson(reader);
} else if ("estimatedScanCostUSD".equals(fieldName)) {
deserializedScanSummary.estimatedScanCostUsd = reader.getNullable(JsonReader::getDouble);
} else {
reader.skipChildren();
}
}
return deserializedScanSummary;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy