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

com.azure.resourcemanager.cosmos.models.ClientEncryptionPolicy Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure CosmosDB SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt

There is a newer version: 2.46.0
Show newest version
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.cosmos.models;

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

import java.util.List;

/**
 * Cosmos DB client encryption policy.
 */
@Fluent
public final class ClientEncryptionPolicy {
    /*
     * Paths of the item that need encryption along with path-specific settings.
     */
    @JsonProperty(value = "includedPaths", required = true)
    private List includedPaths;

    /*
     * Version of the client encryption policy definition. Supported versions are 1 and 2. Version 2 supports id and partition key path encryption.
     */
    @JsonProperty(value = "policyFormatVersion", required = true)
    private int policyFormatVersion;

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

    /**
     * Get the includedPaths property: Paths of the item that need encryption along with path-specific settings.
     *
     * @return the includedPaths value.
     */
    public List includedPaths() {
        return this.includedPaths;
    }

    /**
     * Set the includedPaths property: Paths of the item that need encryption along with path-specific settings.
     *
     * @param includedPaths the includedPaths value to set.
     * @return the ClientEncryptionPolicy object itself.
     */
    public ClientEncryptionPolicy withIncludedPaths(List includedPaths) {
        this.includedPaths = includedPaths;
        return this;
    }

    /**
     * Get the policyFormatVersion property: Version of the client encryption policy definition. Supported versions are
     * 1 and 2. Version 2 supports id and partition key path encryption.
     *
     * @return the policyFormatVersion value.
     */
    public int policyFormatVersion() {
        return this.policyFormatVersion;
    }

    /**
     * Set the policyFormatVersion property: Version of the client encryption policy definition. Supported versions are
     * 1 and 2. Version 2 supports id and partition key path encryption.
     *
     * @param policyFormatVersion the policyFormatVersion value to set.
     * @return the ClientEncryptionPolicy object itself.
     */
    public ClientEncryptionPolicy withPolicyFormatVersion(int policyFormatVersion) {
        this.policyFormatVersion = policyFormatVersion;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (includedPaths() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property includedPaths in model ClientEncryptionPolicy"));
        } else {
            includedPaths().forEach(e -> e.validate());
        }
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy