
com.azure.resourcemanager.datafactory.models.LogLocationSettings 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.datafactory.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;
/**
* Log location settings.
*/
@Fluent
public final class LogLocationSettings implements JsonSerializable {
/*
* Log storage linked service reference.
*/
private LinkedServiceReference linkedServiceName;
/*
* The path to storage for storing detailed logs of activity execution. Type: string (or Expression with resultType
* string).
*/
private Object path;
/**
* Creates an instance of LogLocationSettings class.
*/
public LogLocationSettings() {
}
/**
* Get the linkedServiceName property: Log storage linked service reference.
*
* @return the linkedServiceName value.
*/
public LinkedServiceReference linkedServiceName() {
return this.linkedServiceName;
}
/**
* Set the linkedServiceName property: Log storage linked service reference.
*
* @param linkedServiceName the linkedServiceName value to set.
* @return the LogLocationSettings object itself.
*/
public LogLocationSettings withLinkedServiceName(LinkedServiceReference linkedServiceName) {
this.linkedServiceName = linkedServiceName;
return this;
}
/**
* Get the path property: The path to storage for storing detailed logs of activity execution. Type: string (or
* Expression with resultType string).
*
* @return the path value.
*/
public Object path() {
return this.path;
}
/**
* Set the path property: The path to storage for storing detailed logs of activity execution. Type: string (or
* Expression with resultType string).
*
* @param path the path value to set.
* @return the LogLocationSettings object itself.
*/
public LogLocationSettings withPath(Object path) {
this.path = path;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (linkedServiceName() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property linkedServiceName in model LogLocationSettings"));
} else {
linkedServiceName().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(LogLocationSettings.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("linkedServiceName", this.linkedServiceName);
jsonWriter.writeUntypedField("path", this.path);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of LogLocationSettings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of LogLocationSettings 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 LogLocationSettings.
*/
public static LogLocationSettings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
LogLocationSettings deserializedLogLocationSettings = new LogLocationSettings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("linkedServiceName".equals(fieldName)) {
deserializedLogLocationSettings.linkedServiceName = LinkedServiceReference.fromJson(reader);
} else if ("path".equals(fieldName)) {
deserializedLogLocationSettings.path = reader.readUntyped();
} else {
reader.skipChildren();
}
}
return deserializedLogLocationSettings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy