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

// generated from struct_header.h
#ifndef GITSTASHAPPLYOPTIONS_H
#define GITSTASHAPPLYOPTIONS_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"
 
using namespace node;
using namespace v8;

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

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

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

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

              static int progressCb_cppCallback (
            git_stash_apply_progress_t progress
              ,
             void * payload
          );

        static void progressCb_cancelAsync(void *baton);
        static void progressCb_async(void *baton);
        static void progressCb_promiseCompleted(bool isFulfilled, nodegit::AsyncBaton *_baton, v8::Local<v8::Value> result);
           class ProgressCbBaton : public nodegit::AsyncBatonWithResult<int> {
          public:
              git_stash_apply_progress_t progress;
              void * payload;
 
            ProgressCbBaton(const int &defaultResult)
              : nodegit::AsyncBatonWithResult<int>(defaultResult) {
              }
          };
         static ConfigurableGitStashApplyOptions * progressCb_getInstanceFromBaton (
          ProgressCbBaton *baton);
     
private:
  ConfigurableGitStashApplyOptions(nodegit::Context *nodegitContext);
  ConfigurableGitStashApplyOptions() = delete;
  Nan::Global<Value> promiseError;

                   CallbackWrapper progressCb;
       
};

#endif
