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