#pragma once

#include <cstddef>
#include <functional>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <vector>

#include <krpc/decoder.hpp>
#include <krpc/encoder.hpp>
#include <krpc/error.hpp>
#include <krpc/event.hpp>
#include <krpc/hash.hpp>
#include <krpc/object.hpp>
#include <krpc/service.hpp>
#include <krpc/stream.hpp>

#include <KRPC>

namespace krpc {
namespace services {

class TestService : public Service {
 public:
  explicit TestService(Client* client);

  // Class forward declarations
  class DeprecatedClass;
  class TestClass;

  // Structure forward declarations
  struct DeprecatedStruct;
  struct TestNestedNullableStruct;
  struct TestStruct;
  struct TestNestedStruct;
  struct TestNullableStruct;

  class CustomException : public ::krpc::RPCError {
   public:
    inline explicit CustomException(const std::string& msg) : ::krpc::RPCError(msg) {}
  };

  /**
   * Deprecated exception documentation string.
   *
   * \deprecated Use CustomException instead.
   */
  class [[deprecated("Use CustomException instead.")]] DeprecatedException : public ::krpc::RPCError {
   public:
    inline explicit DeprecatedException(const std::string& msg) : ::krpc::RPCError(msg) {}
  };

  /**
   * Deprecated enum documentation string.
   *
   * \deprecated Use TestEnum instead.
   */
  enum struct [[deprecated("Use TestEnum instead.")]] DeprecatedEnum {
    /**
     * Deprecated enum ValueA documentation string.
     */
    value_a = 0,
    /**
     * Deprecated enum ValueB documentation string.
     *
     * \deprecated Use DeprecatedEnum::value_a instead.
     */
    value_b [[deprecated("Use DeprecatedEnum::value_a instead.")]] = 1
  };

  /**
   * Enum documentation string.
   */
  enum struct TestEnum {
    /**
     * Enum ValueA documentation string.
     */
    value_a = 0,
    /**
     * Enum ValueB documentation string.
     */
    value_b = 1,
    /**
     * Enum ValueC documentation string.
     */
    value_c = 2
  };

  std::string add_multiple_values(float x, int32_t y, int64_t z);

  std::vector<TestService::TestClass> add_to_object_list(std::vector<TestService::TestClass> l, std::string value);

  int32_t blocking_procedure(int32_t n, int32_t sum);

  std::string bool_to_string(bool value);

  std::string bytes_to_hex_string(std::string value);

  int32_t counter(std::string id, int32_t divisor);

  /**
   * Returns a struct whose IntField counts the number of times it has been called,
   * so that a stream on it changes on every update.
   */
  TestService::TestStruct counter_struct(std::string id);

  TestService::TestClass create_test_object(std::string value);

  /**
   * Deprecated procedure documentation string.
   *
   * \deprecated Use float_to_string instead.
   */
  [[deprecated("Use float_to_string instead.")]]
  std::string deprecated_procedure(float value);

  /**
   * Deprecated procedure with no reason documentation string.
   */
  [[deprecated]]
  std::string deprecated_procedure_no_message(float value);

  std::map<int32_t, bool> dictionary_default(std::map<int32_t, bool> x);

  /**
   * Procedure whose defaults are the special values of double.
   */
  std::vector<double> double_special_defaults(double nan, double infinity, double negative_infinity, double maximum, double lowest);

  std::string double_to_string(double value);

  /**
   * The expression tree of a function, as text.
   */
  std::string dump_expression_tree(KRPC::Expression expression);

  std::map<std::string, std::optional<TestService::TestClass> > echo_dictionary_of_nullable_objects(std::map<std::string, std::optional<TestService::TestClass> > d);

  std::vector<std::optional<int32_t> > echo_list_of_nullable_ints(std::vector<std::optional<int32_t> > l);

  std::vector<std::optional<TestService::TestClass> > echo_list_of_nullable_objects(std::vector<std::optional<TestService::TestClass> > l);

  std::vector<std::vector<std::optional<TestService::TestClass>> > echo_nested_list_of_nullable_objects(std::vector<std::vector<std::optional<TestService::TestClass>> > l);

  TestService::TestNestedNullableStruct echo_nested_nullable_struct(TestService::TestNestedNullableStruct value);

  std::optional<int32_t> echo_nullable_int(std::optional<int32_t> value);

  std::optional<std::vector<int32_t> > echo_nullable_list(std::optional<std::vector<int32_t> > l);

  std::optional<std::string> echo_nullable_string(std::optional<std::string> value);

  std::optional<TestService::TestClass> echo_test_object(std::optional<TestService::TestClass> value);

  std::tuple<int32_t, std::optional<TestService::TestClass> > echo_tuple_with_a_nullable_object(std::tuple<int32_t, std::optional<TestService::TestClass> > t);

  std::vector<std::string> empty_list_default(std::vector<std::string> x);

  TestService::TestEnum enum_default_arg(TestService::TestEnum x);

  TestService::TestEnum enum_echo(TestService::TestEnum x);

  std::vector<TestService::TestEnum> enum_list_default(std::vector<TestService::TestEnum> x);

  TestService::TestEnum enum_return();

  /**
   * Procedure whose defaults are the special values of float, plus a finite fraction
   * that no float can hold exactly.
   */
  std::vector<float> float_special_defaults(float nan, float infinity, float negative_infinity, float maximum, float lowest, float fraction);

  /**
   * Procedure documentation string.
   */
  std::string float_to_string(float value);

  std::map<std::string, int32_t> increment_dictionary(std::map<std::string, int32_t> d);

  std::vector<int32_t> increment_list(std::vector<int32_t> l);

  std::vector<TestService::TestStruct> increment_list_of_structs(std::vector<TestService::TestStruct> l);

  std::map<std::string, std::vector<int32_t> > increment_nested_collection(std::map<std::string, std::vector<int32_t> > d);

  std::set<int32_t> increment_set(std::set<int32_t> h);

  std::tuple<int32_t, int64_t> increment_tuple(std::tuple<int32_t, int64_t> t);

  /**
   * Procedure whose defaults are the extremes of int.
   */
  std::vector<int32_t> int32_special_defaults(int32_t maximum, int32_t minimum);

  std::string int32_to_string(int32_t value);

  /**
   * Procedure whose defaults are the extremes of long.
   */
  std::vector<int64_t> int64_special_defaults(int64_t maximum, int64_t minimum);

  std::string int64_to_string(int64_t value);

  std::vector<int32_t> list_default(std::vector<int32_t> x);

  TestService::TestNestedStruct nested_struct_echo(TestService::TestNestedStruct x);

  TestService::TestClass not_nullable_object(TestService::TestClass value);

  TestService::TestNullableStruct nullable_struct_echo(TestService::TestNullableStruct x);

  ::krpc::Event on_timer(uint32_t milliseconds, uint32_t repeats);

  ::krpc::Event on_timer_using_lambda(uint32_t milliseconds);

  std::string optional_arguments(std::string x, std::string y, std::string z, std::optional<TestService::TestClass> obj);

  ::krpc::Event remove_event_after(uint32_t milliseconds);

  void reset_custom_exception_later();

  void reset_invalid_operation_exception_later();

  TestService::TestClass return_null_when_not_allowed();

  std::set<int32_t> set_default(std::set<int32_t> x);

  int32_t string_to_int32(std::string value);

  TestService::TestStruct struct_default(TestService::TestStruct x);

  TestService::TestStruct struct_echo(TestService::TestStruct x);

  std::optional<TestService::TestStruct> struct_echo_nullable(std::optional<TestService::TestStruct> x);

  int32_t throw_argument_exception();

  int32_t throw_argument_null_exception(std::string foo);

  int32_t throw_argument_out_of_range_exception(int32_t foo);

  int32_t throw_custom_exception();

  int32_t throw_custom_exception_later();

  int32_t throw_invalid_operation_exception();

  int32_t throw_invalid_operation_exception_later();

  std::tuple<int32_t, bool> tuple_default(std::tuple<int32_t, bool> x);

  /**
   * Procedure whose default is the largest uint.
   */
  std::vector<uint32_t> uint32_special_defaults(uint32_t maximum);

  /**
   * Procedure whose default is the largest ulong.
   */
  std::vector<uint64_t> uint64_special_defaults(uint64_t maximum);

  /**
   * Deprecated property documentation string.
   *
   * \deprecated Use string_property instead.
   */
  [[deprecated("Use string_property instead.")]]
  std::string deprecated_property();

  /**
   * Deprecated property documentation string.
   *
   * \deprecated Use string_property instead.
   */
  [[deprecated("Use string_property instead.")]]
  void set_deprecated_property(std::string value);

  std::optional<TestService::TestClass> nullable_object();

  void set_nullable_object(std::optional<TestService::TestClass> value);

  std::optional<TestService::TestClass> object_property();

  void set_object_property(std::optional<TestService::TestClass> value);

  /**
   * Property documentation string.
   */
  std::string string_property();

  /**
   * Property documentation string.
   */
  void set_string_property(std::string value);

  void set_string_property_private_get(std::string value);

  std::string string_property_private_set();

  ::krpc::Stream<std::string> add_multiple_values_stream(float x, int32_t y, int64_t z);

  ::krpc::Stream<std::vector<TestService::TestClass>> add_to_object_list_stream(std::vector<TestService::TestClass> l, std::string value);

  ::krpc::Stream<int32_t> blocking_procedure_stream(int32_t n, int32_t sum);

  ::krpc::Stream<std::string> bool_to_string_stream(bool value);

  ::krpc::Stream<std::string> bytes_to_hex_string_stream(std::string value);

  ::krpc::Stream<int32_t> counter_stream(std::string id, int32_t divisor);

  ::krpc::Stream<TestService::TestStruct> counter_struct_stream(std::string id);

  ::krpc::Stream<TestService::TestClass> create_test_object_stream(std::string value);

  ::krpc::Stream<std::string> deprecated_procedure_stream(float value);

  ::krpc::Stream<std::string> deprecated_procedure_no_message_stream(float value);

  ::krpc::Stream<std::map<int32_t, bool>> dictionary_default_stream(std::map<int32_t, bool> x);

  ::krpc::Stream<std::vector<double>> double_special_defaults_stream(double nan, double infinity, double negative_infinity, double maximum, double lowest);

  ::krpc::Stream<std::string> double_to_string_stream(double value);

  ::krpc::Stream<std::string> dump_expression_tree_stream(KRPC::Expression expression);

  ::krpc::Stream<std::map<std::string, std::optional<TestService::TestClass> >> echo_dictionary_of_nullable_objects_stream(std::map<std::string, std::optional<TestService::TestClass> > d);

  ::krpc::Stream<std::vector<std::optional<int32_t> >> echo_list_of_nullable_ints_stream(std::vector<std::optional<int32_t> > l);

  ::krpc::Stream<std::vector<std::optional<TestService::TestClass> >> echo_list_of_nullable_objects_stream(std::vector<std::optional<TestService::TestClass> > l);

  ::krpc::Stream<std::vector<std::vector<std::optional<TestService::TestClass>> >> echo_nested_list_of_nullable_objects_stream(std::vector<std::vector<std::optional<TestService::TestClass>> > l);

  ::krpc::Stream<TestService::TestNestedNullableStruct> echo_nested_nullable_struct_stream(TestService::TestNestedNullableStruct value);

  ::krpc::Stream<std::optional<int32_t>> echo_nullable_int_stream(std::optional<int32_t> value);

  ::krpc::Stream<std::optional<std::vector<int32_t> >> echo_nullable_list_stream(std::optional<std::vector<int32_t> > l);

  ::krpc::Stream<std::optional<std::string>> echo_nullable_string_stream(std::optional<std::string> value);

  ::krpc::Stream<std::optional<TestService::TestClass>> echo_test_object_stream(std::optional<TestService::TestClass> value);

  ::krpc::Stream<std::tuple<int32_t, std::optional<TestService::TestClass> >> echo_tuple_with_a_nullable_object_stream(std::tuple<int32_t, std::optional<TestService::TestClass> > t);

  ::krpc::Stream<std::vector<std::string>> empty_list_default_stream(std::vector<std::string> x);

  ::krpc::Stream<TestService::TestEnum> enum_default_arg_stream(TestService::TestEnum x);

  ::krpc::Stream<TestService::TestEnum> enum_echo_stream(TestService::TestEnum x);

  ::krpc::Stream<std::vector<TestService::TestEnum>> enum_list_default_stream(std::vector<TestService::TestEnum> x);

  ::krpc::Stream<TestService::TestEnum> enum_return_stream();

  ::krpc::Stream<std::vector<float>> float_special_defaults_stream(float nan, float infinity, float negative_infinity, float maximum, float lowest, float fraction);

  ::krpc::Stream<std::string> float_to_string_stream(float value);

  ::krpc::Stream<std::map<std::string, int32_t>> increment_dictionary_stream(std::map<std::string, int32_t> d);

  ::krpc::Stream<std::vector<int32_t>> increment_list_stream(std::vector<int32_t> l);

  ::krpc::Stream<std::vector<TestService::TestStruct>> increment_list_of_structs_stream(std::vector<TestService::TestStruct> l);

  ::krpc::Stream<std::map<std::string, std::vector<int32_t> >> increment_nested_collection_stream(std::map<std::string, std::vector<int32_t> > d);

  ::krpc::Stream<std::set<int32_t>> increment_set_stream(std::set<int32_t> h);

  ::krpc::Stream<std::tuple<int32_t, int64_t>> increment_tuple_stream(std::tuple<int32_t, int64_t> t);

  ::krpc::Stream<std::vector<int32_t>> int32_special_defaults_stream(int32_t maximum, int32_t minimum);

  ::krpc::Stream<std::string> int32_to_string_stream(int32_t value);

  ::krpc::Stream<std::vector<int64_t>> int64_special_defaults_stream(int64_t maximum, int64_t minimum);

  ::krpc::Stream<std::string> int64_to_string_stream(int64_t value);

  ::krpc::Stream<std::vector<int32_t>> list_default_stream(std::vector<int32_t> x);

  ::krpc::Stream<TestService::TestNestedStruct> nested_struct_echo_stream(TestService::TestNestedStruct x);

  ::krpc::Stream<TestService::TestClass> not_nullable_object_stream(TestService::TestClass value);

  ::krpc::Stream<TestService::TestNullableStruct> nullable_struct_echo_stream(TestService::TestNullableStruct x);

  ::krpc::Stream<::krpc::Event> on_timer_stream(uint32_t milliseconds, uint32_t repeats);

  ::krpc::Stream<::krpc::Event> on_timer_using_lambda_stream(uint32_t milliseconds);

  ::krpc::Stream<std::string> optional_arguments_stream(std::string x, std::string y, std::string z, std::optional<TestService::TestClass> obj);

  ::krpc::Stream<::krpc::Event> remove_event_after_stream(uint32_t milliseconds);

  ::krpc::Stream<TestService::TestClass> return_null_when_not_allowed_stream();

  ::krpc::Stream<std::set<int32_t>> set_default_stream(std::set<int32_t> x);

  ::krpc::Stream<int32_t> string_to_int32_stream(std::string value);

  ::krpc::Stream<TestService::TestStruct> struct_default_stream(TestService::TestStruct x);

  ::krpc::Stream<TestService::TestStruct> struct_echo_stream(TestService::TestStruct x);

  ::krpc::Stream<std::optional<TestService::TestStruct>> struct_echo_nullable_stream(std::optional<TestService::TestStruct> x);

  ::krpc::Stream<int32_t> throw_argument_exception_stream();

  ::krpc::Stream<int32_t> throw_argument_null_exception_stream(std::string foo);

  ::krpc::Stream<int32_t> throw_argument_out_of_range_exception_stream(int32_t foo);

  ::krpc::Stream<int32_t> throw_custom_exception_stream();

  ::krpc::Stream<int32_t> throw_custom_exception_later_stream();

  ::krpc::Stream<int32_t> throw_invalid_operation_exception_stream();

  ::krpc::Stream<int32_t> throw_invalid_operation_exception_later_stream();

  ::krpc::Stream<std::tuple<int32_t, bool>> tuple_default_stream(std::tuple<int32_t, bool> x);

  ::krpc::Stream<std::vector<uint32_t>> uint32_special_defaults_stream(uint32_t maximum);

  ::krpc::Stream<std::vector<uint64_t>> uint64_special_defaults_stream(uint64_t maximum);

  ::krpc::Stream<std::string> deprecated_property_stream();

  ::krpc::Stream<std::optional<TestService::TestClass>> nullable_object_stream();

  ::krpc::Stream<std::optional<TestService::TestClass>> object_property_stream();

  ::krpc::Stream<std::string> string_property_stream();

  ::krpc::Stream<std::string> string_property_private_set_stream();

  ::krpc::schema::ProcedureCall add_multiple_values_call(float x, int32_t y, int64_t z);

  ::krpc::schema::ProcedureCall add_to_object_list_call(std::vector<TestService::TestClass> l, std::string value);

  ::krpc::schema::ProcedureCall blocking_procedure_call(int32_t n, int32_t sum);

  ::krpc::schema::ProcedureCall bool_to_string_call(bool value);

  ::krpc::schema::ProcedureCall bytes_to_hex_string_call(std::string value);

  ::krpc::schema::ProcedureCall counter_call(std::string id, int32_t divisor);

  ::krpc::schema::ProcedureCall counter_struct_call(std::string id);

  ::krpc::schema::ProcedureCall create_test_object_call(std::string value);

  ::krpc::schema::ProcedureCall deprecated_procedure_call(float value);

  ::krpc::schema::ProcedureCall deprecated_procedure_no_message_call(float value);

  ::krpc::schema::ProcedureCall dictionary_default_call(std::map<int32_t, bool> x);

  ::krpc::schema::ProcedureCall double_special_defaults_call(double nan, double infinity, double negative_infinity, double maximum, double lowest);

  ::krpc::schema::ProcedureCall double_to_string_call(double value);

  ::krpc::schema::ProcedureCall dump_expression_tree_call(KRPC::Expression expression);

  ::krpc::schema::ProcedureCall echo_dictionary_of_nullable_objects_call(std::map<std::string, std::optional<TestService::TestClass> > d);

  ::krpc::schema::ProcedureCall echo_list_of_nullable_ints_call(std::vector<std::optional<int32_t> > l);

  ::krpc::schema::ProcedureCall echo_list_of_nullable_objects_call(std::vector<std::optional<TestService::TestClass> > l);

  ::krpc::schema::ProcedureCall echo_nested_list_of_nullable_objects_call(std::vector<std::vector<std::optional<TestService::TestClass>> > l);

  ::krpc::schema::ProcedureCall echo_nested_nullable_struct_call(TestService::TestNestedNullableStruct value);

  ::krpc::schema::ProcedureCall echo_nullable_int_call(std::optional<int32_t> value);

  ::krpc::schema::ProcedureCall echo_nullable_list_call(std::optional<std::vector<int32_t> > l);

  ::krpc::schema::ProcedureCall echo_nullable_string_call(std::optional<std::string> value);

  ::krpc::schema::ProcedureCall echo_test_object_call(std::optional<TestService::TestClass> value);

  ::krpc::schema::ProcedureCall echo_tuple_with_a_nullable_object_call(std::tuple<int32_t, std::optional<TestService::TestClass> > t);

  ::krpc::schema::ProcedureCall empty_list_default_call(std::vector<std::string> x);

  ::krpc::schema::ProcedureCall enum_default_arg_call(TestService::TestEnum x);

  ::krpc::schema::ProcedureCall enum_echo_call(TestService::TestEnum x);

  ::krpc::schema::ProcedureCall enum_list_default_call(std::vector<TestService::TestEnum> x);

  ::krpc::schema::ProcedureCall enum_return_call();

  ::krpc::schema::ProcedureCall float_special_defaults_call(float nan, float infinity, float negative_infinity, float maximum, float lowest, float fraction);

  ::krpc::schema::ProcedureCall float_to_string_call(float value);

  ::krpc::schema::ProcedureCall increment_dictionary_call(std::map<std::string, int32_t> d);

  ::krpc::schema::ProcedureCall increment_list_call(std::vector<int32_t> l);

  ::krpc::schema::ProcedureCall increment_list_of_structs_call(std::vector<TestService::TestStruct> l);

  ::krpc::schema::ProcedureCall increment_nested_collection_call(std::map<std::string, std::vector<int32_t> > d);

  ::krpc::schema::ProcedureCall increment_set_call(std::set<int32_t> h);

  ::krpc::schema::ProcedureCall increment_tuple_call(std::tuple<int32_t, int64_t> t);

  ::krpc::schema::ProcedureCall int32_special_defaults_call(int32_t maximum, int32_t minimum);

  ::krpc::schema::ProcedureCall int32_to_string_call(int32_t value);

  ::krpc::schema::ProcedureCall int64_special_defaults_call(int64_t maximum, int64_t minimum);

  ::krpc::schema::ProcedureCall int64_to_string_call(int64_t value);

  ::krpc::schema::ProcedureCall list_default_call(std::vector<int32_t> x);

  ::krpc::schema::ProcedureCall nested_struct_echo_call(TestService::TestNestedStruct x);

  ::krpc::schema::ProcedureCall not_nullable_object_call(TestService::TestClass value);

  ::krpc::schema::ProcedureCall nullable_struct_echo_call(TestService::TestNullableStruct x);

  ::krpc::schema::ProcedureCall on_timer_call(uint32_t milliseconds, uint32_t repeats);

  ::krpc::schema::ProcedureCall on_timer_using_lambda_call(uint32_t milliseconds);

  ::krpc::schema::ProcedureCall optional_arguments_call(std::string x, std::string y, std::string z, std::optional<TestService::TestClass> obj);

  ::krpc::schema::ProcedureCall remove_event_after_call(uint32_t milliseconds);

  ::krpc::schema::ProcedureCall reset_custom_exception_later_call();

  ::krpc::schema::ProcedureCall reset_invalid_operation_exception_later_call();

  ::krpc::schema::ProcedureCall return_null_when_not_allowed_call();

  ::krpc::schema::ProcedureCall set_default_call(std::set<int32_t> x);

  ::krpc::schema::ProcedureCall string_to_int32_call(std::string value);

  ::krpc::schema::ProcedureCall struct_default_call(TestService::TestStruct x);

  ::krpc::schema::ProcedureCall struct_echo_call(TestService::TestStruct x);

  ::krpc::schema::ProcedureCall struct_echo_nullable_call(std::optional<TestService::TestStruct> x);

  ::krpc::schema::ProcedureCall throw_argument_exception_call();

  ::krpc::schema::ProcedureCall throw_argument_null_exception_call(std::string foo);

  ::krpc::schema::ProcedureCall throw_argument_out_of_range_exception_call(int32_t foo);

  ::krpc::schema::ProcedureCall throw_custom_exception_call();

  ::krpc::schema::ProcedureCall throw_custom_exception_later_call();

  ::krpc::schema::ProcedureCall throw_invalid_operation_exception_call();

  ::krpc::schema::ProcedureCall throw_invalid_operation_exception_later_call();

  ::krpc::schema::ProcedureCall tuple_default_call(std::tuple<int32_t, bool> x);

  ::krpc::schema::ProcedureCall uint32_special_defaults_call(uint32_t maximum);

  ::krpc::schema::ProcedureCall uint64_special_defaults_call(uint64_t maximum);

  ::krpc::schema::ProcedureCall deprecated_property_call();

  ::krpc::schema::ProcedureCall set_deprecated_property_call(std::string value);

  ::krpc::schema::ProcedureCall nullable_object_call();

  ::krpc::schema::ProcedureCall set_nullable_object_call(std::optional<TestService::TestClass> value);

  ::krpc::schema::ProcedureCall object_property_call();

  ::krpc::schema::ProcedureCall set_object_property_call(std::optional<TestService::TestClass> value);

  ::krpc::schema::ProcedureCall string_property_call();

  ::krpc::schema::ProcedureCall set_string_property_call(std::string value);

  ::krpc::schema::ProcedureCall set_string_property_private_get_call(std::string value);

  ::krpc::schema::ProcedureCall string_property_private_set_call();

  /**
   * Deprecated class documentation string.
   *
   * \deprecated Use TestClass instead.
   */
  class [[deprecated("Use TestClass instead.")]] DeprecatedClass : public krpc::Object<DeprecatedClass> {
   public:
    explicit DeprecatedClass(Client* client = nullptr, uint64_t id = 0);

    /**
     * Deprecated method documentation string.
     *
     * \deprecated Use TestClass::get_value instead.
     */
    [[deprecated("Use TestClass::get_value instead.")]]
    std::string deprecated_method();

    ::krpc::Stream<std::string> deprecated_method_stream();

    ::krpc::schema::ProcedureCall deprecated_method_call();
  };

  /**
   * Class documentation string.
   */
  class TestClass : public krpc::Object<TestClass> {
   public:
    explicit TestClass(Client* client = nullptr, uint64_t id = 0);

    std::optional<TestService::TestClass> echo_nullable_object(std::optional<TestService::TestClass> value);

    std::string float_to_string(float x);

    /**
     * Method documentation string.
     */
    std::string get_value();

    std::string object_to_string(std::optional<TestService::TestClass> other);

    std::string optional_arguments(std::string x, std::string y, std::string z, std::optional<TestService::TestClass> obj);

    static std::string static_method(Client& client, std::string a, std::string b);

    static std::optional<TestService::TestClass> static_nullable_object(Client& client, std::optional<TestService::TestClass> value);

    /**
     * Property documentation string.
     */
    int32_t int_property();

    /**
     * Property documentation string.
     */
    void set_int_property(int32_t value);

    std::optional<TestService::TestClass> object_property();

    void set_object_property(std::optional<TestService::TestClass> value);

    void set_string_property_private_get(std::string value);

    std::string string_property_private_set();

    ::krpc::Stream<std::optional<TestService::TestClass>> echo_nullable_object_stream(std::optional<TestService::TestClass> value);

    ::krpc::Stream<std::string> float_to_string_stream(float x);

    ::krpc::Stream<std::string> get_value_stream();

    ::krpc::Stream<std::string> object_to_string_stream(std::optional<TestService::TestClass> other);

    ::krpc::Stream<std::string> optional_arguments_stream(std::string x, std::string y, std::string z, std::optional<TestService::TestClass> obj);

    static ::krpc::Stream<std::string> static_method_stream(Client& client, std::string a, std::string b);

    static ::krpc::Stream<std::optional<TestService::TestClass>> static_nullable_object_stream(Client& client, std::optional<TestService::TestClass> value);

    ::krpc::Stream<int32_t> int_property_stream();

    ::krpc::Stream<std::optional<TestService::TestClass>> object_property_stream();

    ::krpc::Stream<std::string> string_property_private_set_stream();

    ::krpc::schema::ProcedureCall echo_nullable_object_call(std::optional<TestService::TestClass> value);

    ::krpc::schema::ProcedureCall float_to_string_call(float x);

    ::krpc::schema::ProcedureCall get_value_call();

    ::krpc::schema::ProcedureCall object_to_string_call(std::optional<TestService::TestClass> other);

    ::krpc::schema::ProcedureCall optional_arguments_call(std::string x, std::string y, std::string z, std::optional<TestService::TestClass> obj);

    static ::krpc::schema::ProcedureCall static_method_call(Client& client, std::string a, std::string b);

    static ::krpc::schema::ProcedureCall static_nullable_object_call(Client& client, std::optional<TestService::TestClass> value);

    ::krpc::schema::ProcedureCall int_property_call();

    ::krpc::schema::ProcedureCall set_int_property_call(int32_t value);

    ::krpc::schema::ProcedureCall object_property_call();

    ::krpc::schema::ProcedureCall set_object_property_call(std::optional<TestService::TestClass> value);

    ::krpc::schema::ProcedureCall set_string_property_private_get_call(std::string value);

    ::krpc::schema::ProcedureCall string_property_private_set_call();
  };

  /**
   * Deprecated struct documentation string.
   *
   * \deprecated Use TestStruct instead.
   */
  struct [[deprecated("Use TestStruct instead.")]] DeprecatedStruct {
    /**
     * Deprecated struct Value documentation string.
     */
    int32_t value;
    /**
     * Deprecated struct OldValue documentation string.
     *
     * \deprecated Use DeprecatedStruct::value instead.
     */
    int32_t old_value [[deprecated("Use DeprecatedStruct::value instead.")]];

    DeprecatedStruct() : value(), old_value() {}

    DeprecatedStruct(int32_t value, int32_t old_value) :
value(value), old_value(old_value) {}

    bool operator==(const DeprecatedStruct& other) const {
      return this->value == other.value && this->old_value == other.old_value;
    }

    bool operator!=(const DeprecatedStruct& other) const {
      return !(*this == other);
    }

    // Ordered by the fields in turn, which is how a tuple of the same values orders
    bool operator<(const DeprecatedStruct& other) const {
      if (value < other.value)
        return true;
      if (other.value < value)
        return false;
      if (old_value < other.old_value)
        return true;
      return false;
    }

    bool operator>(const DeprecatedStruct& other) const {
      return other < *this;
    }

    bool operator<=(const DeprecatedStruct& other) const {
      return !(other < *this);
    }

    bool operator>=(const DeprecatedStruct& other) const {
      return !(*this < other);
    }
  };

  /**
   * Nested nullable struct documentation string.
   */
  struct TestNestedNullableStruct {
    std::vector<std::optional<TestService::TestClass> > list_field;
    std::string string_field;

    TestNestedNullableStruct() : list_field(), string_field() {}

    TestNestedNullableStruct(std::vector<std::optional<TestService::TestClass> > list_field, std::string string_field) :
list_field(list_field), string_field(string_field) {}

    bool operator==(const TestNestedNullableStruct& other) const {
      return this->list_field == other.list_field && this->string_field == other.string_field;
    }

    bool operator!=(const TestNestedNullableStruct& other) const {
      return !(*this == other);
    }

    // Ordered by the fields in turn, which is how a tuple of the same values orders
    bool operator<(const TestNestedNullableStruct& other) const {
      if (list_field < other.list_field)
        return true;
      if (other.list_field < list_field)
        return false;
      if (string_field < other.string_field)
        return true;
      return false;
    }

    bool operator>(const TestNestedNullableStruct& other) const {
      return other < *this;
    }

    bool operator<=(const TestNestedNullableStruct& other) const {
      return !(other < *this);
    }

    bool operator>=(const TestNestedNullableStruct& other) const {
      return !(*this < other);
    }
  };

  /**
   * Struct documentation string.
   */
  struct TestStruct {
    /**
     * Struct IntField documentation string.
     */
    int32_t int_field;
    std::string string_field;
    TestService::TestEnum enum_field;
    std::vector<int32_t> list_field;

    TestStruct() : int_field(), string_field(), enum_field(), list_field() {}

    TestStruct(int32_t int_field, std::string string_field, TestService::TestEnum enum_field, std::vector<int32_t> list_field) :
int_field(int_field), string_field(string_field), enum_field(enum_field), list_field(list_field) {}

    bool operator==(const TestStruct& other) const {
      return this->int_field == other.int_field && this->string_field == other.string_field && this->enum_field == other.enum_field && this->list_field == other.list_field;
    }

    bool operator!=(const TestStruct& other) const {
      return !(*this == other);
    }

    // Ordered by the fields in turn, which is how a tuple of the same values orders
    bool operator<(const TestStruct& other) const {
      if (int_field < other.int_field)
        return true;
      if (other.int_field < int_field)
        return false;
      if (string_field < other.string_field)
        return true;
      if (other.string_field < string_field)
        return false;
      if (enum_field < other.enum_field)
        return true;
      if (other.enum_field < enum_field)
        return false;
      if (list_field < other.list_field)
        return true;
      return false;
    }

    bool operator>(const TestStruct& other) const {
      return other < *this;
    }

    bool operator<=(const TestStruct& other) const {
      return !(other < *this);
    }

    bool operator>=(const TestStruct& other) const {
      return !(*this < other);
    }
  };

  /**
   * Nested struct documentation string.
   */
  struct TestNestedStruct {
    TestService::TestStruct struct_field;
    TestService::TestClass object_field;
    std::string string_field;

    TestNestedStruct() : struct_field(), object_field(), string_field() {}

    TestNestedStruct(TestService::TestStruct struct_field, TestService::TestClass object_field, std::string string_field) :
struct_field(struct_field), object_field(object_field), string_field(string_field) {}

    bool operator==(const TestNestedStruct& other) const {
      return this->struct_field == other.struct_field && this->object_field == other.object_field && this->string_field == other.string_field;
    }

    bool operator!=(const TestNestedStruct& other) const {
      return !(*this == other);
    }

    // Ordered by the fields in turn, which is how a tuple of the same values orders
    bool operator<(const TestNestedStruct& other) const {
      if (struct_field < other.struct_field)
        return true;
      if (other.struct_field < struct_field)
        return false;
      if (object_field < other.object_field)
        return true;
      if (other.object_field < object_field)
        return false;
      if (string_field < other.string_field)
        return true;
      return false;
    }

    bool operator>(const TestNestedStruct& other) const {
      return other < *this;
    }

    bool operator<=(const TestNestedStruct& other) const {
      return !(other < *this);
    }

    bool operator>=(const TestNestedStruct& other) const {
      return !(*this < other);
    }
  };

  /**
   * Nullable struct documentation string.
   */
  struct TestNullableStruct {
    int32_t int_field;
    std::optional<int32_t> nullable_int_field;
    std::optional<TestService::TestEnum> nullable_enum_field;
    std::optional<std::string> nullable_string_field;
    std::optional<TestService::TestClass> nullable_object_field;

    TestNullableStruct() : int_field(), nullable_int_field(), nullable_enum_field(), nullable_string_field(), nullable_object_field() {}

    TestNullableStruct(int32_t int_field, std::optional<int32_t> nullable_int_field, std::optional<TestService::TestEnum> nullable_enum_field, std::optional<std::string> nullable_string_field, std::optional<TestService::TestClass> nullable_object_field) :
int_field(int_field), nullable_int_field(nullable_int_field), nullable_enum_field(nullable_enum_field), nullable_string_field(nullable_string_field), nullable_object_field(nullable_object_field) {}

    bool operator==(const TestNullableStruct& other) const {
      return this->int_field == other.int_field && this->nullable_int_field == other.nullable_int_field && this->nullable_enum_field == other.nullable_enum_field && this->nullable_string_field == other.nullable_string_field && this->nullable_object_field == other.nullable_object_field;
    }

    bool operator!=(const TestNullableStruct& other) const {
      return !(*this == other);
    }

    // Ordered by the fields in turn, which is how a tuple of the same values orders
    bool operator<(const TestNullableStruct& other) const {
      if (int_field < other.int_field)
        return true;
      if (other.int_field < int_field)
        return false;
      if (nullable_int_field < other.nullable_int_field)
        return true;
      if (other.nullable_int_field < nullable_int_field)
        return false;
      if (nullable_enum_field < other.nullable_enum_field)
        return true;
      if (other.nullable_enum_field < nullable_enum_field)
        return false;
      if (nullable_string_field < other.nullable_string_field)
        return true;
      if (other.nullable_string_field < nullable_string_field)
        return false;
      if (nullable_object_field < other.nullable_object_field)
        return true;
      return false;
    }

    bool operator>(const TestNullableStruct& other) const {
      return other < *this;
    }

    bool operator<=(const TestNullableStruct& other) const {
      return !(other < *this);
    }

    bool operator>=(const TestNullableStruct& other) const {
      return !(*this < other);
    }
  };
};

}  // namespace services

namespace encoder {

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
  inline std::string encode(const services::TestService::DeprecatedEnum& value) {
    return krpc::encoder::encode(static_cast<int32_t>(value));
  }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

  inline std::string encode(const services::TestService::TestEnum& value) {
    return krpc::encoder::encode(static_cast<int32_t>(value));
  }

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
  // A structure is sent as the values of its fields in order, which is the same encoding as
  // a tuple of those values. See the note on the collection encoders for why the message it
  // is sent in is kept between calls.
  inline std::string encode(const services::TestService::DeprecatedStruct& value) {
    static thread_local krpc::schema::Tuple structMessage;
    structMessage.Clear();
    structMessage.add_items(encode_item(value.value));
    structMessage.add_items(encode_item(value.old_value));
    return krpc::encoder::encode(structMessage);
  }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

  // A structure is sent as the values of its fields in order, which is the same encoding as
  // a tuple of those values. See the note on the collection encoders for why the message it
  // is sent in is kept between calls.
  inline std::string encode(const services::TestService::TestNestedNullableStruct& value) {
    static thread_local krpc::schema::Tuple structMessage;
    structMessage.Clear();
    structMessage.add_items(encode_item(value.list_field));
    structMessage.add_items(encode_item(value.string_field));
    return krpc::encoder::encode(structMessage);
  }

  // A structure is sent as the values of its fields in order, which is the same encoding as
  // a tuple of those values. See the note on the collection encoders for why the message it
  // is sent in is kept between calls.
  inline std::string encode(const services::TestService::TestStruct& value) {
    static thread_local krpc::schema::Tuple structMessage;
    structMessage.Clear();
    structMessage.add_items(encode_item(value.int_field));
    structMessage.add_items(encode_item(value.string_field));
    structMessage.add_items(encode_item(value.enum_field));
    structMessage.add_items(encode_item(value.list_field));
    return krpc::encoder::encode(structMessage);
  }

  // A structure is sent as the values of its fields in order, which is the same encoding as
  // a tuple of those values. See the note on the collection encoders for why the message it
  // is sent in is kept between calls.
  inline std::string encode(const services::TestService::TestNestedStruct& value) {
    static thread_local krpc::schema::Tuple structMessage;
    structMessage.Clear();
    structMessage.add_items(encode_item(value.struct_field));
    structMessage.add_items(encode_item(value.object_field));
    structMessage.add_items(encode_item(value.string_field));
    return krpc::encoder::encode(structMessage);
  }

  // A structure is sent as the values of its fields in order, which is the same encoding as
  // a tuple of those values. See the note on the collection encoders for why the message it
  // is sent in is kept between calls.
  inline std::string encode(const services::TestService::TestNullableStruct& value) {
    static thread_local krpc::schema::Tuple structMessage;
    structMessage.Clear();
    structMessage.add_items(encode_item(value.int_field));
    structMessage.add_items(encode_item(value.nullable_int_field));
    structMessage.add_items(encode_item(value.nullable_enum_field));
    structMessage.add_items(encode_item(value.nullable_string_field));
    structMessage.add_items(encode_item(value.nullable_object_field));
    return krpc::encoder::encode(structMessage);
  }

}  // namespace encoder

namespace decoder {

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
  inline void decode(services::TestService::DeprecatedEnum& value, const std::string& data, Client* client) {
    int32_t x;
    decode(x, data, client);
    value = static_cast<services::TestService::DeprecatedEnum>(x);
  }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

  inline void decode(services::TestService::TestEnum& value, const std::string& data, Client* client) {
    int32_t x;
    decode(x, data, client);
    value = static_cast<services::TestService::TestEnum>(x);
  }

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
  // Fields are only ever appended to a structure, so a value from a newer server may carry
  // more items than this client knows about, and those are ignored.
  inline void decode(services::TestService::DeprecatedStruct& value, const std::string& data, Client* client) {
    static thread_local krpc::schema::Tuple structMessage;
    if (!structMessage.ParseFromString(data)) throw EncodingError("Failed to decode message");
    if (structMessage.items_size() < 2)
      throw EncodingError("Value for DeprecatedStruct does not have all of its fields");
    decode_item(value.value, structMessage.items(0), client);
    decode_item(value.old_value, structMessage.items(1), client);
  }
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

  // Fields are only ever appended to a structure, so a value from a newer server may carry
  // more items than this client knows about, and those are ignored.
  inline void decode(services::TestService::TestNestedNullableStruct& value, const std::string& data, Client* client) {
    static thread_local krpc::schema::Tuple structMessage;
    if (!structMessage.ParseFromString(data)) throw EncodingError("Failed to decode message");
    if (structMessage.items_size() < 2)
      throw EncodingError("Value for TestNestedNullableStruct does not have all of its fields");
    decode_item(value.list_field, structMessage.items(0), client);
    decode_item(value.string_field, structMessage.items(1), client);
  }

  // Fields are only ever appended to a structure, so a value from a newer server may carry
  // more items than this client knows about, and those are ignored.
  inline void decode(services::TestService::TestStruct& value, const std::string& data, Client* client) {
    static thread_local krpc::schema::Tuple structMessage;
    if (!structMessage.ParseFromString(data)) throw EncodingError("Failed to decode message");
    if (structMessage.items_size() < 4)
      throw EncodingError("Value for TestStruct does not have all of its fields");
    decode_item(value.int_field, structMessage.items(0), client);
    decode_item(value.string_field, structMessage.items(1), client);
    decode_item(value.enum_field, structMessage.items(2), client);
    decode_item(value.list_field, structMessage.items(3), client);
  }

  // Fields are only ever appended to a structure, so a value from a newer server may carry
  // more items than this client knows about, and those are ignored.
  inline void decode(services::TestService::TestNestedStruct& value, const std::string& data, Client* client) {
    static thread_local krpc::schema::Tuple structMessage;
    if (!structMessage.ParseFromString(data)) throw EncodingError("Failed to decode message");
    if (structMessage.items_size() < 3)
      throw EncodingError("Value for TestNestedStruct does not have all of its fields");
    decode_item(value.struct_field, structMessage.items(0), client);
    decode_item(value.object_field, structMessage.items(1), client);
    decode_item(value.string_field, structMessage.items(2), client);
  }

  // Fields are only ever appended to a structure, so a value from a newer server may carry
  // more items than this client knows about, and those are ignored.
  inline void decode(services::TestService::TestNullableStruct& value, const std::string& data, Client* client) {
    static thread_local krpc::schema::Tuple structMessage;
    if (!structMessage.ParseFromString(data)) throw EncodingError("Failed to decode message");
    if (structMessage.items_size() < 5)
      throw EncodingError("Value for TestNullableStruct does not have all of its fields");
    decode_item(value.int_field, structMessage.items(0), client);
    decode_item(value.nullable_int_field, structMessage.items(1), client);
    decode_item(value.nullable_enum_field, structMessage.items(2), client);
    decode_item(value.nullable_string_field, structMessage.items(3), client);
    decode_item(value.nullable_object_field, structMessage.items(4), client);
  }

}  // namespace decoder

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
inline std::size_t hash_value(const services::TestService::DeprecatedStruct& value) {
  std::size_t seed = 0;
  hash_combine(&seed, hash_value(value.value));
  hash_combine(&seed, hash_value(value.old_value));
  return seed;
}
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

inline std::size_t hash_value(const services::TestService::TestNestedNullableStruct& value) {
  std::size_t seed = 0;
  hash_combine(&seed, hash_value(value.list_field));
  hash_combine(&seed, hash_value(value.string_field));
  return seed;
}

inline std::size_t hash_value(const services::TestService::TestStruct& value) {
  std::size_t seed = 0;
  hash_combine(&seed, hash_value(value.int_field));
  hash_combine(&seed, hash_value(value.string_field));
  hash_combine(&seed, hash_value(value.enum_field));
  hash_combine(&seed, hash_value(value.list_field));
  return seed;
}

inline std::size_t hash_value(const services::TestService::TestNestedStruct& value) {
  std::size_t seed = 0;
  hash_combine(&seed, hash_value(value.struct_field));
  hash_combine(&seed, hash_value(value.object_field));
  hash_combine(&seed, hash_value(value.string_field));
  return seed;
}

inline std::size_t hash_value(const services::TestService::TestNullableStruct& value) {
  std::size_t seed = 0;
  hash_combine(&seed, hash_value(value.int_field));
  hash_combine(&seed, hash_value(value.nullable_int_field));
  hash_combine(&seed, hash_value(value.nullable_enum_field));
  hash_combine(&seed, hash_value(value.nullable_string_field));
  hash_combine(&seed, hash_value(value.nullable_object_field));
  return seed;
}

// A collection encoder or decoder calls encode and decode on the type it contains
// without qualifying them. The ones above are declared after those templates, so
// argument dependent lookup is what reaches them. It searches the namespace that
// encloses the type, which is this one. These name the same functions here, as a
// second function with the same signature is ambiguous to a compiler that finds both.
namespace services {
  using krpc::encoder::encode;
  using krpc::decoder::decode;
  using krpc::hash_value;
}  // namespace services

namespace services {

inline TestService::TestService(Client* client):
  Service(client) {
  client->add_exception_thrower(
    "TestService", "CustomException",
    [] (const std::string& msg) { throw CustomException(msg); });
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
  client->add_exception_thrower(
    "TestService", "DeprecatedException",
    [] (const std::string& msg) { throw DeprecatedException(msg); });
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
}

inline std::string TestService::add_multiple_values(float x, int32_t y, int64_t z) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(3);
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  auto _data = this->_client->invoke("TestService", "AddMultipleValues", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<TestService::TestClass> TestService::add_to_object_list(std::vector<TestService::TestClass> l, std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(l));
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "AddToObjectList", _args, ::krpc::Client::Returns::value);
  std::vector<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::blocking_procedure(int32_t n, int32_t sum = 0) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(n));
  _args.push_back(encoder::encode_arg(sum));
  auto _data = this->_client->invoke("TestService", "BlockingProcedure", _args, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::bool_to_string(bool value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "BoolToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::bytes_to_hex_string(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "BytesToHexString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::counter(std::string id = "", int32_t divisor = 1) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(id));
  _args.push_back(encoder::encode_arg(divisor));
  auto _data = this->_client->invoke("TestService", "Counter", _args, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestStruct TestService::counter_struct(std::string id = "") {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(id));
  auto _data = this->_client->invoke("TestService", "CounterStruct", _args, ::krpc::Client::Returns::value);
  TestService::TestStruct _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestClass TestService::create_test_object(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "CreateTestObject", _args, ::krpc::Client::Returns::value);
  TestService::TestClass _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::deprecated_procedure(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "DeprecatedProcedure", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::deprecated_procedure_no_message(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "DeprecatedProcedureNoMessage", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::map<int32_t, bool> TestService::dictionary_default(std::map<int32_t, bool> x = std::map<int32_t, bool>{{1, false}, {2, true}}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "DictionaryDefault", _args, ::krpc::Client::Returns::value);
  std::map<int32_t, bool> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<double> TestService::double_special_defaults(double nan = std::numeric_limits<double>::quiet_NaN(), double infinity = std::numeric_limits<double>::infinity(), double negative_infinity = -std::numeric_limits<double>::infinity(), double maximum = (std::numeric_limits<double>::max)(), double lowest = std::numeric_limits<double>::lowest()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(5);
  _args.push_back(encoder::encode_arg(nan));
  _args.push_back(encoder::encode_arg(infinity));
  _args.push_back(encoder::encode_arg(negative_infinity));
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(lowest));
  auto _data = this->_client->invoke("TestService", "DoubleSpecialDefaults", _args, ::krpc::Client::Returns::value);
  std::vector<double> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::double_to_string(double value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "DoubleToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::dump_expression_tree(KRPC::Expression expression) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(expression));
  auto _data = this->_client->invoke("TestService", "DumpExpressionTree", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::map<std::string, std::optional<TestService::TestClass> > TestService::echo_dictionary_of_nullable_objects(std::map<std::string, std::optional<TestService::TestClass> > d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  auto _data = this->_client->invoke("TestService", "EchoDictionaryOfNullableObjects", _args, ::krpc::Client::Returns::value);
  std::map<std::string, std::optional<TestService::TestClass> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<std::optional<int32_t> > TestService::echo_list_of_nullable_ints(std::vector<std::optional<int32_t> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  auto _data = this->_client->invoke("TestService", "EchoListOfNullableInts", _args, ::krpc::Client::Returns::value);
  std::vector<std::optional<int32_t> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<std::optional<TestService::TestClass> > TestService::echo_list_of_nullable_objects(std::vector<std::optional<TestService::TestClass> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  auto _data = this->_client->invoke("TestService", "EchoListOfNullableObjects", _args, ::krpc::Client::Returns::value);
  std::vector<std::optional<TestService::TestClass> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<std::vector<std::optional<TestService::TestClass>> > TestService::echo_nested_list_of_nullable_objects(std::vector<std::vector<std::optional<TestService::TestClass>> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  auto _data = this->_client->invoke("TestService", "EchoNestedListOfNullableObjects", _args, ::krpc::Client::Returns::value);
  std::vector<std::vector<std::optional<TestService::TestClass>> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestNestedNullableStruct TestService::echo_nested_nullable_struct(TestService::TestNestedNullableStruct value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "EchoNestedNullableStruct", _args, ::krpc::Client::Returns::value);
  TestService::TestNestedNullableStruct _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::optional<int32_t> TestService::echo_nullable_int(std::optional<int32_t> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "EchoNullableInt", _args, ::krpc::Client::Returns::value);
  std::optional<int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::optional<std::vector<int32_t> > TestService::echo_nullable_list(std::optional<std::vector<int32_t> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  auto _data = this->_client->invoke("TestService", "EchoNullableList", _args, ::krpc::Client::Returns::value);
  std::optional<std::vector<int32_t> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::optional<std::string> TestService::echo_nullable_string(std::optional<std::string> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "EchoNullableString", _args, ::krpc::Client::Returns::value);
  std::optional<std::string> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::optional<TestService::TestClass> TestService::echo_test_object(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "EchoTestObject", _args, ::krpc::Client::Returns::value);
  std::optional<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::tuple<int32_t, std::optional<TestService::TestClass> > TestService::echo_tuple_with_a_nullable_object(std::tuple<int32_t, std::optional<TestService::TestClass> > t) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(t));
  auto _data = this->_client->invoke("TestService", "EchoTupleWithANullableObject", _args, ::krpc::Client::Returns::value);
  std::tuple<int32_t, std::optional<TestService::TestClass> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<std::string> TestService::empty_list_default(std::vector<std::string> x = std::vector<std::string>{}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "EmptyListDefault", _args, ::krpc::Client::Returns::value);
  std::vector<std::string> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestEnum TestService::enum_default_arg(TestService::TestEnum x = TestService::TestEnum::value_c) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "EnumDefaultArg", _args, ::krpc::Client::Returns::value);
  TestService::TestEnum _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestEnum TestService::enum_echo(TestService::TestEnum x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "EnumEcho", _args, ::krpc::Client::Returns::value);
  TestService::TestEnum _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<TestService::TestEnum> TestService::enum_list_default(std::vector<TestService::TestEnum> x = std::vector<TestService::TestEnum>{TestService::TestEnum::value_b, TestService::TestEnum::value_c}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "EnumListDefault", _args, ::krpc::Client::Returns::value);
  std::vector<TestService::TestEnum> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestEnum TestService::enum_return() {
  auto _data = this->_client->invoke("TestService", "EnumReturn", {}, ::krpc::Client::Returns::value);
  TestService::TestEnum _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<float> TestService::float_special_defaults(float nan = std::numeric_limits<float>::quiet_NaN(), float infinity = std::numeric_limits<float>::infinity(), float negative_infinity = -std::numeric_limits<float>::infinity(), float maximum = (std::numeric_limits<float>::max)(), float lowest = std::numeric_limits<float>::lowest(), float fraction = 0.1f) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(6);
  _args.push_back(encoder::encode_arg(nan));
  _args.push_back(encoder::encode_arg(infinity));
  _args.push_back(encoder::encode_arg(negative_infinity));
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(lowest));
  _args.push_back(encoder::encode_arg(fraction));
  auto _data = this->_client->invoke("TestService", "FloatSpecialDefaults", _args, ::krpc::Client::Returns::value);
  std::vector<float> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::float_to_string(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "FloatToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::map<std::string, int32_t> TestService::increment_dictionary(std::map<std::string, int32_t> d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  auto _data = this->_client->invoke("TestService", "IncrementDictionary", _args, ::krpc::Client::Returns::value);
  std::map<std::string, int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<int32_t> TestService::increment_list(std::vector<int32_t> l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  auto _data = this->_client->invoke("TestService", "IncrementList", _args, ::krpc::Client::Returns::value);
  std::vector<int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<TestService::TestStruct> TestService::increment_list_of_structs(std::vector<TestService::TestStruct> l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  auto _data = this->_client->invoke("TestService", "IncrementListOfStructs", _args, ::krpc::Client::Returns::value);
  std::vector<TestService::TestStruct> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::map<std::string, std::vector<int32_t> > TestService::increment_nested_collection(std::map<std::string, std::vector<int32_t> > d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  auto _data = this->_client->invoke("TestService", "IncrementNestedCollection", _args, ::krpc::Client::Returns::value);
  std::map<std::string, std::vector<int32_t> > _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::set<int32_t> TestService::increment_set(std::set<int32_t> h) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(h));
  auto _data = this->_client->invoke("TestService", "IncrementSet", _args, ::krpc::Client::Returns::value);
  std::set<int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::tuple<int32_t, int64_t> TestService::increment_tuple(std::tuple<int32_t, int64_t> t) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(t));
  auto _data = this->_client->invoke("TestService", "IncrementTuple", _args, ::krpc::Client::Returns::value);
  std::tuple<int32_t, int64_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<int32_t> TestService::int32_special_defaults(int32_t maximum = (std::numeric_limits<int32_t>::max)(), int32_t minimum = (std::numeric_limits<int32_t>::min)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(minimum));
  auto _data = this->_client->invoke("TestService", "Int32SpecialDefaults", _args, ::krpc::Client::Returns::value);
  std::vector<int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::int32_to_string(int32_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "Int32ToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<int64_t> TestService::int64_special_defaults(int64_t maximum = (std::numeric_limits<int64_t>::max)(), int64_t minimum = (std::numeric_limits<int64_t>::min)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(minimum));
  auto _data = this->_client->invoke("TestService", "Int64SpecialDefaults", _args, ::krpc::Client::Returns::value);
  std::vector<int64_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::int64_to_string(int64_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "Int64ToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<int32_t> TestService::list_default(std::vector<int32_t> x = std::vector<int32_t>{1, 2, 3}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "ListDefault", _args, ::krpc::Client::Returns::value);
  std::vector<int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestNestedStruct TestService::nested_struct_echo(TestService::TestNestedStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "NestedStructEcho", _args, ::krpc::Client::Returns::value);
  TestService::TestNestedStruct _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestClass TestService::not_nullable_object(TestService::TestClass value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "NotNullableObject", _args, ::krpc::Client::Returns::value);
  TestService::TestClass _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestNullableStruct TestService::nullable_struct_echo(TestService::TestNullableStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "NullableStructEcho", _args, ::krpc::Client::Returns::value);
  TestService::TestNullableStruct _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline ::krpc::Event TestService::on_timer(uint32_t milliseconds, uint32_t repeats = 1) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(milliseconds));
  _args.push_back(encoder::encode_arg(repeats));
  auto _data = this->_client->invoke("TestService", "OnTimer", _args, ::krpc::Client::Returns::event);
  ::krpc::Event _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline ::krpc::Event TestService::on_timer_using_lambda(uint32_t milliseconds) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(milliseconds));
  auto _data = this->_client->invoke("TestService", "OnTimerUsingLambda", _args, ::krpc::Client::Returns::event);
  ::krpc::Event _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::optional_arguments(std::string x, std::string y = "foo", std::string z = "bar", std::optional<TestService::TestClass> obj = std::optional<TestService::TestClass>()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(4);
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  _args.push_back(encoder::encode_arg(obj));
  auto _data = this->_client->invoke("TestService", "OptionalArguments", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline ::krpc::Event TestService::remove_event_after(uint32_t milliseconds) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(milliseconds));
  auto _data = this->_client->invoke("TestService", "RemoveEventAfter", _args, ::krpc::Client::Returns::event);
  ::krpc::Event _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::reset_custom_exception_later() {
  this->_client->invoke("TestService", "ResetCustomExceptionLater", {}, ::krpc::Client::Returns::value);
}

inline void TestService::reset_invalid_operation_exception_later() {
  this->_client->invoke("TestService", "ResetInvalidOperationExceptionLater", {}, ::krpc::Client::Returns::value);
}

inline TestService::TestClass TestService::return_null_when_not_allowed() {
  auto _data = this->_client->invoke("TestService", "ReturnNullWhenNotAllowed", {}, ::krpc::Client::Returns::value);
  TestService::TestClass _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::set<int32_t> TestService::set_default(std::set<int32_t> x = std::set<int32_t>{1, 2, 3}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "SetDefault", _args, ::krpc::Client::Returns::value);
  std::set<int32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::string_to_int32(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "StringToInt32", _args, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestStruct TestService::struct_default(TestService::TestStruct x = TestService::TestStruct{42, "jeb", TestService::TestEnum::value_b, std::vector<int32_t>{1, 2, 3}}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "StructDefault", _args, ::krpc::Client::Returns::value);
  TestService::TestStruct _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline TestService::TestStruct TestService::struct_echo(TestService::TestStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "StructEcho", _args, ::krpc::Client::Returns::value);
  TestService::TestStruct _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::optional<TestService::TestStruct> TestService::struct_echo_nullable(std::optional<TestService::TestStruct> x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "StructEchoNullable", _args, ::krpc::Client::Returns::value);
  std::optional<TestService::TestStruct> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_argument_exception() {
  auto _data = this->_client->invoke("TestService", "ThrowArgumentException", {}, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_argument_null_exception(std::string foo) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(foo));
  auto _data = this->_client->invoke("TestService", "ThrowArgumentNullException", _args, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_argument_out_of_range_exception(int32_t foo) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(foo));
  auto _data = this->_client->invoke("TestService", "ThrowArgumentOutOfRangeException", _args, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_custom_exception() {
  auto _data = this->_client->invoke("TestService", "ThrowCustomException", {}, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_custom_exception_later() {
  auto _data = this->_client->invoke("TestService", "ThrowCustomExceptionLater", {}, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_invalid_operation_exception() {
  auto _data = this->_client->invoke("TestService", "ThrowInvalidOperationException", {}, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::throw_invalid_operation_exception_later() {
  auto _data = this->_client->invoke("TestService", "ThrowInvalidOperationExceptionLater", {}, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::tuple<int32_t, bool> TestService::tuple_default(std::tuple<int32_t, bool> x = std::tuple<int32_t, bool>{1, false}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "TupleDefault", _args, ::krpc::Client::Returns::value);
  std::tuple<int32_t, bool> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<uint32_t> TestService::uint32_special_defaults(uint32_t maximum = (std::numeric_limits<uint32_t>::max)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(maximum));
  auto _data = this->_client->invoke("TestService", "Uint32SpecialDefaults", _args, ::krpc::Client::Returns::value);
  std::vector<uint32_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::vector<uint64_t> TestService::uint64_special_defaults(uint64_t maximum = (std::numeric_limits<uint64_t>::max)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(maximum));
  auto _data = this->_client->invoke("TestService", "Uint64SpecialDefaults", _args, ::krpc::Client::Returns::value);
  std::vector<uint64_t> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::deprecated_property() {
  auto _data = this->_client->invoke("TestService", "get_DeprecatedProperty", {}, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::set_deprecated_property(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "set_DeprecatedProperty", _args, ::krpc::Client::Returns::value);
}

inline std::optional<TestService::TestClass> TestService::nullable_object() {
  auto _data = this->_client->invoke("TestService", "get_NullableObject", {}, ::krpc::Client::Returns::value);
  std::optional<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::set_nullable_object(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "set_NullableObject", _args, ::krpc::Client::Returns::value);
}

inline std::optional<TestService::TestClass> TestService::object_property() {
  auto _data = this->_client->invoke("TestService", "get_ObjectProperty", {}, ::krpc::Client::Returns::value);
  std::optional<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::set_object_property(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "set_ObjectProperty", _args, ::krpc::Client::Returns::value);
}

inline std::string TestService::string_property() {
  auto _data = this->_client->invoke("TestService", "get_StringProperty", {}, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::set_string_property(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "set_StringProperty", _args, ::krpc::Client::Returns::value);
}

inline void TestService::set_string_property_private_get(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "set_StringPropertyPrivateGet", _args, ::krpc::Client::Returns::value);
}

inline std::string TestService::string_property_private_set() {
  auto _data = this->_client->invoke("TestService", "get_StringPropertyPrivateSet", {}, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline ::krpc::Stream<std::string> TestService::add_multiple_values_stream(float x, int32_t y, int64_t z) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(3);
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "AddMultipleValues", _args));
}

inline ::krpc::Stream<std::vector<TestService::TestClass>> TestService::add_to_object_list_stream(std::vector<TestService::TestClass> l, std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(l));
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::vector<TestService::TestClass>>(this->_client, this->_client->build_call("TestService", "AddToObjectList", _args));
}

inline ::krpc::Stream<int32_t> TestService::blocking_procedure_stream(int32_t n, int32_t sum = 0) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(n));
  _args.push_back(encoder::encode_arg(sum));
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "BlockingProcedure", _args));
}

inline ::krpc::Stream<std::string> TestService::bool_to_string_stream(bool value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "BoolToString", _args));
}

inline ::krpc::Stream<std::string> TestService::bytes_to_hex_string_stream(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "BytesToHexString", _args));
}

inline ::krpc::Stream<int32_t> TestService::counter_stream(std::string id = "", int32_t divisor = 1) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(id));
  _args.push_back(encoder::encode_arg(divisor));
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "Counter", _args));
}

inline ::krpc::Stream<TestService::TestStruct> TestService::counter_struct_stream(std::string id = "") {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(id));
  return ::krpc::Stream<TestService::TestStruct>(this->_client, this->_client->build_call("TestService", "CounterStruct", _args));
}

inline ::krpc::Stream<TestService::TestClass> TestService::create_test_object_stream(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<TestService::TestClass>(this->_client, this->_client->build_call("TestService", "CreateTestObject", _args));
}

inline ::krpc::Stream<std::string> TestService::deprecated_procedure_stream(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "DeprecatedProcedure", _args));
}

inline ::krpc::Stream<std::string> TestService::deprecated_procedure_no_message_stream(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "DeprecatedProcedureNoMessage", _args));
}

inline ::krpc::Stream<std::map<int32_t, bool>> TestService::dictionary_default_stream(std::map<int32_t, bool> x = std::map<int32_t, bool>{{1, false}, {2, true}}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::map<int32_t, bool>>(this->_client, this->_client->build_call("TestService", "DictionaryDefault", _args));
}

inline ::krpc::Stream<std::vector<double>> TestService::double_special_defaults_stream(double nan = std::numeric_limits<double>::quiet_NaN(), double infinity = std::numeric_limits<double>::infinity(), double negative_infinity = -std::numeric_limits<double>::infinity(), double maximum = (std::numeric_limits<double>::max)(), double lowest = std::numeric_limits<double>::lowest()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(5);
  _args.push_back(encoder::encode_arg(nan));
  _args.push_back(encoder::encode_arg(infinity));
  _args.push_back(encoder::encode_arg(negative_infinity));
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(lowest));
  return ::krpc::Stream<std::vector<double>>(this->_client, this->_client->build_call("TestService", "DoubleSpecialDefaults", _args));
}

inline ::krpc::Stream<std::string> TestService::double_to_string_stream(double value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "DoubleToString", _args));
}

inline ::krpc::Stream<std::string> TestService::dump_expression_tree_stream(KRPC::Expression expression) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(expression));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "DumpExpressionTree", _args));
}

inline ::krpc::Stream<std::map<std::string, std::optional<TestService::TestClass> >> TestService::echo_dictionary_of_nullable_objects_stream(std::map<std::string, std::optional<TestService::TestClass> > d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  return ::krpc::Stream<std::map<std::string, std::optional<TestService::TestClass> >>(this->_client, this->_client->build_call("TestService", "EchoDictionaryOfNullableObjects", _args));
}

inline ::krpc::Stream<std::vector<std::optional<int32_t> >> TestService::echo_list_of_nullable_ints_stream(std::vector<std::optional<int32_t> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return ::krpc::Stream<std::vector<std::optional<int32_t> >>(this->_client, this->_client->build_call("TestService", "EchoListOfNullableInts", _args));
}

inline ::krpc::Stream<std::vector<std::optional<TestService::TestClass> >> TestService::echo_list_of_nullable_objects_stream(std::vector<std::optional<TestService::TestClass> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return ::krpc::Stream<std::vector<std::optional<TestService::TestClass> >>(this->_client, this->_client->build_call("TestService", "EchoListOfNullableObjects", _args));
}

inline ::krpc::Stream<std::vector<std::vector<std::optional<TestService::TestClass>> >> TestService::echo_nested_list_of_nullable_objects_stream(std::vector<std::vector<std::optional<TestService::TestClass>> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return ::krpc::Stream<std::vector<std::vector<std::optional<TestService::TestClass>> >>(this->_client, this->_client->build_call("TestService", "EchoNestedListOfNullableObjects", _args));
}

inline ::krpc::Stream<TestService::TestNestedNullableStruct> TestService::echo_nested_nullable_struct_stream(TestService::TestNestedNullableStruct value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<TestService::TestNestedNullableStruct>(this->_client, this->_client->build_call("TestService", "EchoNestedNullableStruct", _args));
}

inline ::krpc::Stream<std::optional<int32_t>> TestService::echo_nullable_int_stream(std::optional<int32_t> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::optional<int32_t>>(this->_client, this->_client->build_call("TestService", "EchoNullableInt", _args));
}

inline ::krpc::Stream<std::optional<std::vector<int32_t> >> TestService::echo_nullable_list_stream(std::optional<std::vector<int32_t> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return ::krpc::Stream<std::optional<std::vector<int32_t> >>(this->_client, this->_client->build_call("TestService", "EchoNullableList", _args));
}

inline ::krpc::Stream<std::optional<std::string>> TestService::echo_nullable_string_stream(std::optional<std::string> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::optional<std::string>>(this->_client, this->_client->build_call("TestService", "EchoNullableString", _args));
}

inline ::krpc::Stream<std::optional<TestService::TestClass>> TestService::echo_test_object_stream(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::optional<TestService::TestClass>>(this->_client, this->_client->build_call("TestService", "EchoTestObject", _args));
}

inline ::krpc::Stream<std::tuple<int32_t, std::optional<TestService::TestClass> >> TestService::echo_tuple_with_a_nullable_object_stream(std::tuple<int32_t, std::optional<TestService::TestClass> > t) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(t));
  return ::krpc::Stream<std::tuple<int32_t, std::optional<TestService::TestClass> >>(this->_client, this->_client->build_call("TestService", "EchoTupleWithANullableObject", _args));
}

inline ::krpc::Stream<std::vector<std::string>> TestService::empty_list_default_stream(std::vector<std::string> x = std::vector<std::string>{}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::vector<std::string>>(this->_client, this->_client->build_call("TestService", "EmptyListDefault", _args));
}

inline ::krpc::Stream<TestService::TestEnum> TestService::enum_default_arg_stream(TestService::TestEnum x = TestService::TestEnum::value_c) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<TestService::TestEnum>(this->_client, this->_client->build_call("TestService", "EnumDefaultArg", _args));
}

inline ::krpc::Stream<TestService::TestEnum> TestService::enum_echo_stream(TestService::TestEnum x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<TestService::TestEnum>(this->_client, this->_client->build_call("TestService", "EnumEcho", _args));
}

inline ::krpc::Stream<std::vector<TestService::TestEnum>> TestService::enum_list_default_stream(std::vector<TestService::TestEnum> x = std::vector<TestService::TestEnum>{TestService::TestEnum::value_b, TestService::TestEnum::value_c}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::vector<TestService::TestEnum>>(this->_client, this->_client->build_call("TestService", "EnumListDefault", _args));
}

inline ::krpc::Stream<TestService::TestEnum> TestService::enum_return_stream() {
  return ::krpc::Stream<TestService::TestEnum>(this->_client, this->_client->build_call("TestService", "EnumReturn"));
}

inline ::krpc::Stream<std::vector<float>> TestService::float_special_defaults_stream(float nan = std::numeric_limits<float>::quiet_NaN(), float infinity = std::numeric_limits<float>::infinity(), float negative_infinity = -std::numeric_limits<float>::infinity(), float maximum = (std::numeric_limits<float>::max)(), float lowest = std::numeric_limits<float>::lowest(), float fraction = 0.1f) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(6);
  _args.push_back(encoder::encode_arg(nan));
  _args.push_back(encoder::encode_arg(infinity));
  _args.push_back(encoder::encode_arg(negative_infinity));
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(lowest));
  _args.push_back(encoder::encode_arg(fraction));
  return ::krpc::Stream<std::vector<float>>(this->_client, this->_client->build_call("TestService", "FloatSpecialDefaults", _args));
}

inline ::krpc::Stream<std::string> TestService::float_to_string_stream(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "FloatToString", _args));
}

inline ::krpc::Stream<std::map<std::string, int32_t>> TestService::increment_dictionary_stream(std::map<std::string, int32_t> d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  return ::krpc::Stream<std::map<std::string, int32_t>>(this->_client, this->_client->build_call("TestService", "IncrementDictionary", _args));
}

inline ::krpc::Stream<std::vector<int32_t>> TestService::increment_list_stream(std::vector<int32_t> l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return ::krpc::Stream<std::vector<int32_t>>(this->_client, this->_client->build_call("TestService", "IncrementList", _args));
}

inline ::krpc::Stream<std::vector<TestService::TestStruct>> TestService::increment_list_of_structs_stream(std::vector<TestService::TestStruct> l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return ::krpc::Stream<std::vector<TestService::TestStruct>>(this->_client, this->_client->build_call("TestService", "IncrementListOfStructs", _args));
}

inline ::krpc::Stream<std::map<std::string, std::vector<int32_t> >> TestService::increment_nested_collection_stream(std::map<std::string, std::vector<int32_t> > d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  return ::krpc::Stream<std::map<std::string, std::vector<int32_t> >>(this->_client, this->_client->build_call("TestService", "IncrementNestedCollection", _args));
}

inline ::krpc::Stream<std::set<int32_t>> TestService::increment_set_stream(std::set<int32_t> h) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(h));
  return ::krpc::Stream<std::set<int32_t>>(this->_client, this->_client->build_call("TestService", "IncrementSet", _args));
}

inline ::krpc::Stream<std::tuple<int32_t, int64_t>> TestService::increment_tuple_stream(std::tuple<int32_t, int64_t> t) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(t));
  return ::krpc::Stream<std::tuple<int32_t, int64_t>>(this->_client, this->_client->build_call("TestService", "IncrementTuple", _args));
}

inline ::krpc::Stream<std::vector<int32_t>> TestService::int32_special_defaults_stream(int32_t maximum = (std::numeric_limits<int32_t>::max)(), int32_t minimum = (std::numeric_limits<int32_t>::min)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(minimum));
  return ::krpc::Stream<std::vector<int32_t>>(this->_client, this->_client->build_call("TestService", "Int32SpecialDefaults", _args));
}

inline ::krpc::Stream<std::string> TestService::int32_to_string_stream(int32_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "Int32ToString", _args));
}

inline ::krpc::Stream<std::vector<int64_t>> TestService::int64_special_defaults_stream(int64_t maximum = (std::numeric_limits<int64_t>::max)(), int64_t minimum = (std::numeric_limits<int64_t>::min)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(minimum));
  return ::krpc::Stream<std::vector<int64_t>>(this->_client, this->_client->build_call("TestService", "Int64SpecialDefaults", _args));
}

inline ::krpc::Stream<std::string> TestService::int64_to_string_stream(int64_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "Int64ToString", _args));
}

inline ::krpc::Stream<std::vector<int32_t>> TestService::list_default_stream(std::vector<int32_t> x = std::vector<int32_t>{1, 2, 3}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::vector<int32_t>>(this->_client, this->_client->build_call("TestService", "ListDefault", _args));
}

inline ::krpc::Stream<TestService::TestNestedStruct> TestService::nested_struct_echo_stream(TestService::TestNestedStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<TestService::TestNestedStruct>(this->_client, this->_client->build_call("TestService", "NestedStructEcho", _args));
}

inline ::krpc::Stream<TestService::TestClass> TestService::not_nullable_object_stream(TestService::TestClass value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<TestService::TestClass>(this->_client, this->_client->build_call("TestService", "NotNullableObject", _args));
}

inline ::krpc::Stream<TestService::TestNullableStruct> TestService::nullable_struct_echo_stream(TestService::TestNullableStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<TestService::TestNullableStruct>(this->_client, this->_client->build_call("TestService", "NullableStructEcho", _args));
}

inline ::krpc::Stream<::krpc::Event> TestService::on_timer_stream(uint32_t milliseconds, uint32_t repeats = 1) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(milliseconds));
  _args.push_back(encoder::encode_arg(repeats));
  return ::krpc::Stream<::krpc::Event>(this->_client, this->_client->build_call("TestService", "OnTimer", _args));
}

inline ::krpc::Stream<::krpc::Event> TestService::on_timer_using_lambda_stream(uint32_t milliseconds) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(milliseconds));
  return ::krpc::Stream<::krpc::Event>(this->_client, this->_client->build_call("TestService", "OnTimerUsingLambda", _args));
}

inline ::krpc::Stream<std::string> TestService::optional_arguments_stream(std::string x, std::string y = "foo", std::string z = "bar", std::optional<TestService::TestClass> obj = std::optional<TestService::TestClass>()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(4);
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  _args.push_back(encoder::encode_arg(obj));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "OptionalArguments", _args));
}

inline ::krpc::Stream<::krpc::Event> TestService::remove_event_after_stream(uint32_t milliseconds) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(milliseconds));
  return ::krpc::Stream<::krpc::Event>(this->_client, this->_client->build_call("TestService", "RemoveEventAfter", _args));
}

inline ::krpc::Stream<TestService::TestClass> TestService::return_null_when_not_allowed_stream() {
  return ::krpc::Stream<TestService::TestClass>(this->_client, this->_client->build_call("TestService", "ReturnNullWhenNotAllowed"));
}

inline ::krpc::Stream<std::set<int32_t>> TestService::set_default_stream(std::set<int32_t> x = std::set<int32_t>{1, 2, 3}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::set<int32_t>>(this->_client, this->_client->build_call("TestService", "SetDefault", _args));
}

inline ::krpc::Stream<int32_t> TestService::string_to_int32_stream(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "StringToInt32", _args));
}

inline ::krpc::Stream<TestService::TestStruct> TestService::struct_default_stream(TestService::TestStruct x = TestService::TestStruct{42, "jeb", TestService::TestEnum::value_b, std::vector<int32_t>{1, 2, 3}}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<TestService::TestStruct>(this->_client, this->_client->build_call("TestService", "StructDefault", _args));
}

inline ::krpc::Stream<TestService::TestStruct> TestService::struct_echo_stream(TestService::TestStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<TestService::TestStruct>(this->_client, this->_client->build_call("TestService", "StructEcho", _args));
}

inline ::krpc::Stream<std::optional<TestService::TestStruct>> TestService::struct_echo_nullable_stream(std::optional<TestService::TestStruct> x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::optional<TestService::TestStruct>>(this->_client, this->_client->build_call("TestService", "StructEchoNullable", _args));
}

inline ::krpc::Stream<int32_t> TestService::throw_argument_exception_stream() {
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowArgumentException"));
}

inline ::krpc::Stream<int32_t> TestService::throw_argument_null_exception_stream(std::string foo) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(foo));
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowArgumentNullException", _args));
}

