Loading...
Searching...
No Matches
rewrap_many_datakey.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 <bsoncxx/v1/document/value.hpp>
#include <mongocxx/options/rewrap_many_datakey-fwd.hpp> // IWYU pragma: export
#include <mongocxx/v1/rewrap_many_datakey_options.hpp> // IWYU pragma: export
#include <string>
#include <utility>
#include <mongocxx/client_encryption-fwd.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <bsoncxx/document/value.hpp>
#include <bsoncxx/document/view.hpp>
#include <bsoncxx/document/view_or_value.hpp>
#include <bsoncxx/stdx/optional.hpp>
#include <bsoncxx/string/view_or_value.hpp>
#include <bsoncxx/types.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <bsoncxx/types/bson_value/view_or_value.hpp> // IWYU pragma: keep: backward compatibility, to be removed.
#include <mongocxx/config/prelude.hpp>
namespace mongocxx {
namespace v_noabi {
namespace options {
class rewrap_many_datakey {
public:
rewrap_many_datakey() = default;
/* explicit(false) */ MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE() rewrap_many_datakey(
v1::rewrap_many_datakey_options opts);
explicit operator v1::rewrap_many_datakey_options() const {
v1::rewrap_many_datakey_options ret;
ret.provider(std::string{_provider.view()});
if (_master_key) {
ret.master_key(bsoncxx::v1::document::value{bsoncxx::v_noabi::to_v1(_master_key->view())});
}
return ret;
}
rewrap_many_datakey& provider(bsoncxx::v_noabi::string::view_or_value provider) {
_provider = std::move(provider);
return *this;
}
bsoncxx::v_noabi::string::view_or_value provider() const {
return _provider;
}
rewrap_many_datakey& master_key(bsoncxx::v_noabi::document::view_or_value master_key) {
_master_key = std::move(master_key);
return *this;
}
bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> const& master_key() const {
return _master_key;
}
private:
bsoncxx::v_noabi::string::view_or_value _provider;
bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::document::view_or_value> _master_key;
};
} // namespace options
} // namespace v_noabi
} // namespace mongocxx
namespace mongocxx {
namespace v_noabi {
inline v_noabi::options::rewrap_many_datakey from_v1(v1::rewrap_many_datakey_options v) {
return {std::move(v)};
}
inline v1::rewrap_many_datakey_options to_v1(v_noabi::options::rewrap_many_datakey const& v) {
return v1::rewrap_many_datakey_options{v};
}
} // namespace v_noabi
} // namespace mongocxx
#include <mongocxx/config/postlude.hpp>
bsoncxx::v1::document::value
A BSON document.
Definition value.hpp:44
bsoncxx::v1::stdx::optional
A polyfill for std::optional<T>.
Definition optional.hpp:799
bsoncxx::v_noabi::string::view_or_value
A view-or-value variant type for strings.
Definition view_or_value.hpp:41
mongocxx::options::rewrap_many_datakey::rewrap_many_datakey
rewrap_many_datakey()=default
Default initialization.
mongocxx::v1::rewrap_many_datakey_options
Options for a "rewrapManyDataKey" operation.
Definition rewrap_many_datakey_options.hpp:46
mongocxx::v1::rewrap_many_datakey_options::master_key
rewrap_many_datakey_options & master_key(bsoncxx::v1::document::value v)
Set the "masterKey" field.
mongocxx::v1::rewrap_many_datakey_options::provider
rewrap_many_datakey_options & provider(std::string v)
Set the "provider" field.
mongocxx::v_noabi::options::rewrap_many_datakey
Used by mongocxx::v_noabi::client_encryption::rewrap_many_datakey.
Definition rewrap_many_datakey.hpp:47
mongocxx::v_noabi::options::rewrap_many_datakey::master_key
rewrap_many_datakey & master_key(bsoncxx::v_noabi::document::view_or_value master_key)
Set the masterKey option.
Definition rewrap_many_datakey.hpp:128
mongocxx::v_noabi::options::rewrap_many_datakey::rewrap_many_datakey_options
operator v1::rewrap_many_datakey_options() const
Convert to the mongocxx::v1 equivalent.
Definition rewrap_many_datakey.hpp:63
mongocxx::v_noabi::options::rewrap_many_datakey::master_key
bsoncxx::v_noabi::stdx::optional< bsoncxx::v_noabi::document::view_or_value > const & master_key() const
Get the masterKey option.
Definition rewrap_many_datakey.hpp:146
mongocxx::v_noabi::options::rewrap_many_datakey::provider
rewrap_many_datakey & provider(bsoncxx::v_noabi::string::view_or_value provider)
Set the optional KMS provider use to encrypt the data keys. Do not set to use the current KMS provide...
Definition rewrap_many_datakey.hpp:91
mongocxx::v_noabi::options::rewrap_many_datakey::rewrap_many_datakey
rewrap_many_datakey()=default
Default initialization.
mongocxx::v_noabi::options::rewrap_many_datakey::provider
bsoncxx::v_noabi::string::view_or_value provider() const
Get the KMS provider.
Definition rewrap_many_datakey.hpp:109
view_or_value.hpp
Provides bsoncxx::v_noabi::document::view_or_value.
MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE
#define MONGOCXX_ABI_EXPORT_CDECL_UNSTABLE(...)
Equivalent to MONGOCXX_ABI_EXPORT_UNSTABLE with MONGOCXX_ABI_CDECL.
Definition config.hpp:28
postlude.hpp
The mongocxx v_noabi macro guard postlude header.
prelude.hpp
The mongocxx v_noabi macro guard prelude header.
bsoncxx::v_noabi::document::view_or_value
v_noabi::view_or_value< v_noabi::document::view, v_noabi::document::value > view_or_value
Equivalent to v_noabi::view_or_value<v_noabi::document::view, v_noabi::document::value>.
Definition view_or_value.hpp:30
bsoncxx::v_noabi::to_v1
v1::element::view to_v1(v_noabi::array::element const &v)
Convert to the bsoncxx::v1 equivalent of v.
Definition element.hpp:132
mongocxx::v1
Declares entities whose ABI stability is guaranteed for documented symbols.
mongocxx::v_noabi::options
Declares entities representing options to use with various commands.
mongocxx::v_noabi
Declares entities whose ABI stability is NOT guaranteed.
mongocxx::v_noabi::to_v1
v1::bulk_write to_v1(v_noabi::bulk_write v)
Convert to the mongocxx::v1 equivalent of v.
Definition bulk_write.hpp:162
mongocxx::v_noabi::from_v1
v_noabi::bulk_write from_v1(v1::bulk_write v)
Convert to the mongocxx::v_noabi equivalent of v.
Definition bulk_write.hpp:155
mongocxx
The top-level namespace within which all mongocxx library entities are declared.
rewrap_many_datakey-fwd.hpp
Declares mongocxx::v_noabi::options::rewrap_many_datakey.
rewrap_many_datakey_options.hpp
Provides mongocxx::v1::rewrap_many_datakey_options.
view_or_value.hpp
Provides bsoncxx::v_noabi::string::view_or_value.
view_or_value.hpp
Provides bsoncxx::v_noabi::types::bson_value::view_or_value.
types.hpp
Provides entities used to represent BSON types.
value.hpp
Provides bsoncxx::v1::document::value.
value.hpp
Provides bsoncxx::v_noabi::document::value.
view.hpp
Provides bsoncxx::v_noabi::document::view.
optional.hpp
Provides std::optional-related polyfills for library API usage.
client_encryption-fwd.hpp
Declares mongocxx::v_noabi::client_encryption.