|
| 1 | +#include "IGateway.h" |
| 2 | +#include "Transport/Transport.h" |
| 3 | + |
| 4 | +class IGatewayMock : public IGateway |
| 5 | +{ |
| 6 | +public: |
| 7 | + |
| 8 | + FireboltSDK::Transport<WPEFramework::Core::JSON::IElement> *transport; |
| 9 | + |
| 10 | + template <typename RESPONSE> |
| 11 | + Firebolt::Error RequestImpl(const std::string &method, const JsonObject ¶meters, RESPONSE &response) |
| 12 | + { |
| 13 | + if (transport == nullptr) |
| 14 | + { |
| 15 | + return Firebolt::Error::NotConnected; |
| 16 | + } |
| 17 | + return transport->Invoke(method, parameters, response); |
| 18 | + } |
| 19 | + |
| 20 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, FireboltSDK::JSON::String &response) |
| 21 | + { |
| 22 | + return RequestImpl(method, parameters, response); |
| 23 | + } |
| 24 | + |
| 25 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Authentication::JsonData_Token &response) |
| 26 | + { |
| 27 | + return RequestImpl(method, parameters, response); |
| 28 | + } |
| 29 | + |
| 30 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Advertising::JsonData_AdvertisingId &response) |
| 31 | + { |
| 32 | + return RequestImpl(method, parameters, response); |
| 33 | + } |
| 34 | + |
| 35 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Advertising::JsonData_AdFrameworkConfig &response) |
| 36 | + { |
| 37 | + return RequestImpl(method, parameters, response); |
| 38 | + } |
| 39 | + |
| 40 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Advertising::JsonData_DeviceAttributes &response) |
| 41 | + { |
| 42 | + return RequestImpl(method, parameters, response); |
| 43 | + } |
| 44 | + |
| 45 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, WPEFramework::Core::JSON::Boolean &response) |
| 46 | + { |
| 47 | + return RequestImpl(method, parameters, response); |
| 48 | + } |
| 49 | + |
| 50 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Accessibility::JsonData_ClosedCaptionsSettings &response) |
| 51 | + { |
| 52 | + return RequestImpl(method, parameters, response); |
| 53 | + } |
| 54 | + |
| 55 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Accessibility::JsonData_VoiceGuidanceSettings &response) |
| 56 | + { |
| 57 | + return RequestImpl(method, parameters, response); |
| 58 | + } |
| 59 | + |
| 60 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Advertising::JsonData_AdPolicy &response) |
| 61 | + { |
| 62 | + return RequestImpl(method, parameters, response); |
| 63 | + } |
| 64 | + |
| 65 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Accessibility::JsonData_AudioDescriptionSettings &response) |
| 66 | + { |
| 67 | + return RequestImpl(method, parameters, response); |
| 68 | + } |
| 69 | + |
| 70 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, WPEFramework::Core::JSON::ArrayType<Firebolt::Capabilities::JsonData_CapabilityInfo> &response) |
| 71 | + { |
| 72 | + return RequestImpl(method, parameters, response); |
| 73 | + } |
| 74 | + |
| 75 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Device::JsonData_AudioProfiles &response) |
| 76 | + { |
| 77 | + return RequestImpl(method, parameters, response); |
| 78 | + } |
| 79 | + |
| 80 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Device::JsonData_HDCPVersionMap &response) |
| 81 | + { |
| 82 | + return RequestImpl(method, parameters, response); |
| 83 | + } |
| 84 | + |
| 85 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Device::JsonData_HDRFormatMap &response) |
| 86 | + { |
| 87 | + return RequestImpl(method, parameters, response); |
| 88 | + } |
| 89 | + |
| 90 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Device::JsonData_NetworkInfoResult &response) |
| 91 | + { |
| 92 | + return RequestImpl(method, parameters, response); |
| 93 | + } |
| 94 | + |
| 95 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Device::JsonData_Resolution &response) |
| 96 | + { |
| 97 | + return RequestImpl(method, parameters, response); |
| 98 | + } |
| 99 | + |
| 100 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Device::JsonData_DeviceVersion &response) |
| 101 | + { |
| 102 | + return RequestImpl(method, parameters, response); |
| 103 | + } |
| 104 | + |
| 105 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, WPEFramework::Core::JSON::VariantContainer &response) |
| 106 | + { |
| 107 | + return RequestImpl(method, parameters, response); |
| 108 | + } |
| 109 | + |
| 110 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Discovery::JsonData_DiscoveryPolicy &response) |
| 111 | + { |
| 112 | + return RequestImpl(method, parameters, response); |
| 113 | + } |
| 114 | + |
| 115 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Localization::JsonData_Info &response) |
| 116 | + { |
| 117 | + return RequestImpl(method, parameters, response); |
| 118 | + } |
| 119 | + |
| 120 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Localization::JsonData_LatLon &response) |
| 121 | + { |
| 122 | + return RequestImpl(method, parameters, response); |
| 123 | + } |
| 124 | + |
| 125 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Parameters::JsonData_AppInitialization &response) |
| 126 | + { |
| 127 | + return RequestImpl(method, parameters, response); |
| 128 | + } |
| 129 | + |
| 130 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Types::JsonData_FlatMap &response) |
| 131 | + { |
| 132 | + return RequestImpl(method, parameters, response); |
| 133 | + } |
| 134 | + |
| 135 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, Firebolt::Types::JsonData_BooleanMap &response) |
| 136 | + { |
| 137 | + return RequestImpl(method, parameters, response); |
| 138 | + } |
| 139 | + |
| 140 | + Firebolt::Error Request(const std::string &method, const JsonObject ¶meters, WPEFramework::Core::JSON::ArrayType<FireboltSDK::JSON::String> &response) |
| 141 | + { |
| 142 | + return RequestImpl(method, parameters, response); |
| 143 | + } |
| 144 | +}; |
0 commit comments