![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.securityinsights.models.CodelessConnectorPollingResponseProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.securityinsights.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;
import java.util.List;
/**
* Describes the response from the external server.
*/
@Fluent
public final class CodelessConnectorPollingResponseProperties
implements JsonSerializable {
/*
* Describes the path we should extract the data in the response
*/
private List eventsJsonPaths;
/*
* Describes the path we should extract the status code in the response
*/
private String successStatusJsonPath;
/*
* Describes the path we should extract the status value in the response
*/
private String successStatusValue;
/*
* Describes if the data in the response is Gzip
*/
private Boolean isGzipCompressed;
/**
* Creates an instance of CodelessConnectorPollingResponseProperties class.
*/
public CodelessConnectorPollingResponseProperties() {
}
/**
* Get the eventsJsonPaths property: Describes the path we should extract the data in the response.
*
* @return the eventsJsonPaths value.
*/
public List eventsJsonPaths() {
return this.eventsJsonPaths;
}
/**
* Set the eventsJsonPaths property: Describes the path we should extract the data in the response.
*
* @param eventsJsonPaths the eventsJsonPaths value to set.
* @return the CodelessConnectorPollingResponseProperties object itself.
*/
public CodelessConnectorPollingResponseProperties withEventsJsonPaths(List eventsJsonPaths) {
this.eventsJsonPaths = eventsJsonPaths;
return this;
}
/**
* Get the successStatusJsonPath property: Describes the path we should extract the status code in the response.
*
* @return the successStatusJsonPath value.
*/
public String successStatusJsonPath() {
return this.successStatusJsonPath;
}
/**
* Set the successStatusJsonPath property: Describes the path we should extract the status code in the response.
*
* @param successStatusJsonPath the successStatusJsonPath value to set.
* @return the CodelessConnectorPollingResponseProperties object itself.
*/
public CodelessConnectorPollingResponseProperties withSuccessStatusJsonPath(String successStatusJsonPath) {
this.successStatusJsonPath = successStatusJsonPath;
return this;
}
/**
* Get the successStatusValue property: Describes the path we should extract the status value in the response.
*
* @return the successStatusValue value.
*/
public String successStatusValue() {
return this.successStatusValue;
}
/**
* Set the successStatusValue property: Describes the path we should extract the status value in the response.
*
* @param successStatusValue the successStatusValue value to set.
* @return the CodelessConnectorPollingResponseProperties object itself.
*/
public CodelessConnectorPollingResponseProperties withSuccessStatusValue(String successStatusValue) {
this.successStatusValue = successStatusValue;
return this;
}
/**
* Get the isGzipCompressed property: Describes if the data in the response is Gzip.
*
* @return the isGzipCompressed value.
*/
public Boolean isGzipCompressed() {
return this.isGzipCompressed;
}
/**
* Set the isGzipCompressed property: Describes if the data in the response is Gzip.
*
* @param isGzipCompressed the isGzipCompressed value to set.
* @return the CodelessConnectorPollingResponseProperties object itself.
*/
public CodelessConnectorPollingResponseProperties withIsGzipCompressed(Boolean isGzipCompressed) {
this.isGzipCompressed = isGzipCompressed;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (eventsJsonPaths() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property eventsJsonPaths in model CodelessConnectorPollingResponseProperties"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(CodelessConnectorPollingResponseProperties.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeArrayField("eventsJsonPaths", this.eventsJsonPaths,
(writer, element) -> writer.writeString(element));
jsonWriter.writeStringField("successStatusJsonPath", this.successStatusJsonPath);
jsonWriter.writeStringField("successStatusValue", this.successStatusValue);
jsonWriter.writeBooleanField("isGzipCompressed", this.isGzipCompressed);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of CodelessConnectorPollingResponseProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CodelessConnectorPollingResponseProperties 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 CodelessConnectorPollingResponseProperties.
*/
public static CodelessConnectorPollingResponseProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CodelessConnectorPollingResponseProperties deserializedCodelessConnectorPollingResponseProperties
= new CodelessConnectorPollingResponseProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("eventsJsonPaths".equals(fieldName)) {
List eventsJsonPaths = reader.readArray(reader1 -> reader1.getString());
deserializedCodelessConnectorPollingResponseProperties.eventsJsonPaths = eventsJsonPaths;
} else if ("successStatusJsonPath".equals(fieldName)) {
deserializedCodelessConnectorPollingResponseProperties.successStatusJsonPath = reader.getString();
} else if ("successStatusValue".equals(fieldName)) {
deserializedCodelessConnectorPollingResponseProperties.successStatusValue = reader.getString();
} else if ("isGzipCompressed".equals(fieldName)) {
deserializedCodelessConnectorPollingResponseProperties.isGzipCompressed
= reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedCodelessConnectorPollingResponseProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy