All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.datafactory.models.Office365Source 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.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * A copy activity source for an Office 365 service.
 */
@Fluent
public final class Office365Source extends CopySource {
    /*
     * Copy source type.
     */
    private String type = "Office365Source";

    /*
     * The groups containing all the users. Type: array of strings (or Expression with resultType array of strings).
     */
    private Object allowedGroups;

    /*
     * The user scope uri. Type: string (or Expression with resultType string).
     */
    private Object userScopeFilterUri;

    /*
     * The Column to apply the  and . Type: string (or Expression
     * with resultType string).
     */
    private Object dateFilterColumn;

    /*
     * Start time of the requested range for this dataset. Type: string (or Expression with resultType string).
     */
    private Object startTime;

    /*
     * End time of the requested range for this dataset. Type: string (or Expression with resultType string).
     */
    private Object endTime;

    /*
     * The columns to be read out from the Office 365 table. Type: array of objects (or Expression with resultType array
     * of objects). itemType: OutputColumn. Example: [ { "name": "Id" }, { "name": "CreatedDateTime" } ]
     */
    private Object outputColumns;

    /**
     * Creates an instance of Office365Source class.
     */
    public Office365Source() {
    }

    /**
     * Get the type property: Copy source type.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the allowedGroups property: The groups containing all the users. Type: array of strings (or Expression with
     * resultType array of strings).
     * 
     * @return the allowedGroups value.
     */
    public Object allowedGroups() {
        return this.allowedGroups;
    }

    /**
     * Set the allowedGroups property: The groups containing all the users. Type: array of strings (or Expression with
     * resultType array of strings).
     * 
     * @param allowedGroups the allowedGroups value to set.
     * @return the Office365Source object itself.
     */
    public Office365Source withAllowedGroups(Object allowedGroups) {
        this.allowedGroups = allowedGroups;
        return this;
    }

    /**
     * Get the userScopeFilterUri property: The user scope uri. Type: string (or Expression with resultType string).
     * 
     * @return the userScopeFilterUri value.
     */
    public Object userScopeFilterUri() {
        return this.userScopeFilterUri;
    }

    /**
     * Set the userScopeFilterUri property: The user scope uri. Type: string (or Expression with resultType string).
     * 
     * @param userScopeFilterUri the userScopeFilterUri value to set.
     * @return the Office365Source object itself.
     */
    public Office365Source withUserScopeFilterUri(Object userScopeFilterUri) {
        this.userScopeFilterUri = userScopeFilterUri;
        return this;
    }

    /**
     * Get the dateFilterColumn property: The Column to apply the <paramref name="StartTime"/> and <paramref
     * name="EndTime"/>. Type: string (or Expression with resultType string).
     * 
     * @return the dateFilterColumn value.
     */
    public Object dateFilterColumn() {
        return this.dateFilterColumn;
    }

    /**
     * Set the dateFilterColumn property: The Column to apply the <paramref name="StartTime"/> and <paramref
     * name="EndTime"/>. Type: string (or Expression with resultType string).
     * 
     * @param dateFilterColumn the dateFilterColumn value to set.
     * @return the Office365Source object itself.
     */
    public Office365Source withDateFilterColumn(Object dateFilterColumn) {
        this.dateFilterColumn = dateFilterColumn;
        return this;
    }

    /**
     * Get the startTime property: Start time of the requested range for this dataset. Type: string (or Expression with
     * resultType string).
     * 
     * @return the startTime value.
     */
    public Object startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: Start time of the requested range for this dataset. Type: string (or Expression with
     * resultType string).
     * 
     * @param startTime the startTime value to set.
     * @return the Office365Source object itself.
     */
    public Office365Source withStartTime(Object startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the endTime property: End time of the requested range for this dataset. Type: string (or Expression with
     * resultType string).
     * 
     * @return the endTime value.
     */
    public Object endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: End time of the requested range for this dataset. Type: string (or Expression with
     * resultType string).
     * 
     * @param endTime the endTime value to set.
     * @return the Office365Source object itself.
     */
    public Office365Source withEndTime(Object endTime) {
        this.endTime = endTime;
        return this;
    }

    /**
     * Get the outputColumns property: The columns to be read out from the Office 365 table. Type: array of objects (or
     * Expression with resultType array of objects). itemType: OutputColumn. Example: [ { "name": "Id" }, { "name":
     * "CreatedDateTime" } ].
     * 
     * @return the outputColumns value.
     */
    public Object outputColumns() {
        return this.outputColumns;
    }

    /**
     * Set the outputColumns property: The columns to be read out from the Office 365 table. Type: array of objects (or
     * Expression with resultType array of objects). itemType: OutputColumn. Example: [ { "name": "Id" }, { "name":
     * "CreatedDateTime" } ].
     * 
     * @param outputColumns the outputColumns value to set.
     * @return the Office365Source object itself.
     */
    public Office365Source withOutputColumns(Object outputColumns) {
        this.outputColumns = outputColumns;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Office365Source withSourceRetryCount(Object sourceRetryCount) {
        super.withSourceRetryCount(sourceRetryCount);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Office365Source withSourceRetryWait(Object sourceRetryWait) {
        super.withSourceRetryWait(sourceRetryWait);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Office365Source withMaxConcurrentConnections(Object maxConcurrentConnections) {
        super.withMaxConcurrentConnections(maxConcurrentConnections);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Office365Source withDisableMetricsCollection(Object disableMetricsCollection) {
        super.withDisableMetricsCollection(disableMetricsCollection);
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeUntypedField("sourceRetryCount", sourceRetryCount());
        jsonWriter.writeUntypedField("sourceRetryWait", sourceRetryWait());
        jsonWriter.writeUntypedField("maxConcurrentConnections", maxConcurrentConnections());
        jsonWriter.writeUntypedField("disableMetricsCollection", disableMetricsCollection());
        jsonWriter.writeStringField("type", this.type);
        jsonWriter.writeUntypedField("allowedGroups", this.allowedGroups);
        jsonWriter.writeUntypedField("userScopeFilterUri", this.userScopeFilterUri);
        jsonWriter.writeUntypedField("dateFilterColumn", this.dateFilterColumn);
        jsonWriter.writeUntypedField("startTime", this.startTime);
        jsonWriter.writeUntypedField("endTime", this.endTime);
        jsonWriter.writeUntypedField("outputColumns", this.outputColumns);
        if (additionalProperties() != null) {
            for (Map.Entry additionalProperty : additionalProperties().entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of Office365Source from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of Office365Source if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IOException If an error occurs while reading the Office365Source.
     */
    public static Office365Source fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            Office365Source deserializedOffice365Source = new Office365Source();
            Map additionalProperties = null;
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("sourceRetryCount".equals(fieldName)) {
                    deserializedOffice365Source.withSourceRetryCount(reader.readUntyped());
                } else if ("sourceRetryWait".equals(fieldName)) {
                    deserializedOffice365Source.withSourceRetryWait(reader.readUntyped());
                } else if ("maxConcurrentConnections".equals(fieldName)) {
                    deserializedOffice365Source.withMaxConcurrentConnections(reader.readUntyped());
                } else if ("disableMetricsCollection".equals(fieldName)) {
                    deserializedOffice365Source.withDisableMetricsCollection(reader.readUntyped());
                } else if ("type".equals(fieldName)) {
                    deserializedOffice365Source.type = reader.getString();
                } else if ("allowedGroups".equals(fieldName)) {
                    deserializedOffice365Source.allowedGroups = reader.readUntyped();
                } else if ("userScopeFilterUri".equals(fieldName)) {
                    deserializedOffice365Source.userScopeFilterUri = reader.readUntyped();
                } else if ("dateFilterColumn".equals(fieldName)) {
                    deserializedOffice365Source.dateFilterColumn = reader.readUntyped();
                } else if ("startTime".equals(fieldName)) {
                    deserializedOffice365Source.startTime = reader.readUntyped();
                } else if ("endTime".equals(fieldName)) {
                    deserializedOffice365Source.endTime = reader.readUntyped();
                } else if ("outputColumns".equals(fieldName)) {
                    deserializedOffice365Source.outputColumns = reader.readUntyped();
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

                    additionalProperties.put(fieldName, reader.readUntyped());
                }
            }
            deserializedOffice365Source.withAdditionalProperties(additionalProperties);

            return deserializedOffice365Source;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy