
com.azure.resourcemanager.datafactory.models.SsisLogLocation 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 com.azure.resourcemanager.datafactory.fluent.models.SsisLogLocationTypeProperties;
import java.io.IOException;
/**
* SSIS package execution log location.
*/
@Fluent
public final class SsisLogLocation implements JsonSerializable {
/*
* The SSIS package execution log path. Type: string (or Expression with resultType string).
*/
private Object logPath;
/*
* The type of SSIS log location.
*/
private SsisLogLocationType type;
/*
* SSIS package execution log location properties.
*/
private SsisLogLocationTypeProperties innerTypeProperties = new SsisLogLocationTypeProperties();
/**
* Creates an instance of SsisLogLocation class.
*/
public SsisLogLocation() {
}
/**
* Get the logPath property: The SSIS package execution log path. Type: string (or Expression with resultType
* string).
*
* @return the logPath value.
*/
public Object logPath() {
return this.logPath;
}
/**
* Set the logPath property: The SSIS package execution log path. Type: string (or Expression with resultType
* string).
*
* @param logPath the logPath value to set.
* @return the SsisLogLocation object itself.
*/
public SsisLogLocation withLogPath(Object logPath) {
this.logPath = logPath;
return this;
}
/**
* Get the type property: The type of SSIS log location.
*
* @return the type value.
*/
public SsisLogLocationType type() {
return this.type;
}
/**
* Set the type property: The type of SSIS log location.
*
* @param type the type value to set.
* @return the SsisLogLocation object itself.
*/
public SsisLogLocation withType(SsisLogLocationType type) {
this.type = type;
return this;
}
/**
* Get the innerTypeProperties property: SSIS package execution log location properties.
*
* @return the innerTypeProperties value.
*/
private SsisLogLocationTypeProperties innerTypeProperties() {
return this.innerTypeProperties;
}
/**
* Get the accessCredential property: The package execution log access credential.
*
* @return the accessCredential value.
*/
public SsisAccessCredential accessCredential() {
return this.innerTypeProperties() == null ? null : this.innerTypeProperties().accessCredential();
}
/**
* Set the accessCredential property: The package execution log access credential.
*
* @param accessCredential the accessCredential value to set.
* @return the SsisLogLocation object itself.
*/
public SsisLogLocation withAccessCredential(SsisAccessCredential accessCredential) {
if (this.innerTypeProperties() == null) {
this.innerTypeProperties = new SsisLogLocationTypeProperties();
}
this.innerTypeProperties().withAccessCredential(accessCredential);
return this;
}
/**
* Get the logRefreshInterval property: Specifies the interval to refresh log. The default interval is 5 minutes.
* Type: string (or Expression with resultType string), pattern:
* ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
*
* @return the logRefreshInterval value.
*/
public Object logRefreshInterval() {
return this.innerTypeProperties() == null ? null : this.innerTypeProperties().logRefreshInterval();
}
/**
* Set the logRefreshInterval property: Specifies the interval to refresh log. The default interval is 5 minutes.
* Type: string (or Expression with resultType string), pattern:
* ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
*
* @param logRefreshInterval the logRefreshInterval value to set.
* @return the SsisLogLocation object itself.
*/
public SsisLogLocation withLogRefreshInterval(Object logRefreshInterval) {
if (this.innerTypeProperties() == null) {
this.innerTypeProperties = new SsisLogLocationTypeProperties();
}
this.innerTypeProperties().withLogRefreshInterval(logRefreshInterval);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (logPath() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property logPath in model SsisLogLocation"));
}
if (type() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property type in model SsisLogLocation"));
}
if (innerTypeProperties() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property innerTypeProperties in model SsisLogLocation"));
} else {
innerTypeProperties().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(SsisLogLocation.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeUntypedField("logPath", this.logPath);
jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
jsonWriter.writeJsonField("typeProperties", this.innerTypeProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SsisLogLocation from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SsisLogLocation 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 SsisLogLocation.
*/
public static SsisLogLocation fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SsisLogLocation deserializedSsisLogLocation = new SsisLogLocation();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("logPath".equals(fieldName)) {
deserializedSsisLogLocation.logPath = reader.readUntyped();
} else if ("type".equals(fieldName)) {
deserializedSsisLogLocation.type = SsisLogLocationType.fromString(reader.getString());
} else if ("typeProperties".equals(fieldName)) {
deserializedSsisLogLocation.innerTypeProperties = SsisLogLocationTypeProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedSsisLogLocation;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy