
com.azure.resourcemanager.network.fluent.models.PacketCaptureInner 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.fluent.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 com.azure.resourcemanager.network.models.PacketCaptureFilter;
import com.azure.resourcemanager.network.models.PacketCaptureMachineScope;
import com.azure.resourcemanager.network.models.PacketCaptureSettings;
import com.azure.resourcemanager.network.models.PacketCaptureStorageLocation;
import com.azure.resourcemanager.network.models.PacketCaptureTargetType;
import java.io.IOException;
import java.util.List;
/**
* Parameters that define the create packet capture operation.
*/
@Fluent
public final class PacketCaptureInner implements JsonSerializable {
/*
* Properties of the packet capture.
*/
private PacketCaptureParameters innerProperties = new PacketCaptureParameters();
/**
* Creates an instance of PacketCaptureInner class.
*/
public PacketCaptureInner() {
}
/**
* Get the innerProperties property: Properties of the packet capture.
*
* @return the innerProperties value.
*/
private PacketCaptureParameters innerProperties() {
return this.innerProperties;
}
/**
* Get the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently
* supported.
*
* @return the target value.
*/
public String target() {
return this.innerProperties() == null ? null : this.innerProperties().target();
}
/**
* Set the target property: The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently
* supported.
*
* @param target the target value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withTarget(String target) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withTarget(target);
return this;
}
/**
* Get the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If
* both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS.
*
* @return the scope value.
*/
public PacketCaptureMachineScope scope() {
return this.innerProperties() == null ? null : this.innerProperties().scope();
}
/**
* Set the scope property: A list of AzureVMSS instances which can be included or excluded to run packet capture. If
* both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS.
*
* @param scope the scope value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withScope(PacketCaptureMachineScope scope) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withScope(scope);
return this;
}
/**
* Get the targetType property: Target type of the resource provided.
*
* @return the targetType value.
*/
public PacketCaptureTargetType targetType() {
return this.innerProperties() == null ? null : this.innerProperties().targetType();
}
/**
* Set the targetType property: Target type of the resource provided.
*
* @param targetType the targetType value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withTargetType(PacketCaptureTargetType targetType) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withTargetType(targetType);
return this;
}
/**
* Get the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated.
*
* @return the bytesToCapturePerPacket value.
*/
public Long bytesToCapturePerPacket() {
return this.innerProperties() == null ? null : this.innerProperties().bytesToCapturePerPacket();
}
/**
* Set the bytesToCapturePerPacket property: Number of bytes captured per packet, the remaining bytes are truncated.
*
* @param bytesToCapturePerPacket the bytesToCapturePerPacket value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withBytesToCapturePerPacket(Long bytesToCapturePerPacket) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withBytesToCapturePerPacket(bytesToCapturePerPacket);
return this;
}
/**
* Get the totalBytesPerSession property: Maximum size of the capture output.
*
* @return the totalBytesPerSession value.
*/
public Long totalBytesPerSession() {
return this.innerProperties() == null ? null : this.innerProperties().totalBytesPerSession();
}
/**
* Set the totalBytesPerSession property: Maximum size of the capture output.
*
* @param totalBytesPerSession the totalBytesPerSession value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withTotalBytesPerSession(Long totalBytesPerSession) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withTotalBytesPerSession(totalBytesPerSession);
return this;
}
/**
* Get the timeLimitInSeconds property: Maximum duration of the capture session in seconds.
*
* @return the timeLimitInSeconds value.
*/
public Integer timeLimitInSeconds() {
return this.innerProperties() == null ? null : this.innerProperties().timeLimitInSeconds();
}
/**
* Set the timeLimitInSeconds property: Maximum duration of the capture session in seconds.
*
* @param timeLimitInSeconds the timeLimitInSeconds value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withTimeLimitInSeconds(Integer timeLimitInSeconds) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withTimeLimitInSeconds(timeLimitInSeconds);
return this;
}
/**
* Get the storageLocation property: The storage location for a packet capture session.
*
* @return the storageLocation value.
*/
public PacketCaptureStorageLocation storageLocation() {
return this.innerProperties() == null ? null : this.innerProperties().storageLocation();
}
/**
* Set the storageLocation property: The storage location for a packet capture session.
*
* @param storageLocation the storageLocation value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withStorageLocation(PacketCaptureStorageLocation storageLocation) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withStorageLocation(storageLocation);
return this;
}
/**
* Get the filters property: A list of packet capture filters.
*
* @return the filters value.
*/
public List filters() {
return this.innerProperties() == null ? null : this.innerProperties().filters();
}
/**
* Set the filters property: A list of packet capture filters.
*
* @param filters the filters value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withFilters(List filters) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withFilters(filters);
return this;
}
/**
* Get the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true'
* or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'.
*
* @return the continuousCapture value.
*/
public Boolean continuousCapture() {
return this.innerProperties() == null ? null : this.innerProperties().continuousCapture();
}
/**
* Set the continuousCapture property: This continuous capture is a nullable boolean, which can hold 'null', 'true'
* or 'false' value. If we do not pass this parameter, it would be consider as 'null', default value is 'null'.
*
* @param continuousCapture the continuousCapture value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withContinuousCapture(Boolean continuousCapture) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withContinuousCapture(continuousCapture);
return this;
}
/**
* Get the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes',
* 'SessionTimeLimitInSeconds' values.
*
* @return the captureSettings value.
*/
public PacketCaptureSettings captureSettings() {
return this.innerProperties() == null ? null : this.innerProperties().captureSettings();
}
/**
* Set the captureSettings property: The capture setting holds the 'FileCount', 'FileSizeInBytes',
* 'SessionTimeLimitInSeconds' values.
*
* @param captureSettings the captureSettings value to set.
* @return the PacketCaptureInner object itself.
*/
public PacketCaptureInner withCaptureSettings(PacketCaptureSettings captureSettings) {
if (this.innerProperties() == null) {
this.innerProperties = new PacketCaptureParameters();
}
this.innerProperties().withCaptureSettings(captureSettings);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property innerProperties in model PacketCaptureInner"));
} else {
innerProperties().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(PacketCaptureInner.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of PacketCaptureInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of PacketCaptureInner 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 PacketCaptureInner.
*/
public static PacketCaptureInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
PacketCaptureInner deserializedPacketCaptureInner = new PacketCaptureInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("properties".equals(fieldName)) {
deserializedPacketCaptureInner.innerProperties = PacketCaptureParameters.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedPacketCaptureInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy