// Copyright (c) ZeroC, Inc.

// slice2cpp version 3.8.1
// <auto-generated>Generated from Slice file 'PropertiesAdmin.ice'.</auto-generated>
// clang-format off

#ifndef Ice_PropertiesAdmin_h_
#define Ice_PropertiesAdmin_h_

#include <Ice/PushDisableWarnings.h>
#include <Ice/Ice.h>
#include "PropertyDict.h"

#ifndef ICE_DISABLE_VERSION
#   if ICE_INT_VERSION / 100 != 308
#       error Ice version mismatch!
#   endif
#   if ICE_INT_VERSION % 100 >= 50
#       error Beta header file detected
#   endif
#   if ICE_INT_VERSION % 100 < 1
#       error Ice patch level mismatch!
#   endif
#endif

// NOLINTBEGIN(modernize-concat-nested-namespaces)

namespace Ice
{
    class PropertiesAdminPrx;
}

namespace Ice
{
    /// Provides remote access to the properties of a communicator.
    /// @remarks The Slice compiler generated this proxy class from Slice interface `::Ice::PropertiesAdmin`.
    /// @headerfile Ice/Ice.h
    class ICE_API PropertiesAdminPrx : public Ice::Proxy<PropertiesAdminPrx, Ice::ObjectPrx>
    {
    public:
        /// Constructs a proxy from a Communicator and a proxy string.
        /// @param communicator The communicator of the new proxy.
        /// @param proxyString The proxy string to parse.
        PropertiesAdminPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)

        /// Copy constructor. Constructs with a copy of the contents of @p other.
        /// @param other The proxy to copy from.
        PropertiesAdminPrx(const PropertiesAdminPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)

        /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
        /// @param other The proxy to move from.
        PropertiesAdminPrx(PropertiesAdminPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)

        ~PropertiesAdminPrx() override;

        /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
        /// @param rhs The proxy to copy from.
        /// @return A reference to this proxy.
        PropertiesAdminPrx& operator=(const PropertiesAdminPrx& rhs) noexcept
        {
            if (this != &rhs)
            {
                Ice::ObjectPrx::operator=(rhs);
            }
            return *this;
        }

        /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
        /// @param rhs The proxy to move from.
        PropertiesAdminPrx& operator=(PropertiesAdminPrx&& rhs) noexcept
        {
            if (this != &rhs)
            {
                Ice::ObjectPrx::operator=(std::move(rhs));
            }
            return *this;
        }

        /// Gets a property by key.
        /// @param key The property key.
        /// @param context The request context.
        /// @return The property value. This value is empty if the property is not set.
        std::string getProperty(std::string_view key, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)

        /// Gets a property by key.
        /// @param key The property key.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes. This future holds:
        /// - The property value. This value is empty if the property is not set.
        [[nodiscard]] std::future<std::string> getPropertyAsync(std::string_view key, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Gets a property by key.
        /// @param key The property key.
        /// @param response The response callback. It accepts:
        /// - The property value. This value is empty if the property is not set.
        /// @param exception The exception callback.
        /// @param sent The sent callback.
        /// @param context The request context.
        /// @return A function that can be called to cancel the invocation locally.
        // NOLINTNEXTLINE(modernize-use-nodiscard)
        std::function<void()> getPropertyAsync(std::string_view key, std::function<void(std::string)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;

        /// @private
        void _iceI_getProperty(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::string>>&, std::string_view, const Ice::Context&) const;

        /// Gets all properties whose keys begin with @p prefix. If @p prefix is the empty string then all properties
        /// are returned.
        /// @param prefix The prefix to search for. May be empty.
        /// @param context The request context.
        /// @return The matching property set.
        PropertyDict getPropertiesForPrefix(std::string_view prefix, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)

        /// Gets all properties whose keys begin with @p prefix. If @p prefix is the empty string then all properties
        /// are returned.
        /// @param prefix The prefix to search for. May be empty.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes. This future holds:
        /// - The matching property set.
        [[nodiscard]] std::future<PropertyDict> getPropertiesForPrefixAsync(std::string_view prefix, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Gets all properties whose keys begin with @p prefix. If @p prefix is the empty string then all properties
        /// are returned.
        /// @param prefix The prefix to search for. May be empty.
        /// @param response The response callback. It accepts:
        /// - The matching property set.
        /// @param exception The exception callback.
        /// @param sent The sent callback.
        /// @param context The request context.
        /// @return A function that can be called to cancel the invocation locally.
        // NOLINTNEXTLINE(modernize-use-nodiscard)
        std::function<void()> getPropertiesForPrefixAsync(std::string_view prefix, std::function<void(::Ice::PropertyDict)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;

        /// @private
        void _iceI_getPropertiesForPrefix(const std::shared_ptr<IceInternal::OutgoingAsyncT<PropertyDict>>&, std::string_view, const Ice::Context&) const;

        /// Updates the communicator's properties with the given property set. If an entry in @p newProperties matches
        /// the name of an existing property, that property's value is replaced with the new value. If the new value is
        /// the empty string, the property is removed. Existing properties that are not modified or removed by the
        /// entries in @p newProperties are not affected by this update.
        /// @param newProperties Properties to add, change, or remove.
        /// @param context The request context.
        void setProperties(const PropertyDict& newProperties, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Updates the communicator's properties with the given property set. If an entry in @p newProperties matches
        /// the name of an existing property, that property's value is replaced with the new value. If the new value is
        /// the empty string, the property is removed. Existing properties that are not modified or removed by the
        /// entries in @p newProperties are not affected by this update.
        /// @param newProperties Properties to add, change, or remove.
        /// @param context The request context.
        /// @return A future that becomes available when the invocation completes.
        [[nodiscard]] std::future<void> setPropertiesAsync(const PropertyDict& newProperties, const Ice::Context& context = Ice::noExplicitContext) const;

        /// Updates the communicator's properties with the given property set. If an entry in @p newProperties matches
        /// the name of an existing property, that property's value is replaced with the new value. If the new value is
        /// the empty string, the property is removed. Existing properties that are not modified or removed by the
        /// entries in @p newProperties are not affected by this update.
        /// @param newProperties Properties to add, change, or remove.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param sent The sent callback.
        /// @param context The request context.
        /// @return A function that can be called to cancel the invocation locally.
        // NOLINTNEXTLINE(modernize-use-nodiscard)
        std::function<void()> setPropertiesAsync(const PropertyDict& newProperties, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;

        /// @private
        void _iceI_setProperties(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const PropertyDict&, const Ice::Context&) const;

        /// Gets the type ID of the associated Slice interface.
        /// @return The string `"::Ice::PropertiesAdmin"`.
        static const char* ice_staticId() noexcept;

        /// @private
        static PropertiesAdminPrx _fromReference(IceInternal::ReferencePtr ref) { return PropertiesAdminPrx{std::move(ref)}; }

    protected:
        /// @private
        PropertiesAdminPrx() = default;

        /// @private
        explicit PropertiesAdminPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
        {
        }
    };
}

namespace Ice
{
    /// Provides remote access to the properties of a communicator.
    /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::PropertiesAdmin`.
    /// @headerfile Ice/Ice.h
    class ICE_API PropertiesAdmin : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = PropertiesAdminPrx;

        /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
        /// @param request The incoming request.
        /// @param sendResponse The callback to send the response.
        void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;

        [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;

        [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;

        /// Gets a property by key.
        /// @param key The property key.
        /// @param current The Current object of the incoming request.
        /// @return The property value. This value is empty if the property is not set.
        virtual std::string getProperty(std::string key, const Ice::Current& current) = 0;

        /// @private
        void _iceD_getProperty(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Gets all properties whose keys begin with @p prefix. If @p prefix is the empty string then all properties
        /// are returned.
        /// @param prefix The prefix to search for. May be empty.
        /// @param current The Current object of the incoming request.
        /// @return The matching property set.
        virtual PropertyDict getPropertiesForPrefix(std::string prefix, const Ice::Current& current) = 0;

        /// @private
        void _iceD_getPropertiesForPrefix(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Updates the communicator's properties with the given property set. If an entry in @p newProperties matches
        /// the name of an existing property, that property's value is replaced with the new value. If the new value is
        /// the empty string, the property is removed. Existing properties that are not modified or removed by the
        /// entries in @p newProperties are not affected by this update.
        /// @param newProperties Properties to add, change, or remove.
        /// @param current The Current object of the incoming request.
        virtual void setProperties(PropertyDict newProperties, const Ice::Current& current) = 0;

        /// @private
        void _iceD_setProperties(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Gets the type ID of the associated Slice interface.
        /// @return The string `"::Ice::PropertiesAdmin"`.
        static const char* ice_staticId() noexcept;
    };

    /// A shared pointer to a PropertiesAdmin.
    using PropertiesAdminPtr = std::shared_ptr<PropertiesAdmin>;
}

namespace Ice
{
    /// Provides remote access to the properties of a communicator.
    /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::PropertiesAdmin`.
    /// @headerfile Ice/Ice.h
    class ICE_API AsyncPropertiesAdmin : public virtual Ice::Object
    {
    public:
        /// The associated proxy type.
        using ProxyType = PropertiesAdminPrx;

        /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
        /// @param request The incoming request.
        /// @param sendResponse The callback to send the response.
        void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;

        [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;

        [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;

        /// Gets a property by key.
        /// @param key The property key.
        /// @param response The response callback. It accepts:
        /// - The property value. This value is empty if the property is not set.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void getPropertyAsync(std::string key, std::function<void(std::string_view returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

        /// @private
        void _iceD_getProperty(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Gets all properties whose keys begin with @p prefix. If @p prefix is the empty string then all properties
        /// are returned.
        /// @param prefix The prefix to search for. May be empty.
        /// @param response The response callback. It accepts:
        /// - The matching property set.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void getPropertiesForPrefixAsync(std::string prefix, std::function<void(const PropertyDict& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

        /// @private
        void _iceD_getPropertiesForPrefix(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Updates the communicator's properties with the given property set. If an entry in @p newProperties matches
        /// the name of an existing property, that property's value is replaced with the new value. If the new value is
        /// the empty string, the property is removed. Existing properties that are not modified or removed by the
        /// entries in @p newProperties are not affected by this update.
        /// @param newProperties Properties to add, change, or remove.
        /// @param response The response callback.
        /// @param exception The exception callback.
        /// @param current The Current object of the incoming request.
        virtual void setPropertiesAsync(PropertyDict newProperties, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;

        /// @private
        void _iceD_setProperties(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);

        /// Gets the type ID of the associated Slice interface.
        /// @return The string `"::Ice::PropertiesAdmin"`.
        static const char* ice_staticId() noexcept;
    };

    /// A shared pointer to an AsyncPropertiesAdmin.
    using AsyncPropertiesAdminPtr = std::shared_ptr<AsyncPropertiesAdmin>;
}

// NOLINTEND(modernize-concat-nested-namespaces)

#include <Ice/PopDisableWarnings.h>
#endif
