// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.synapse.artifacts.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Trigger that runs every time a Blob event occurs. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("BlobEventsTrigger")
@JsonFlatten
@Fluent
public class BlobEventsTrigger extends MultiplePipelineTrigger {
    /*
     * The blob path must begin with the pattern provided for trigger to fire. For example, '/records/blobs/december/'
     * will only fire the trigger for blobs in the december folder under the records container. At least one of these
     * must be provided: blobPathBeginsWith, blobPathEndsWith.
     */
    @JsonProperty(value = "typeProperties.blobPathBeginsWith")
    private String blobPathBeginsWith;

    /*
     * The blob path must end with the pattern provided for trigger to fire. For example, 'december/boxes.csv' will
     * only fire the trigger for blobs named boxes in a december folder. At least one of these must be provided:
     * blobPathBeginsWith, blobPathEndsWith.
     */
    @JsonProperty(value = "typeProperties.blobPathEndsWith")
    private String blobPathEndsWith;

    /*
     * If set to true, blobs with zero bytes will be ignored.
     */
    @JsonProperty(value = "typeProperties.ignoreEmptyBlobs")
    private Boolean ignoreEmptyBlobs;

    /*
     * The type of events that cause this trigger to fire.
     */
    @JsonProperty(value = "typeProperties.events", required = true)
    private List<BlobEventType> events;

    /*
     * The ARM resource ID of the Storage Account.
     */
    @JsonProperty(value = "typeProperties.scope", required = true)
    private String scope;

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

    /**
     * Get the blobPathBeginsWith property: The blob path must begin with the pattern provided for trigger to fire. For
     * example, '/records/blobs/december/' will only fire the trigger for blobs in the december folder under the records
     * container. At least one of these must be provided: blobPathBeginsWith, blobPathEndsWith.
     *
     * @return the blobPathBeginsWith value.
     */
    public String getBlobPathBeginsWith() {
        return this.blobPathBeginsWith;
    }

    /**
     * Set the blobPathBeginsWith property: The blob path must begin with the pattern provided for trigger to fire. For
     * example, '/records/blobs/december/' will only fire the trigger for blobs in the december folder under the records
     * container. At least one of these must be provided: blobPathBeginsWith, blobPathEndsWith.
     *
     * @param blobPathBeginsWith the blobPathBeginsWith value to set.
     * @return the BlobEventsTrigger object itself.
     */
    public BlobEventsTrigger setBlobPathBeginsWith(String blobPathBeginsWith) {
        this.blobPathBeginsWith = blobPathBeginsWith;
        return this;
    }

    /**
     * Get the blobPathEndsWith property: The blob path must end with the pattern provided for trigger to fire. For
     * example, 'december/boxes.csv' will only fire the trigger for blobs named boxes in a december folder. At least one
     * of these must be provided: blobPathBeginsWith, blobPathEndsWith.
     *
     * @return the blobPathEndsWith value.
     */
    public String getBlobPathEndsWith() {
        return this.blobPathEndsWith;
    }

    /**
     * Set the blobPathEndsWith property: The blob path must end with the pattern provided for trigger to fire. For
     * example, 'december/boxes.csv' will only fire the trigger for blobs named boxes in a december folder. At least one
     * of these must be provided: blobPathBeginsWith, blobPathEndsWith.
     *
     * @param blobPathEndsWith the blobPathEndsWith value to set.
     * @return the BlobEventsTrigger object itself.
     */
    public BlobEventsTrigger setBlobPathEndsWith(String blobPathEndsWith) {
        this.blobPathEndsWith = blobPathEndsWith;
        return this;
    }

    /**
     * Get the ignoreEmptyBlobs property: If set to true, blobs with zero bytes will be ignored.
     *
     * @return the ignoreEmptyBlobs value.
     */
    public Boolean isIgnoreEmptyBlobs() {
        return this.ignoreEmptyBlobs;
    }

    /**
     * Set the ignoreEmptyBlobs property: If set to true, blobs with zero bytes will be ignored.
     *
     * @param ignoreEmptyBlobs the ignoreEmptyBlobs value to set.
     * @return the BlobEventsTrigger object itself.
     */
    public BlobEventsTrigger setIgnoreEmptyBlobs(Boolean ignoreEmptyBlobs) {
        this.ignoreEmptyBlobs = ignoreEmptyBlobs;
        return this;
    }

    /**
     * Get the events property: The type of events that cause this trigger to fire.
     *
     * @return the events value.
     */
    public List<BlobEventType> getEvents() {
        return this.events;
    }

    /**
     * Set the events property: The type of events that cause this trigger to fire.
     *
     * @param events the events value to set.
     * @return the BlobEventsTrigger object itself.
     */
    public BlobEventsTrigger setEvents(List<BlobEventType> events) {
        this.events = events;
        return this;
    }

    /**
     * Get the scope property: The ARM resource ID of the Storage Account.
     *
     * @return the scope value.
     */
    public String getScope() {
        return this.scope;
    }

    /**
     * Set the scope property: The ARM resource ID of the Storage Account.
     *
     * @param scope the scope value to set.
     * @return the BlobEventsTrigger object itself.
     */
    public BlobEventsTrigger setScope(String scope) {
        this.scope = scope;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public BlobEventsTrigger setPipelines(List<TriggerPipelineReference> pipelines) {
        super.setPipelines(pipelines);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public BlobEventsTrigger setDescription(String description) {
        super.setDescription(description);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public BlobEventsTrigger setAnnotations(List<Object> annotations) {
        super.setAnnotations(annotations);
        return this;
    }
}
