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

com.azure.resourcemanager.monitor.models.LogFilesDataSource 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.monitor.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
 * Definition of which custom log files will be collected by this data collection rule.
 */
@Fluent
public final class LogFilesDataSource {
    /*
     * List of streams that this data source will be sent to.
     * A stream indicates what schema will be used for this data source
     */
    @JsonProperty(value = "streams", required = true)
    private List streams;

    /*
     * File Patterns where the log files are located
     */
    @JsonProperty(value = "filePatterns", required = true)
    private List filePatterns;

    /*
     * The data format of the log files
     */
    @JsonProperty(value = "format", required = true)
    private KnownLogFilesDataSourceFormat format;

    /*
     * The log files specific settings.
     */
    @JsonProperty(value = "settings")
    private LogFilesDataSourceSettings settings;

    /*
     * A friendly name for the data source.
     * This name should be unique across all data sources (regardless of type) within the data collection rule.
     */
    @JsonProperty(value = "name")
    private String name;

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

    /**
     * Get the streams property: List of streams that this data source will be sent to.
     * A stream indicates what schema will be used for this data source.
     * 
     * @return the streams value.
     */
    public List streams() {
        return this.streams;
    }

    /**
     * Set the streams property: List of streams that this data source will be sent to.
     * A stream indicates what schema will be used for this data source.
     * 
     * @param streams the streams value to set.
     * @return the LogFilesDataSource object itself.
     */
    public LogFilesDataSource withStreams(List streams) {
        this.streams = streams;
        return this;
    }

    /**
     * Get the filePatterns property: File Patterns where the log files are located.
     * 
     * @return the filePatterns value.
     */
    public List filePatterns() {
        return this.filePatterns;
    }

    /**
     * Set the filePatterns property: File Patterns where the log files are located.
     * 
     * @param filePatterns the filePatterns value to set.
     * @return the LogFilesDataSource object itself.
     */
    public LogFilesDataSource withFilePatterns(List filePatterns) {
        this.filePatterns = filePatterns;
        return this;
    }

    /**
     * Get the format property: The data format of the log files.
     * 
     * @return the format value.
     */
    public KnownLogFilesDataSourceFormat format() {
        return this.format;
    }

    /**
     * Set the format property: The data format of the log files.
     * 
     * @param format the format value to set.
     * @return the LogFilesDataSource object itself.
     */
    public LogFilesDataSource withFormat(KnownLogFilesDataSourceFormat format) {
        this.format = format;
        return this;
    }

    /**
     * Get the settings property: The log files specific settings.
     * 
     * @return the settings value.
     */
    public LogFilesDataSourceSettings settings() {
        return this.settings;
    }

    /**
     * Set the settings property: The log files specific settings.
     * 
     * @param settings the settings value to set.
     * @return the LogFilesDataSource object itself.
     */
    public LogFilesDataSource withSettings(LogFilesDataSourceSettings settings) {
        this.settings = settings;
        return this;
    }

    /**
     * Get the name property: A friendly name for the data source.
     * This name should be unique across all data sources (regardless of type) within the data collection rule.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: A friendly name for the data source.
     * This name should be unique across all data sources (regardless of type) within the data collection rule.
     * 
     * @param name the name value to set.
     * @return the LogFilesDataSource object itself.
     */
    public LogFilesDataSource withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (streams() == null) {
            throw LOGGER.logExceptionAsError(
                new IllegalArgumentException("Missing required property streams in model LogFilesDataSource"));
        }
        if (filePatterns() == null) {
            throw LOGGER.logExceptionAsError(
                new IllegalArgumentException("Missing required property filePatterns in model LogFilesDataSource"));
        }
        if (format() == null) {
            throw LOGGER.logExceptionAsError(
                new IllegalArgumentException("Missing required property format in model LogFilesDataSource"));
        }
        if (settings() != null) {
            settings().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(LogFilesDataSource.class);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy