Loading...
Searching...
No Matches
encrypt_options.hpp
Go to the documentation of this file.
// Copyright 2009-present MongoDB, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
#include <mongocxx/v1/encrypt_options-fwd.hpp> // IWYU pragma: export
//
#include <mongocxx/v1/detail/prelude.hpp>
#include <bsoncxx/v1/types/value-fwd.hpp>
#include <bsoncxx/v1/types/view-fwd.hpp>
#include <mongocxx/v1/range_options-fwd.hpp>
#include <mongocxx/v1/text_options-fwd.hpp>
#include <bsoncxx/v1/stdx/optional.hpp>
#include <bsoncxx/v1/stdx/string_view.hpp>
#include <mongocxx/v1/config/export.hpp>
#include <cstdint>
#include <string>
namespace mongocxx {
namespace v1 {
class encrypt_options {
// This class implements `EncryptOpts`:
// - https://specifications.readthedocs.io/en/latest/client-side-encryption/client-side-encryption/
private:
class impl;
void* _impl;
public:
enum class encryption_algorithm : std::uint8_t {
k_deterministic,
k_random,
k_indexed,
k_unindexed,
k_range,
k_textPreview,
};
enum class encryption_query_type : std::uint8_t {
k_equality,
k_range,
k_prefixPreview,
k_suffixPreview,
k_substringPreview,
};
MONGOCXX_ABI_EXPORT_CDECL() ~encrypt_options();
MONGOCXX_ABI_EXPORT_CDECL() encrypt_options(encrypt_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) operator=(encrypt_options&& other) noexcept;
MONGOCXX_ABI_EXPORT_CDECL() encrypt_options(encrypt_options const& other);
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) operator=(encrypt_options const& other);
MONGOCXX_ABI_EXPORT_CDECL() encrypt_options();
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) key_id(bsoncxx::v1::types::value v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::types::view>) key_id() const;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) key_alt_name(std::string v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<bsoncxx::v1::stdx::string_view>) key_alt_name() const;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) algorithm(encryption_algorithm v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<encryption_algorithm>) algorithm() const;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) contention_factor(std::int64_t v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<std::int64_t>) contention_factor() const;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) query_type(encryption_query_type v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<encryption_query_type>) query_type() const;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) range_opts(v1::range_options v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::range_options>) range_opts() const;
MONGOCXX_ABI_EXPORT_CDECL(encrypt_options&) text_opts(v1::text_options v);
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v1::stdx::optional<v1::text_options>) text_opts() const;
class internal;
private:
/* explicit(false) */ encrypt_options(void* impl);
};
} // namespace v1
} // namespace mongocxx
#include <mongocxx/v1/detail/postlude.hpp>
mongocxx::v1::encrypt_options::algorithm
encrypt_options & algorithm(encryption_algorithm v)
Set the "algorithm" field.
mongocxx::v1::encrypt_options::query_type
encrypt_options & query_type(encryption_query_type v)
Set the "queryType" field.
mongocxx::v1::encrypt_options::key_alt_name
encrypt_options & key_alt_name(std::string v)
Set the "keyAltName" field.
mongocxx::v1::encrypt_options::text_opts
encrypt_options & text_opts(v1::text_options v)
Set the "textOpts" field.
mongocxx::v1::encrypt_options::key_id
encrypt_options & key_id(bsoncxx::v1::types::value v)
Set the "keyId" field.
mongocxx::v1::encrypt_options::contention_factor
encrypt_options & contention_factor(std::int64_t v)
Set the "contentionFactor" field.
mongocxx::v1::encrypt_options::range_opts
encrypt_options & range_opts(v1::range_options v)
Set the "rangeOpts" field.
mongocxx::v1::encrypt_options::encrypt_options
encrypt_options(encrypt_options &&other) noexcept
Move constructor.
mongocxx::v1::encrypt_options::encryption_algorithm
encryption_algorithm
An encryption algorithm.
Definition encrypt_options.hpp:72
mongocxx::v1::encrypt_options::encryption_algorithm::k_deterministic
@ k_deterministic
"AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
Definition encrypt_options.hpp:73
mongocxx::v1::encrypt_options::encryption_algorithm::k_range
@ k_range
"Range"
Definition encrypt_options.hpp:77
mongocxx::v1::encrypt_options::encryption_algorithm::k_indexed
@ k_indexed
"Indexed"
Definition encrypt_options.hpp:75
mongocxx::v1::encrypt_options::encryption_algorithm::k_textPreview
@ k_textPreview
"TextPreview"
Definition encrypt_options.hpp:84
mongocxx::v1::encrypt_options::encryption_algorithm::k_random
@ k_random
"AEAD_AES_256_CBC_HMAC_SHA_512-Random"
Definition encrypt_options.hpp:74
mongocxx::v1::encrypt_options::encryption_algorithm::k_unindexed
@ k_unindexed
"Unindexed"
Definition encrypt_options.hpp:76
mongocxx::v1::encrypt_options::~encrypt_options
~encrypt_options()
Destroy this object.
mongocxx::v1::encrypt_options::encryption_query_type
encryption_query_type
A query type.
Definition encrypt_options.hpp:93
mongocxx::v1::encrypt_options::encryption_query_type::k_equality
@ k_equality
"equalty"
Definition encrypt_options.hpp:94
mongocxx::v1::encrypt_options::encryption_query_type::k_suffixPreview
@ k_suffixPreview
"suffixPreview"
Definition encrypt_options.hpp:109
mongocxx::v1::encrypt_options::encryption_query_type::k_prefixPreview
@ k_prefixPreview
"prefixPreview"
Definition encrypt_options.hpp:102
mongocxx::v1::encrypt_options::encryption_query_type::k_substringPreview
@ k_substringPreview
"substringPreview"
Definition encrypt_options.hpp:116
mongocxx::v1::range_options
Options related to range_options queries for Queryable Encryption.
Definition range_options.hpp:49
mongocxx::v1::text_options
Options related to text queries for Queryable Encryption.
Definition text_options.hpp:48
encrypt_options-fwd.hpp
Declares mongocxx::v1::encrypt_options.
export.hpp
Provides macros to control the set of symbols exported in the ABI.
MONGOCXX_ABI_EXPORT_CDECL
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
prelude.hpp
The mongocxx v1 macro guard prelude header.
bsoncxx
The top-level namespace within which all bsoncxx library entities are declared.
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
range_options-fwd.hpp
Declares mongocxx::v1::range_options.
text_options-fwd.hpp
Declares mongocxx::v1::text_options.
optional.hpp
Provides std::optional-related polyfills for library API usage.
string_view.hpp
Provides std::string_view-related polyfills for library API usage.
value-fwd.hpp
Declares bsoncxx::v1::types::value.
view-fwd.hpp
Declares non-owning, read-only entities representing a BSON type value.