inline ::krpc::Stream<int32_t> TestService::throw_argument_out_of_range_exception_stream(int32_t foo) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(foo));
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowArgumentOutOfRangeException", _args));
}

inline ::krpc::Stream<int32_t> TestService::throw_custom_exception_stream() {
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowCustomException"));
}

inline ::krpc::Stream<int32_t> TestService::throw_custom_exception_later_stream() {
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowCustomExceptionLater"));
}

inline ::krpc::Stream<int32_t> TestService::throw_invalid_operation_exception_stream() {
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowInvalidOperationException"));
}

inline ::krpc::Stream<int32_t> TestService::throw_invalid_operation_exception_later_stream() {
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "ThrowInvalidOperationExceptionLater"));
}

inline ::krpc::Stream<std::tuple<int32_t, bool>> TestService::tuple_default_stream(std::tuple<int32_t, bool> x = std::tuple<int32_t, bool>{1, false}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::tuple<int32_t, bool>>(this->_client, this->_client->build_call("TestService", "TupleDefault", _args));
}

inline ::krpc::Stream<std::vector<uint32_t>> TestService::uint32_special_defaults_stream(uint32_t maximum = (std::numeric_limits<uint32_t>::max)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(maximum));
  return ::krpc::Stream<std::vector<uint32_t>>(this->_client, this->_client->build_call("TestService", "Uint32SpecialDefaults", _args));
}

inline ::krpc::Stream<std::vector<uint64_t>> TestService::uint64_special_defaults_stream(uint64_t maximum = (std::numeric_limits<uint64_t>::max)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(maximum));
  return ::krpc::Stream<std::vector<uint64_t>>(this->_client, this->_client->build_call("TestService", "Uint64SpecialDefaults", _args));
}

inline ::krpc::Stream<std::string> TestService::deprecated_property_stream() {
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "get_DeprecatedProperty"));
}

inline ::krpc::Stream<std::optional<TestService::TestClass>> TestService::nullable_object_stream() {
  return ::krpc::Stream<std::optional<TestService::TestClass>>(this->_client, this->_client->build_call("TestService", "get_NullableObject"));
}

inline ::krpc::Stream<std::optional<TestService::TestClass>> TestService::object_property_stream() {
  return ::krpc::Stream<std::optional<TestService::TestClass>>(this->_client, this->_client->build_call("TestService", "get_ObjectProperty"));
}

inline ::krpc::Stream<std::string> TestService::string_property_stream() {
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "get_StringProperty"));
}

inline ::krpc::Stream<std::string> TestService::string_property_private_set_stream() {
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "get_StringPropertyPrivateSet"));
}

inline ::krpc::schema::ProcedureCall TestService::add_multiple_values_call(float x, int32_t y, int64_t z) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(3);
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  return this->_client->build_call("TestService", "AddMultipleValues", _args);
}

inline ::krpc::schema::ProcedureCall TestService::add_to_object_list_call(std::vector<TestService::TestClass> l, std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(l));
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "AddToObjectList", _args);
}

inline ::krpc::schema::ProcedureCall TestService::blocking_procedure_call(int32_t n, int32_t sum = 0) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(n));
  _args.push_back(encoder::encode_arg(sum));
  return this->_client->build_call("TestService", "BlockingProcedure", _args);
}

inline ::krpc::schema::ProcedureCall TestService::bool_to_string_call(bool value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "BoolToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::bytes_to_hex_string_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "BytesToHexString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::counter_call(std::string id = "", int32_t divisor = 1) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(id));
  _args.push_back(encoder::encode_arg(divisor));
  return this->_client->build_call("TestService", "Counter", _args);
}

inline ::krpc::schema::ProcedureCall TestService::counter_struct_call(std::string id = "") {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(id));
  return this->_client->build_call("TestService", "CounterStruct", _args);
}

inline ::krpc::schema::ProcedureCall TestService::create_test_object_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "CreateTestObject", _args);
}

inline ::krpc::schema::ProcedureCall TestService::deprecated_procedure_call(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "DeprecatedProcedure", _args);
}

inline ::krpc::schema::ProcedureCall TestService::deprecated_procedure_no_message_call(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "DeprecatedProcedureNoMessage", _args);
}

inline ::krpc::schema::ProcedureCall TestService::dictionary_default_call(std::map<int32_t, bool> x = std::map<int32_t, bool>{{1, false}, {2, true}}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "DictionaryDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::double_special_defaults_call(double nan = std::numeric_limits<double>::quiet_NaN(), double infinity = std::numeric_limits<double>::infinity(), double negative_infinity = -std::numeric_limits<double>::infinity(), double maximum = (std::numeric_limits<double>::max)(), double lowest = std::numeric_limits<double>::lowest()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(5);
  _args.push_back(encoder::encode_arg(nan));
  _args.push_back(encoder::encode_arg(infinity));
  _args.push_back(encoder::encode_arg(negative_infinity));
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(lowest));
  return this->_client->build_call("TestService", "DoubleSpecialDefaults", _args);
}

inline ::krpc::schema::ProcedureCall TestService::double_to_string_call(double value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "DoubleToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::dump_expression_tree_call(KRPC::Expression expression) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(expression));
  return this->_client->build_call("TestService", "DumpExpressionTree", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_dictionary_of_nullable_objects_call(std::map<std::string, std::optional<TestService::TestClass> > d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  return this->_client->build_call("TestService", "EchoDictionaryOfNullableObjects", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_list_of_nullable_ints_call(std::vector<std::optional<int32_t> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return this->_client->build_call("TestService", "EchoListOfNullableInts", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_list_of_nullable_objects_call(std::vector<std::optional<TestService::TestClass> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return this->_client->build_call("TestService", "EchoListOfNullableObjects", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_nested_list_of_nullable_objects_call(std::vector<std::vector<std::optional<TestService::TestClass>> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return this->_client->build_call("TestService", "EchoNestedListOfNullableObjects", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_nested_nullable_struct_call(TestService::TestNestedNullableStruct value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "EchoNestedNullableStruct", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_nullable_int_call(std::optional<int32_t> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "EchoNullableInt", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_nullable_list_call(std::optional<std::vector<int32_t> > l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return this->_client->build_call("TestService", "EchoNullableList", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_nullable_string_call(std::optional<std::string> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "EchoNullableString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_test_object_call(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "EchoTestObject", _args);
}

inline ::krpc::schema::ProcedureCall TestService::echo_tuple_with_a_nullable_object_call(std::tuple<int32_t, std::optional<TestService::TestClass> > t) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(t));
  return this->_client->build_call("TestService", "EchoTupleWithANullableObject", _args);
}

inline ::krpc::schema::ProcedureCall TestService::empty_list_default_call(std::vector<std::string> x = std::vector<std::string>{}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "EmptyListDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::enum_default_arg_call(TestService::TestEnum x = TestService::TestEnum::value_c) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "EnumDefaultArg", _args);
}

inline ::krpc::schema::ProcedureCall TestService::enum_echo_call(TestService::TestEnum x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "EnumEcho", _args);
}

inline ::krpc::schema::ProcedureCall TestService::enum_list_default_call(std::vector<TestService::TestEnum> x = std::vector<TestService::TestEnum>{TestService::TestEnum::value_b, TestService::TestEnum::value_c}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "EnumListDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::enum_return_call() {
  return this->_client->build_call("TestService", "EnumReturn");
}

inline ::krpc::schema::ProcedureCall TestService::float_special_defaults_call(float nan = std::numeric_limits<float>::quiet_NaN(), float infinity = std::numeric_limits<float>::infinity(), float negative_infinity = -std::numeric_limits<float>::infinity(), float maximum = (std::numeric_limits<float>::max)(), float lowest = std::numeric_limits<float>::lowest(), float fraction = 0.1f) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(6);
  _args.push_back(encoder::encode_arg(nan));
  _args.push_back(encoder::encode_arg(infinity));
  _args.push_back(encoder::encode_arg(negative_infinity));
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(lowest));
  _args.push_back(encoder::encode_arg(fraction));
  return this->_client->build_call("TestService", "FloatSpecialDefaults", _args);
}

inline ::krpc::schema::ProcedureCall TestService::float_to_string_call(float value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "FloatToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::increment_dictionary_call(std::map<std::string, int32_t> d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  return this->_client->build_call("TestService", "IncrementDictionary", _args);
}

inline ::krpc::schema::ProcedureCall TestService::increment_list_call(std::vector<int32_t> l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return this->_client->build_call("TestService", "IncrementList", _args);
}

inline ::krpc::schema::ProcedureCall TestService::increment_list_of_structs_call(std::vector<TestService::TestStruct> l) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(l));
  return this->_client->build_call("TestService", "IncrementListOfStructs", _args);
}

inline ::krpc::schema::ProcedureCall TestService::increment_nested_collection_call(std::map<std::string, std::vector<int32_t> > d) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(d));
  return this->_client->build_call("TestService", "IncrementNestedCollection", _args);
}

inline ::krpc::schema::ProcedureCall TestService::increment_set_call(std::set<int32_t> h) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(h));
  return this->_client->build_call("TestService", "IncrementSet", _args);
}

inline ::krpc::schema::ProcedureCall TestService::increment_tuple_call(std::tuple<int32_t, int64_t> t) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(t));
  return this->_client->build_call("TestService", "IncrementTuple", _args);
}

inline ::krpc::schema::ProcedureCall TestService::int32_special_defaults_call(int32_t maximum = (std::numeric_limits<int32_t>::max)(), int32_t minimum = (std::numeric_limits<int32_t>::min)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(minimum));
  return this->_client->build_call("TestService", "Int32SpecialDefaults", _args);
}

inline ::krpc::schema::ProcedureCall TestService::int32_to_string_call(int32_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "Int32ToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::int64_special_defaults_call(int64_t maximum = (std::numeric_limits<int64_t>::max)(), int64_t minimum = (std::numeric_limits<int64_t>::min)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(maximum));
  _args.push_back(encoder::encode_arg(minimum));
  return this->_client->build_call("TestService", "Int64SpecialDefaults", _args);
}

inline ::krpc::schema::ProcedureCall TestService::int64_to_string_call(int64_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "Int64ToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::list_default_call(std::vector<int32_t> x = std::vector<int32_t>{1, 2, 3}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "ListDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::nested_struct_echo_call(TestService::TestNestedStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "NestedStructEcho", _args);
}

inline ::krpc::schema::ProcedureCall TestService::not_nullable_object_call(TestService::TestClass value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "NotNullableObject", _args);
}

inline ::krpc::schema::ProcedureCall TestService::nullable_struct_echo_call(TestService::TestNullableStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "NullableStructEcho", _args);
}

inline ::krpc::schema::ProcedureCall TestService::on_timer_call(uint32_t milliseconds, uint32_t repeats = 1) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(milliseconds));
  _args.push_back(encoder::encode_arg(repeats));
  return this->_client->build_call("TestService", "OnTimer", _args);
}

inline ::krpc::schema::ProcedureCall TestService::on_timer_using_lambda_call(uint32_t milliseconds) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(milliseconds));
  return this->_client->build_call("TestService", "OnTimerUsingLambda", _args);
}

inline ::krpc::schema::ProcedureCall TestService::optional_arguments_call(std::string x, std::string y = "foo", std::string z = "bar", std::optional<TestService::TestClass> obj = std::optional<TestService::TestClass>()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(4);
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  _args.push_back(encoder::encode_arg(obj));
  return this->_client->build_call("TestService", "OptionalArguments", _args);
}

inline ::krpc::schema::ProcedureCall TestService::remove_event_after_call(uint32_t milliseconds) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(milliseconds));
  return this->_client->build_call("TestService", "RemoveEventAfter", _args);
}

inline ::krpc::schema::ProcedureCall TestService::reset_custom_exception_later_call() {
  return this->_client->build_call("TestService", "ResetCustomExceptionLater");
}

inline ::krpc::schema::ProcedureCall TestService::reset_invalid_operation_exception_later_call() {
  return this->_client->build_call("TestService", "ResetInvalidOperationExceptionLater");
}

inline ::krpc::schema::ProcedureCall TestService::return_null_when_not_allowed_call() {
  return this->_client->build_call("TestService", "ReturnNullWhenNotAllowed");
}

inline ::krpc::schema::ProcedureCall TestService::set_default_call(std::set<int32_t> x = std::set<int32_t>{1, 2, 3}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "SetDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::string_to_int32_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "StringToInt32", _args);
}

inline ::krpc::schema::ProcedureCall TestService::struct_default_call(TestService::TestStruct x = TestService::TestStruct{42, "jeb", TestService::TestEnum::value_b, std::vector<int32_t>{1, 2, 3}}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "StructDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::struct_echo_call(TestService::TestStruct x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "StructEcho", _args);
}

