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

package com.azure.resourcemanager.streamanalytics.fluent.models;

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

/** The properties that are associated with a DocumentDB output. */
@Fluent
public final class DocumentDbOutputDataSourceProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(DocumentDbOutputDataSourceProperties.class);

    /*
     * The DocumentDB account name or ID. Required on PUT (CreateOrReplace)
     * requests.
     */
    @JsonProperty(value = "accountId")
    private String accountId;

    /*
     * The account key for the DocumentDB account. Required on PUT
     * (CreateOrReplace) requests.
     */
    @JsonProperty(value = "accountKey")
    private String accountKey;

    /*
     * The name of the DocumentDB database. Required on PUT (CreateOrReplace)
     * requests.
     */
    @JsonProperty(value = "database")
    private String database;

    /*
     * The collection name pattern for the collections to be used. The
     * collection name format can be constructed using the optional {partition}
     * token, where partitions start from 0. See the DocumentDB section of
     * https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output
     * for more information. Required on PUT (CreateOrReplace) requests.
     */
    @JsonProperty(value = "collectionNamePattern")
    private String collectionNamePattern;

    /*
     * The name of the field in output events used to specify the key for
     * partitioning output across collections. If 'collectionNamePattern'
     * contains the {partition} token, this property is required to be
     * specified.
     */
    @JsonProperty(value = "partitionKey")
    private String partitionKey;

    /*
     * The name of the field in output events used to specify the primary key
     * which insert or update operations are based on.
     */
    @JsonProperty(value = "documentId")
    private String documentId;

    /**
     * Get the accountId property: The DocumentDB account name or ID. Required on PUT (CreateOrReplace) requests.
     *
     * @return the accountId value.
     */
    public String accountId() {
        return this.accountId;
    }

    /**
     * Set the accountId property: The DocumentDB account name or ID. Required on PUT (CreateOrReplace) requests.
     *
     * @param accountId the accountId value to set.
     * @return the DocumentDbOutputDataSourceProperties object itself.
     */
    public DocumentDbOutputDataSourceProperties withAccountId(String accountId) {
        this.accountId = accountId;
        return this;
    }

    /**
     * Get the accountKey property: The account key for the DocumentDB account. Required on PUT (CreateOrReplace)
     * requests.
     *
     * @return the accountKey value.
     */
    public String accountKey() {
        return this.accountKey;
    }

    /**
     * Set the accountKey property: The account key for the DocumentDB account. Required on PUT (CreateOrReplace)
     * requests.
     *
     * @param accountKey the accountKey value to set.
     * @return the DocumentDbOutputDataSourceProperties object itself.
     */
    public DocumentDbOutputDataSourceProperties withAccountKey(String accountKey) {
        this.accountKey = accountKey;
        return this;
    }

    /**
     * Get the database property: The name of the DocumentDB database. Required on PUT (CreateOrReplace) requests.
     *
     * @return the database value.
     */
    public String database() {
        return this.database;
    }

    /**
     * Set the database property: The name of the DocumentDB database. Required on PUT (CreateOrReplace) requests.
     *
     * @param database the database value to set.
     * @return the DocumentDbOutputDataSourceProperties object itself.
     */
    public DocumentDbOutputDataSourceProperties withDatabase(String database) {
        this.database = database;
        return this;
    }

    /**
     * Get the collectionNamePattern property: The collection name pattern for the collections to be used. The
     * collection name format can be constructed using the optional {partition} token, where partitions start from 0.
     * See the DocumentDB section of https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output
     * for more information. Required on PUT (CreateOrReplace) requests.
     *
     * @return the collectionNamePattern value.
     */
    public String collectionNamePattern() {
        return this.collectionNamePattern;
    }

    /**
     * Set the collectionNamePattern property: The collection name pattern for the collections to be used. The
     * collection name format can be constructed using the optional {partition} token, where partitions start from 0.
     * See the DocumentDB section of https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output
     * for more information. Required on PUT (CreateOrReplace) requests.
     *
     * @param collectionNamePattern the collectionNamePattern value to set.
     * @return the DocumentDbOutputDataSourceProperties object itself.
     */
    public DocumentDbOutputDataSourceProperties withCollectionNamePattern(String collectionNamePattern) {
        this.collectionNamePattern = collectionNamePattern;
        return this;
    }

    /**
     * Get the partitionKey property: The name of the field in output events used to specify the key for partitioning
     * output across collections. If 'collectionNamePattern' contains the {partition} token, this property is required
     * to be specified.
     *
     * @return the partitionKey value.
     */
    public String partitionKey() {
        return this.partitionKey;
    }

    /**
     * Set the partitionKey property: The name of the field in output events used to specify the key for partitioning
     * output across collections. If 'collectionNamePattern' contains the {partition} token, this property is required
     * to be specified.
     *
     * @param partitionKey the partitionKey value to set.
     * @return the DocumentDbOutputDataSourceProperties object itself.
     */
    public DocumentDbOutputDataSourceProperties withPartitionKey(String partitionKey) {
        this.partitionKey = partitionKey;
        return this;
    }

    /**
     * Get the documentId property: The name of the field in output events used to specify the primary key which insert
     * or update operations are based on.
     *
     * @return the documentId value.
     */
    public String documentId() {
        return this.documentId;
    }

    /**
     * Set the documentId property: The name of the field in output events used to specify the primary key which insert
     * or update operations are based on.
     *
     * @param documentId the documentId value to set.
     * @return the DocumentDbOutputDataSourceProperties object itself.
     */
    public DocumentDbOutputDataSourceProperties withDocumentId(String documentId) {
        this.documentId = documentId;
        return this;
    }

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