
com.azure.resourcemanager.network.models.FlowLogStatusParameters 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.network.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Parameters that define a resource to query flow log and traffic analytics (optional) status.
*/
@Fluent
public final class FlowLogStatusParameters implements JsonSerializable {
/*
* The target resource where getting the flow log and traffic analytics (optional) status.
*/
private String targetResourceId;
/**
* Creates an instance of FlowLogStatusParameters class.
*/
public FlowLogStatusParameters() {
}
/**
* Get the targetResourceId property: The target resource where getting the flow log and traffic analytics
* (optional) status.
*
* @return the targetResourceId value.
*/
public String targetResourceId() {
return this.targetResourceId;
}
/**
* Set the targetResourceId property: The target resource where getting the flow log and traffic analytics
* (optional) status.
*
* @param targetResourceId the targetResourceId value to set.
* @return the FlowLogStatusParameters object itself.
*/
public FlowLogStatusParameters withTargetResourceId(String targetResourceId) {
this.targetResourceId = targetResourceId;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (targetResourceId() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property targetResourceId in model FlowLogStatusParameters"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(FlowLogStatusParameters.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("targetResourceId", this.targetResourceId);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of FlowLogStatusParameters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of FlowLogStatusParameters if the JsonReader was pointing to an instance of it, or null if it
* was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the FlowLogStatusParameters.
*/
public static FlowLogStatusParameters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
FlowLogStatusParameters deserializedFlowLogStatusParameters = new FlowLogStatusParameters();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("targetResourceId".equals(fieldName)) {
deserializedFlowLogStatusParameters.targetResourceId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedFlowLogStatusParameters;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy