
com.azure.resourcemanager.datafactory.models.Transformation 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;
/**
* A data flow transformation.
*/
@Fluent
public class Transformation implements JsonSerializable {
/*
* Transformation name.
*/
private String name;
/*
* Transformation description.
*/
private String description;
/*
* Dataset reference.
*/
private DatasetReference dataset;
/*
* Linked service reference.
*/
private LinkedServiceReference linkedService;
/*
* Flowlet Reference
*/
private DataFlowReference flowlet;
/**
* Creates an instance of Transformation class.
*/
public Transformation() {
}
/**
* Get the name property: Transformation name.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Transformation name.
*
* @param name the name value to set.
* @return the Transformation object itself.
*/
public Transformation withName(String name) {
this.name = name;
return this;
}
/**
* Get the description property: Transformation description.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: Transformation description.
*
* @param description the description value to set.
* @return the Transformation object itself.
*/
public Transformation withDescription(String description) {
this.description = description;
return this;
}
/**
* Get the dataset property: Dataset reference.
*
* @return the dataset value.
*/
public DatasetReference dataset() {
return this.dataset;
}
/**
* Set the dataset property: Dataset reference.
*
* @param dataset the dataset value to set.
* @return the Transformation object itself.
*/
public Transformation withDataset(DatasetReference dataset) {
this.dataset = dataset;
return this;
}
/**
* Get the linkedService property: Linked service reference.
*
* @return the linkedService value.
*/
public LinkedServiceReference linkedService() {
return this.linkedService;
}
/**
* Set the linkedService property: Linked service reference.
*
* @param linkedService the linkedService value to set.
* @return the Transformation object itself.
*/
public Transformation withLinkedService(LinkedServiceReference linkedService) {
this.linkedService = linkedService;
return this;
}
/**
* Get the flowlet property: Flowlet Reference.
*
* @return the flowlet value.
*/
public DataFlowReference flowlet() {
return this.flowlet;
}
/**
* Set the flowlet property: Flowlet Reference.
*
* @param flowlet the flowlet value to set.
* @return the Transformation object itself.
*/
public Transformation withFlowlet(DataFlowReference flowlet) {
this.flowlet = flowlet;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (name() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property name in model Transformation"));
}
if (dataset() != null) {
dataset().validate();
}
if (linkedService() != null) {
linkedService().validate();
}
if (flowlet() != null) {
flowlet().validate();
}
}
private static final ClientLogger LOGGER = new ClientLogger(Transformation.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeStringField("description", this.description);
jsonWriter.writeJsonField("dataset", this.dataset);
jsonWriter.writeJsonField("linkedService", this.linkedService);
jsonWriter.writeJsonField("flowlet", this.flowlet);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of Transformation from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of Transformation 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 Transformation.
*/
public static Transformation fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
Transformation deserializedTransformation = new Transformation();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedTransformation.name = reader.getString();
} else if ("description".equals(fieldName)) {
deserializedTransformation.description = reader.getString();
} else if ("dataset".equals(fieldName)) {
deserializedTransformation.dataset = DatasetReference.fromJson(reader);
} else if ("linkedService".equals(fieldName)) {
deserializedTransformation.linkedService = LinkedServiceReference.fromJson(reader);
} else if ("flowlet".equals(fieldName)) {
deserializedTransformation.flowlet = DataFlowReference.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedTransformation;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy