// This is a generated file, modify: generate/templates/templates/struct_header.h

// generated from struct_header.h
#ifndef GITREBASEOPTIONS_H
#define GITREBASEOPTIONS_H
#include <nan.h>
#include <string>
#include <utility>

#include "async_baton.h"
#include "async_worker.h"
#include "callback_wrapper.h"
#include "context.h"
#include "reference_counter.h"
#include "nodegit_wrapper.h"
#include "configurable_class_wrapper.h"
#include "v8_helpers.h"

extern "C" {
  #include <git2.h>
 }

  #include "../include/checkout_options.h"
  #include "../include/merge_options.h"
  #include "../include/buf.h"
 
using namespace node;
using namespace v8;

class GitRebaseOptions;
class ConfigurableGitRebaseOptions;
 
struct GitRebaseOptionsTraits {
  typedef GitRebaseOptions cppClass;
  typedef git_rebase_options cType;
  typedef ConfigurableGitRebaseOptions configurableCppClass;
 
  static const bool isDuplicable = false;
  static void duplicate(git_rebase_options **dest, git_rebase_options *src) {
     Nan::ThrowError("duplicate called on GitRebaseOptions which cannot be duplicated");
   }

  static std::string className() { return "GitRebaseOptions"; };
  static const bool isSingleton = false;
  static const bool isFreeable = true;
  static void free(git_rebase_options *raw) {
    unsigned long referenceCount = 0;
     if (referenceCount == 0) {
      ::free(raw); // :: to avoid calling this free recursively
    }
   }
};
  
class ConfigurableGitRebaseOptions : public nodegit::ConfigurableClassWrapper<GitRebaseOptionsTraits> {
  friend class nodegit::ConfigurableClassWrapper<GitRebaseOptionsTraits>;

public:
  static v8ConversionResult fromJavascript(nodegit::Context *nodegitContext, v8::Local<v8::Value> input);
  ~ConfigurableGitRebaseOptions();

  ConfigurableGitRebaseOptions(const ConfigurableGitRebaseOptions &) = delete;
  ConfigurableGitRebaseOptions(ConfigurableGitRebaseOptions &&) = delete;
  ConfigurableGitRebaseOptions &operator=(const ConfigurableGitRebaseOptions &) = delete;
  ConfigurableGitRebaseOptions &operator=(ConfigurableGitRebaseOptions &&) = delete;

                  static int signingCb_cppCallback (
            git_buf * signature
              ,
             git_buf * signature_field
              ,
             const char * commit_content
              ,
             void * payload
          );

        static void signingCb_cancelAsync(void *baton);
        static void signingCb_async(void *baton);
        static void signingCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class SigningCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              git_buf * signature;
              git_buf * signature_field;
              const char * commit_content;
              void * payload;
 
            SigningCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitRebaseOptions * signingCb_getInstanceFromBaton (
          SigningCbBaton *baton);
       
private:
  ConfigurableGitRebaseOptions(nodegit::Context *nodegitContext);
  ConfigurableGitRebaseOptions() = delete;
  Nan::Global<Value> promiseError;

                         CallbackWrapper signingCb;
          
};

#endif