inline ::krpc::schema::ProcedureCall TestService::struct_echo_nullable_call(std::optional<TestService::TestStruct> x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "StructEchoNullable", _args);
}

inline ::krpc::schema::ProcedureCall TestService::throw_argument_exception_call() {
  return this->_client->build_call("TestService", "ThrowArgumentException");
}

inline ::krpc::schema::ProcedureCall TestService::throw_argument_null_exception_call(std::string foo) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(foo));
  return this->_client->build_call("TestService", "ThrowArgumentNullException", _args);
}

inline ::krpc::schema::ProcedureCall TestService::throw_argument_out_of_range_exception_call(int32_t foo) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(foo));
  return this->_client->build_call("TestService", "ThrowArgumentOutOfRangeException", _args);
}

inline ::krpc::schema::ProcedureCall TestService::throw_custom_exception_call() {
  return this->_client->build_call("TestService", "ThrowCustomException");
}

inline ::krpc::schema::ProcedureCall TestService::throw_custom_exception_later_call() {
  return this->_client->build_call("TestService", "ThrowCustomExceptionLater");
}

inline ::krpc::schema::ProcedureCall TestService::throw_invalid_operation_exception_call() {
  return this->_client->build_call("TestService", "ThrowInvalidOperationException");
}

inline ::krpc::schema::ProcedureCall TestService::throw_invalid_operation_exception_later_call() {
  return this->_client->build_call("TestService", "ThrowInvalidOperationExceptionLater");
}

inline ::krpc::schema::ProcedureCall TestService::tuple_default_call(std::tuple<int32_t, bool> x = std::tuple<int32_t, bool>{1, false}) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "TupleDefault", _args);
}

inline ::krpc::schema::ProcedureCall TestService::uint32_special_defaults_call(uint32_t maximum = (std::numeric_limits<uint32_t>::max)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(maximum));
  return this->_client->build_call("TestService", "Uint32SpecialDefaults", _args);
}

inline ::krpc::schema::ProcedureCall TestService::uint64_special_defaults_call(uint64_t maximum = (std::numeric_limits<uint64_t>::max)()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(maximum));
  return this->_client->build_call("TestService", "Uint64SpecialDefaults", _args);
}

inline ::krpc::schema::ProcedureCall TestService::deprecated_property_call() {
  return this->_client->build_call("TestService", "get_DeprecatedProperty");
}

inline ::krpc::schema::ProcedureCall TestService::set_deprecated_property_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "set_DeprecatedProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::nullable_object_call() {
  return this->_client->build_call("TestService", "get_NullableObject");
}

inline ::krpc::schema::ProcedureCall TestService::set_nullable_object_call(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "set_NullableObject", _args);
}

inline ::krpc::schema::ProcedureCall TestService::object_property_call() {
  return this->_client->build_call("TestService", "get_ObjectProperty");
}

inline ::krpc::schema::ProcedureCall TestService::set_object_property_call(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "set_ObjectProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::string_property_call() {
  return this->_client->build_call("TestService", "get_StringProperty");
}

inline ::krpc::schema::ProcedureCall TestService::set_string_property_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "set_StringProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::set_string_property_private_get_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "set_StringPropertyPrivateGet", _args);
}

inline ::krpc::schema::ProcedureCall TestService::string_property_private_set_call() {
  return this->_client->build_call("TestService", "get_StringPropertyPrivateSet");
}

inline TestService::DeprecatedClass::DeprecatedClass(Client* client, uint64_t id):
  Object(client, "TestService::DeprecatedClass", id) {}

inline std::string TestService::DeprecatedClass::deprecated_method() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  auto _data = this->_client->invoke("TestService", "DeprecatedClass_DeprecatedMethod", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline ::krpc::Stream<std::string> TestService::DeprecatedClass::deprecated_method_stream() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "DeprecatedClass_DeprecatedMethod", _args));
}

inline ::krpc::schema::ProcedureCall TestService::DeprecatedClass::deprecated_method_call() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return this->_client->build_call("TestService", "DeprecatedClass_DeprecatedMethod", _args);
}

inline TestService::TestClass::TestClass(Client* client, uint64_t id):
  Object(client, "TestService::TestClass", id) {}

inline std::optional<TestService::TestClass> TestService::TestClass::echo_nullable_object(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  auto _data = this->_client->invoke("TestService", "TestClass_EchoNullableObject", _args, ::krpc::Client::Returns::value);
  std::optional<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::TestClass::float_to_string(float x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(x));
  auto _data = this->_client->invoke("TestService", "TestClass_FloatToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::TestClass::get_value() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  auto _data = this->_client->invoke("TestService", "TestClass_GetValue", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::TestClass::object_to_string(std::optional<TestService::TestClass> other) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(other));
  auto _data = this->_client->invoke("TestService", "TestClass_ObjectToString", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::TestClass::optional_arguments(std::string x, std::string y = "foo", std::string z = "bar", std::optional<TestService::TestClass> obj = std::optional<TestService::TestClass>()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(5);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  _args.push_back(encoder::encode_arg(obj));
  auto _data = this->_client->invoke("TestService", "TestClass_OptionalArguments", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline int32_t TestService::TestClass::int_property() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  auto _data = this->_client->invoke("TestService", "TestClass_get_IntProperty", _args, ::krpc::Client::Returns::value);
  int32_t _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::TestClass::set_int_property(int32_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "TestClass_set_IntProperty", _args, ::krpc::Client::Returns::value);
}

inline std::optional<TestService::TestClass> TestService::TestClass::object_property() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  auto _data = this->_client->invoke("TestService", "TestClass_get_ObjectProperty", _args, ::krpc::Client::Returns::value);
  std::optional<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline void TestService::TestClass::set_object_property(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "TestClass_set_ObjectProperty", _args, ::krpc::Client::Returns::value);
}

inline void TestService::TestClass::set_string_property_private_get(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  this->_client->invoke("TestService", "TestClass_set_StringPropertyPrivateGet", _args, ::krpc::Client::Returns::value);
}

inline std::string TestService::TestClass::string_property_private_set() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  auto _data = this->_client->invoke("TestService", "TestClass_get_StringPropertyPrivateSet", _args, ::krpc::Client::Returns::value);
  std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), this->_client);
  return _result;
}

inline std::string TestService::TestClass::static_method(Client& _client, std::string a = "", std::string b = "") {
    std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(a));
  _args.push_back(encoder::encode_arg(b));
  auto _data = _client.invoke("TestService", "TestClass_static_StaticMethod", _args, ::krpc::Client::Returns::value);
    std::string _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), &_client);
  return _result;
}

inline std::optional<TestService::TestClass> TestService::TestClass::static_nullable_object(Client& _client, std::optional<TestService::TestClass> value) {
    std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  auto _data = _client.invoke("TestService", "TestClass_static_StaticNullableObject", _args, ::krpc::Client::Returns::value);
    std::optional<TestService::TestClass> _result{};
  if (!_data.is_null())
    decoder::decode(_result, _data.value(), &_client);
  return _result;
}

inline ::krpc::Stream<std::optional<TestService::TestClass>> TestService::TestClass::echo_nullable_object_stream(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::optional<TestService::TestClass>>(this->_client, this->_client->build_call("TestService", "TestClass_EchoNullableObject", _args));
}

inline ::krpc::Stream<std::string> TestService::TestClass::float_to_string_stream(float x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(x));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "TestClass_FloatToString", _args));
}

inline ::krpc::Stream<std::string> TestService::TestClass::get_value_stream() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "TestClass_GetValue", _args));
}

inline ::krpc::Stream<std::string> TestService::TestClass::object_to_string_stream(std::optional<TestService::TestClass> other) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(other));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "TestClass_ObjectToString", _args));
}

inline ::krpc::Stream<std::string> TestService::TestClass::optional_arguments_stream(std::string x, std::string y = "foo", std::string z = "bar", std::optional<TestService::TestClass> obj = std::optional<TestService::TestClass>()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(5);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  _args.push_back(encoder::encode_arg(obj));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "TestClass_OptionalArguments", _args));
}

inline ::krpc::Stream<int32_t> TestService::TestClass::int_property_stream() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return ::krpc::Stream<int32_t>(this->_client, this->_client->build_call("TestService", "TestClass_get_IntProperty", _args));
}

inline ::krpc::Stream<std::optional<TestService::TestClass>> TestService::TestClass::object_property_stream() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return ::krpc::Stream<std::optional<TestService::TestClass>>(this->_client, this->_client->build_call("TestService", "TestClass_get_ObjectProperty", _args));
}

inline ::krpc::Stream<std::string> TestService::TestClass::string_property_private_set_stream() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return ::krpc::Stream<std::string>(this->_client, this->_client->build_call("TestService", "TestClass_get_StringPropertyPrivateSet", _args));
}

inline ::krpc::Stream<std::string> TestService::TestClass::static_method_stream(Client& _client, std::string a = "", std::string b = "") {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(a));
  _args.push_back(encoder::encode_arg(b));
  return ::krpc::Stream<std::string>(&_client, _client.build_call("TestService", "TestClass_static_StaticMethod", _args));
}

inline ::krpc::Stream<std::optional<TestService::TestClass>> TestService::TestClass::static_nullable_object_stream(Client& _client, std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return ::krpc::Stream<std::optional<TestService::TestClass>>(&_client, _client.build_call("TestService", "TestClass_static_StaticNullableObject", _args));
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::echo_nullable_object_call(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "TestClass_EchoNullableObject", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::float_to_string_call(float x) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(x));
  return this->_client->build_call("TestService", "TestClass_FloatToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::get_value_call() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return this->_client->build_call("TestService", "TestClass_GetValue", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::object_to_string_call(std::optional<TestService::TestClass> other) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(other));
  return this->_client->build_call("TestService", "TestClass_ObjectToString", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::optional_arguments_call(std::string x, std::string y = "foo", std::string z = "bar", std::optional<TestService::TestClass> obj = std::optional<TestService::TestClass>()) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(5);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(x));
  _args.push_back(encoder::encode_arg(y));
  _args.push_back(encoder::encode_arg(z));
  _args.push_back(encoder::encode_arg(obj));
  return this->_client->build_call("TestService", "TestClass_OptionalArguments", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::int_property_call() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return this->_client->build_call("TestService", "TestClass_get_IntProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::set_int_property_call(int32_t value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "TestClass_set_IntProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::object_property_call() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return this->_client->build_call("TestService", "TestClass_get_ObjectProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::set_object_property_call(std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "TestClass_set_ObjectProperty", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::set_string_property_private_get_call(std::string value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(*this));
  _args.push_back(encoder::encode_arg(value));
  return this->_client->build_call("TestService", "TestClass_set_StringPropertyPrivateGet", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::string_property_private_set_call() {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(*this));
  return this->_client->build_call("TestService", "TestClass_get_StringPropertyPrivateSet", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::static_method_call(Client& _client, std::string a = "", std::string b = "") {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(2);
  _args.push_back(encoder::encode_arg(a));
  _args.push_back(encoder::encode_arg(b));
  return _client.build_call("TestService", "TestClass_static_StaticMethod", _args);
}

inline ::krpc::schema::ProcedureCall TestService::TestClass::static_nullable_object_call(Client& _client, std::optional<TestService::TestClass> value) {
  std::vector<krpc::encoder::Value> _args;
  _args.reserve(1);
  _args.push_back(encoder::encode_arg(value));
  return _client.build_call("TestService", "TestClass_static_StaticNullableObject", _args);
}
}  // namespace services

}  // namespace krpc

// A structure is a type of this program's own, so unlike a tuple it can be given a std::hash,
// and an unordered container of one needs nothing further.
namespace std {

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
template <>
struct hash<krpc::services::TestService::DeprecatedStruct> {
  std::size_t operator()(const krpc::services::TestService::DeprecatedStruct& value) const {
    return krpc::hash_value(value);
  }
};
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

template <>
struct hash<krpc::services::TestService::TestNestedNullableStruct> {
  std::size_t operator()(const krpc::services::TestService::TestNestedNullableStruct& value) const {
    return krpc::hash_value(value);
  }
};

template <>
struct hash<krpc::services::TestService::TestStruct> {
  std::size_t operator()(const krpc::services::TestService::TestStruct& value) const {
    return krpc::hash_value(value);
  }
};

template <>
struct hash<krpc::services::TestService::TestNestedStruct> {
  std::size_t operator()(const krpc::services::TestService::TestNestedStruct& value) const {
    return krpc::hash_value(value);
  }
};

template <>
struct hash<krpc::services::TestService::TestNullableStruct> {
  std::size_t operator()(const krpc::services::TestService::TestNullableStruct& value) const {
    return krpc::hash_value(value);
  }
};

}  // namespace std
