build(tgbot-gen): Changes and additions required to generate the API client with auth (cookie)
I use a standard set of templates, changes are made in api-header.mustache and api-source.mustache. Their _old versions contain the originals. Additions are necessary for the header argument in the generated functions so that you can authenticate using cookies.
This commit is contained in:
parent
ba4dfec459
commit
20cf8b1fc2
32 changed files with 4213 additions and 0 deletions
41
api/_build/my-cpp-templates/cpp-restsdk/api-gmock.mustache
Normal file
41
api/_build/my-cpp-templates/cpp-restsdk/api-gmock.mustache
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{{>licenseInfo}}
|
||||
{{#operations}}
|
||||
#ifndef {{apiHeaderGuardPrefix}}_{{classname}}GMock_H_
|
||||
#define {{apiHeaderGuardPrefix}}_{{classname}}GMock_H_
|
||||
|
||||
#include <gmock/gmock.h>
|
||||
|
||||
#include "{{classname}}.h"
|
||||
|
||||
{{#apiNamespaceDeclarations}}
|
||||
namespace {{this}} {
|
||||
{{/apiNamespaceDeclarations}}
|
||||
|
||||
using namespace {{modelNamespace}};
|
||||
|
||||
|
||||
class {{declspec}} {{classname}}Mock : public I{{classname}}
|
||||
{
|
||||
public:
|
||||
using Base = I{{classname}};
|
||||
|
||||
{{classname}}Mock() = default;
|
||||
explicit {{classname}}Mock( std::shared_ptr<ApiClient> apiClient ) { };
|
||||
~{{classname}}Mock() override = default;
|
||||
|
||||
{{#operation}}
|
||||
MOCK_METHOD{{allParams.size}}( {{operationId}}, pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> (
|
||||
{{#allParams}}
|
||||
{{^required}}boost::optional<{{/required}}{{#isFile}}std::shared_ptr<{{/isFile}}{{{dataType}}}{{#isFile}}>{{/isFile}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}}
|
||||
{{/allParams}}
|
||||
) );
|
||||
{{/operation}}
|
||||
};
|
||||
|
||||
{{#apiNamespaceDeclarations}}
|
||||
}
|
||||
{{/apiNamespaceDeclarations}}
|
||||
|
||||
#endif /* {{apiHeaderGuardPrefix}}_{{classname}}GMock_H_ */
|
||||
|
||||
{{/operations}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue