// Copyright (c) The NodeRT Contributors
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may
// not use this file except in compliance with the License. You may obtain a
// copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.

// TODO: Verify that this is is still needed..
#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include "nan.h"
#include <string>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using v8::Array;
using v8::String;
using v8::Value;
using v8::Boolean;
using v8::Integer;
using v8::FunctionTemplate;
using v8::Object;
using v8::Local;
using v8::Function;
using v8::Date;
using v8::Number;
using v8::PropertyAttribute;
using v8::Primitive;
using Nan::HandleScope;
using Nan::Persistent;
using Nan::Undefined;
using Nan::True;
using Nan::False;
using Nan::Null;
using Nan::MaybeLocal;
using Nan::EscapableHandleScope;
using Nan::HandleScope;
using Nan::TryCatch;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace ApplicationModel { namespace Email { namespace DataProvider { 
  v8::Local<v8::Value> WrapEmailDataProviderConnection(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ UnwrapEmailDataProviderConnection(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailDataProviderTriggerDetails(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ UnwrapEmailDataProviderTriggerDetails(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxCreateFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ UnwrapEmailMailboxCreateFolderRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxCreateFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ UnwrapEmailMailboxCreateFolderRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxDeleteFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ UnwrapEmailMailboxDeleteFolderRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxDeleteFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ UnwrapEmailMailboxDeleteFolderRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxDownloadAttachmentRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ UnwrapEmailMailboxDownloadAttachmentRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxDownloadAttachmentRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ UnwrapEmailMailboxDownloadAttachmentRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxDownloadMessageRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ UnwrapEmailMailboxDownloadMessageRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxDownloadMessageRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ UnwrapEmailMailboxDownloadMessageRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxEmptyFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ UnwrapEmailMailboxEmptyFolderRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxEmptyFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ UnwrapEmailMailboxEmptyFolderRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxForwardMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ UnwrapEmailMailboxForwardMeetingRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxForwardMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ UnwrapEmailMailboxForwardMeetingRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxGetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ UnwrapEmailMailboxGetAutoReplySettingsRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxGetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ UnwrapEmailMailboxGetAutoReplySettingsRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxMoveFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ UnwrapEmailMailboxMoveFolderRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxMoveFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ UnwrapEmailMailboxMoveFolderRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxProposeNewTimeForMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ UnwrapEmailMailboxProposeNewTimeForMeetingRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ UnwrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxResolveRecipientsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ UnwrapEmailMailboxResolveRecipientsRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxResolveRecipientsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ UnwrapEmailMailboxResolveRecipientsRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxServerSearchReadBatchRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ UnwrapEmailMailboxServerSearchReadBatchRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxServerSearchReadBatchRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ UnwrapEmailMailboxServerSearchReadBatchRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxSetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ UnwrapEmailMailboxSetAutoReplySettingsRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxSetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ UnwrapEmailMailboxSetAutoReplySettingsRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxSyncManagerSyncRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ UnwrapEmailMailboxSyncManagerSyncRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxSyncManagerSyncRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ UnwrapEmailMailboxSyncManagerSyncRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxUpdateMeetingResponseRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ UnwrapEmailMailboxUpdateMeetingResponseRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxUpdateMeetingResponseRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ UnwrapEmailMailboxUpdateMeetingResponseRequestEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxValidateCertificatesRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ UnwrapEmailMailboxValidateCertificatesRequest(Local<Value> value);
  
  v8::Local<v8::Value> WrapEmailMailboxValidateCertificatesRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ wintRtInstance);
  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ UnwrapEmailMailboxValidateCertificatesRequestEventArgs(Local<Value> value);
  





  class EmailDataProviderConnection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailDataProviderConnection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "start", Start);
          


          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);


        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailDataProviderConnection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailDataProviderConnection(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailDataProviderConnection *wrapperInstance = new EmailDataProviderConnection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailDataProviderConnection(winRtInstance));
    }


    static void Start(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This())) {
        return;
      }

      EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Start();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"createFolderRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->CreateFolderRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxCreateFolderRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"deleteFolderRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->DeleteFolderRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxDeleteFolderRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"downloadAttachmentRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->DownloadAttachmentRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxDownloadAttachmentRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"downloadMessageRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->DownloadMessageRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxDownloadMessageRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"emptyFolderRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->EmptyFolderRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxEmptyFolderRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"forwardMeetingRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ForwardMeetingRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxForwardMeetingRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"getAutoReplySettingsRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->GetAutoReplySettingsRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxGetAutoReplySettingsRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"mailboxSyncRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->MailboxSyncRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxSyncManagerSyncRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"moveFolderRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->MoveFolderRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxMoveFolderRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"proposeNewTimeForMeetingRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ProposeNewTimeForMeetingRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"resolveRecipientsRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ResolveRecipientsRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxResolveRecipientsRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"serverSearchReadBatchRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ServerSearchReadBatchRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxServerSearchReadBatchRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"setAutoReplySettingsRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->SetAutoReplySettingsRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxSetAutoReplySettingsRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"updateMeetingResponseRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->UpdateMeetingResponseRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxUpdateMeetingResponseRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"validateCertificatesRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ValidateCertificatesRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^>(
            [callbackObjPtr](::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ arg0, ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapEmailDataProviderConnection(arg0);
                  wrappedArg1 = WrapEmailMailboxValidateCertificatesRequestEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"createFolderRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"deleteFolderRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"downloadAttachmentRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"downloadMessageRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"emptyFolderRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"forwardMeetingRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"getAutoReplySettingsRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"mailboxSyncRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"moveFolderRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"proposeNewTimeForMeetingRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"resolveRecipientsRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"serverSearchReadBatchRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"setAutoReplySettingsRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"updateMeetingResponseRequested", str)) &&(!NodeRT::Utils::CaseInsenstiveEquals(L"validateCertificatesRequested", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"createFolderRequested", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->CreateFolderRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"deleteFolderRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->DeleteFolderRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"downloadAttachmentRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->DownloadAttachmentRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"downloadMessageRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->DownloadMessageRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"emptyFolderRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->EmptyFolderRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"forwardMeetingRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->ForwardMeetingRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"getAutoReplySettingsRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->GetAutoReplySettingsRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"mailboxSyncRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->MailboxSyncRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"moveFolderRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->MoveFolderRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"proposeNewTimeForMeetingRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->ProposeNewTimeForMeetingRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"resolveRecipientsRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->ResolveRecipientsRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"serverSearchReadBatchRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->ServerSearchReadBatchRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"setAutoReplySettingsRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->SetAutoReplySettingsRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"updateMeetingResponseRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->UpdateMeetingResponseRequested::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"validateCertificatesRequested", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          EmailDataProviderConnection *wrapper = EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(info.This());
          wrapper->_instance->ValidateCertificatesRequested::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailDataProviderConnection(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ UnwrapEmailDataProviderConnection(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailDataProviderConnection::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailDataProviderConnection(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailDataProviderConnection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ UnwrapEmailDataProviderConnection(Local<Value> value) {
     return EmailDataProviderConnection::Unwrap<EmailDataProviderConnection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailDataProviderConnection(Local<Object> exports) {
    EmailDataProviderConnection::Init(exports);
  }

  class EmailDataProviderTriggerDetails : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailDataProviderTriggerDetails").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("connection").ToLocalChecked(), ConnectionGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailDataProviderTriggerDetails").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailDataProviderTriggerDetails(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailDataProviderTriggerDetails *wrapperInstance = new EmailDataProviderTriggerDetails(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailDataProviderTriggerDetails(winRtInstance));
    }





    static void ConnectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^>(info.This())) {
        return;
      }

      EmailDataProviderTriggerDetails *wrapper = EmailDataProviderTriggerDetails::Unwrap<EmailDataProviderTriggerDetails>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderConnection^ result = wrapper->_instance->Connection;
        info.GetReturnValue().Set(WrapEmailDataProviderConnection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailDataProviderTriggerDetails(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ UnwrapEmailDataProviderTriggerDetails(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailDataProviderTriggerDetails::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailDataProviderTriggerDetails(::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailDataProviderTriggerDetails::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailDataProviderTriggerDetails^ UnwrapEmailDataProviderTriggerDetails(Local<Value> value) {
     return EmailDataProviderTriggerDetails::Unwrap<EmailDataProviderTriggerDetails>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailDataProviderTriggerDetails(Local<Object> exports) {
    EmailDataProviderTriggerDetails::Init(exports);
  }

  class EmailMailboxCreateFolderRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxCreateFolderRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("name").ToLocalChecked(), NameGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parentFolderId").ToLocalChecked(), ParentFolderIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxCreateFolderRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxCreateFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxCreateFolderRequest *wrapperInstance = new EmailMailboxCreateFolderRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxCreateFolderRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxCreateFolderRequest *wrapper = EmailMailboxCreateFolderRequest::Unwrap<EmailMailboxCreateFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::EmailFolder^>(info[0]))
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailFolder^ arg0 = dynamic_cast<::Windows::ApplicationModel::Email::EmailFolder^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          op = wrapper->_instance->ReportCompletedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxCreateFolderRequest *wrapper = EmailMailboxCreateFolderRequest::Unwrap<EmailMailboxCreateFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailMailboxCreateFolderStatus arg0 = static_cast<::Windows::ApplicationModel::Email::EmailMailboxCreateFolderStatus>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          op = wrapper->_instance->ReportFailedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxCreateFolderRequest *wrapper = EmailMailboxCreateFolderRequest::Unwrap<EmailMailboxCreateFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NameGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxCreateFolderRequest *wrapper = EmailMailboxCreateFolderRequest::Unwrap<EmailMailboxCreateFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Name;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ParentFolderIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxCreateFolderRequest *wrapper = EmailMailboxCreateFolderRequest::Unwrap<EmailMailboxCreateFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->ParentFolderId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxCreateFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ UnwrapEmailMailboxCreateFolderRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxCreateFolderRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxCreateFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxCreateFolderRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ UnwrapEmailMailboxCreateFolderRequest(Local<Value> value) {
     return EmailMailboxCreateFolderRequest::Unwrap<EmailMailboxCreateFolderRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxCreateFolderRequest(Local<Object> exports) {
    EmailMailboxCreateFolderRequest::Init(exports);
  }

  class EmailMailboxCreateFolderRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxCreateFolderRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxCreateFolderRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxCreateFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxCreateFolderRequestEventArgs *wrapperInstance = new EmailMailboxCreateFolderRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxCreateFolderRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxCreateFolderRequestEventArgs *wrapper = EmailMailboxCreateFolderRequestEventArgs::Unwrap<EmailMailboxCreateFolderRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxCreateFolderRequestEventArgs *wrapper = EmailMailboxCreateFolderRequestEventArgs::Unwrap<EmailMailboxCreateFolderRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxCreateFolderRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxCreateFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ UnwrapEmailMailboxCreateFolderRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxCreateFolderRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxCreateFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxCreateFolderRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxCreateFolderRequestEventArgs^ UnwrapEmailMailboxCreateFolderRequestEventArgs(Local<Value> value) {
     return EmailMailboxCreateFolderRequestEventArgs::Unwrap<EmailMailboxCreateFolderRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxCreateFolderRequestEventArgs(Local<Object> exports) {
    EmailMailboxCreateFolderRequestEventArgs::Init(exports);
  }

  class EmailMailboxDeleteFolderRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxDeleteFolderRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailFolderId").ToLocalChecked(), EmailFolderIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxDeleteFolderRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxDeleteFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxDeleteFolderRequest *wrapperInstance = new EmailMailboxDeleteFolderRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxDeleteFolderRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxDeleteFolderRequest *wrapper = EmailMailboxDeleteFolderRequest::Unwrap<EmailMailboxDeleteFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxDeleteFolderRequest *wrapper = EmailMailboxDeleteFolderRequest::Unwrap<EmailMailboxDeleteFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailMailboxDeleteFolderStatus arg0 = static_cast<::Windows::ApplicationModel::Email::EmailMailboxDeleteFolderStatus>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          op = wrapper->_instance->ReportFailedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailFolderIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxDeleteFolderRequest *wrapper = EmailMailboxDeleteFolderRequest::Unwrap<EmailMailboxDeleteFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailFolderId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxDeleteFolderRequest *wrapper = EmailMailboxDeleteFolderRequest::Unwrap<EmailMailboxDeleteFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxDeleteFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ UnwrapEmailMailboxDeleteFolderRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxDeleteFolderRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxDeleteFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxDeleteFolderRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ UnwrapEmailMailboxDeleteFolderRequest(Local<Value> value) {
     return EmailMailboxDeleteFolderRequest::Unwrap<EmailMailboxDeleteFolderRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxDeleteFolderRequest(Local<Object> exports) {
    EmailMailboxDeleteFolderRequest::Init(exports);
  }

  class EmailMailboxDeleteFolderRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxDeleteFolderRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxDeleteFolderRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxDeleteFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxDeleteFolderRequestEventArgs *wrapperInstance = new EmailMailboxDeleteFolderRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxDeleteFolderRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxDeleteFolderRequestEventArgs *wrapper = EmailMailboxDeleteFolderRequestEventArgs::Unwrap<EmailMailboxDeleteFolderRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxDeleteFolderRequestEventArgs *wrapper = EmailMailboxDeleteFolderRequestEventArgs::Unwrap<EmailMailboxDeleteFolderRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxDeleteFolderRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxDeleteFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ UnwrapEmailMailboxDeleteFolderRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxDeleteFolderRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxDeleteFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxDeleteFolderRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDeleteFolderRequestEventArgs^ UnwrapEmailMailboxDeleteFolderRequestEventArgs(Local<Value> value) {
     return EmailMailboxDeleteFolderRequestEventArgs::Unwrap<EmailMailboxDeleteFolderRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxDeleteFolderRequestEventArgs(Local<Object> exports) {
    EmailMailboxDeleteFolderRequestEventArgs::Init(exports);
  }

  class EmailMailboxDownloadAttachmentRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxDownloadAttachmentRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailAttachmentId").ToLocalChecked(), EmailAttachmentIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMessageId").ToLocalChecked(), EmailMessageIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxDownloadAttachmentRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxDownloadAttachmentRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxDownloadAttachmentRequest *wrapperInstance = new EmailMailboxDownloadAttachmentRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxDownloadAttachmentRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxDownloadAttachmentRequest *wrapper = EmailMailboxDownloadAttachmentRequest::Unwrap<EmailMailboxDownloadAttachmentRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxDownloadAttachmentRequest *wrapper = EmailMailboxDownloadAttachmentRequest::Unwrap<EmailMailboxDownloadAttachmentRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailAttachmentIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info.This())) {
        return;
      }

      EmailMailboxDownloadAttachmentRequest *wrapper = EmailMailboxDownloadAttachmentRequest::Unwrap<EmailMailboxDownloadAttachmentRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailAttachmentId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info.This())) {
        return;
      }

      EmailMailboxDownloadAttachmentRequest *wrapper = EmailMailboxDownloadAttachmentRequest::Unwrap<EmailMailboxDownloadAttachmentRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMessageIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^>(info.This())) {
        return;
      }

      EmailMailboxDownloadAttachmentRequest *wrapper = EmailMailboxDownloadAttachmentRequest::Unwrap<EmailMailboxDownloadAttachmentRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMessageId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxDownloadAttachmentRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ UnwrapEmailMailboxDownloadAttachmentRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxDownloadAttachmentRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxDownloadAttachmentRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxDownloadAttachmentRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ UnwrapEmailMailboxDownloadAttachmentRequest(Local<Value> value) {
     return EmailMailboxDownloadAttachmentRequest::Unwrap<EmailMailboxDownloadAttachmentRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxDownloadAttachmentRequest(Local<Object> exports) {
    EmailMailboxDownloadAttachmentRequest::Init(exports);
  }

  class EmailMailboxDownloadAttachmentRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxDownloadAttachmentRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxDownloadAttachmentRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxDownloadAttachmentRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxDownloadAttachmentRequestEventArgs *wrapperInstance = new EmailMailboxDownloadAttachmentRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxDownloadAttachmentRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxDownloadAttachmentRequestEventArgs *wrapper = EmailMailboxDownloadAttachmentRequestEventArgs::Unwrap<EmailMailboxDownloadAttachmentRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxDownloadAttachmentRequestEventArgs *wrapper = EmailMailboxDownloadAttachmentRequestEventArgs::Unwrap<EmailMailboxDownloadAttachmentRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxDownloadAttachmentRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxDownloadAttachmentRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ UnwrapEmailMailboxDownloadAttachmentRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxDownloadAttachmentRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxDownloadAttachmentRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxDownloadAttachmentRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadAttachmentRequestEventArgs^ UnwrapEmailMailboxDownloadAttachmentRequestEventArgs(Local<Value> value) {
     return EmailMailboxDownloadAttachmentRequestEventArgs::Unwrap<EmailMailboxDownloadAttachmentRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxDownloadAttachmentRequestEventArgs(Local<Object> exports) {
    EmailMailboxDownloadAttachmentRequestEventArgs::Init(exports);
  }

  class EmailMailboxDownloadMessageRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxDownloadMessageRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMessageId").ToLocalChecked(), EmailMessageIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxDownloadMessageRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxDownloadMessageRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxDownloadMessageRequest *wrapperInstance = new EmailMailboxDownloadMessageRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxDownloadMessageRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxDownloadMessageRequest *wrapper = EmailMailboxDownloadMessageRequest::Unwrap<EmailMailboxDownloadMessageRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxDownloadMessageRequest *wrapper = EmailMailboxDownloadMessageRequest::Unwrap<EmailMailboxDownloadMessageRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^>(info.This())) {
        return;
      }

      EmailMailboxDownloadMessageRequest *wrapper = EmailMailboxDownloadMessageRequest::Unwrap<EmailMailboxDownloadMessageRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMessageIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^>(info.This())) {
        return;
      }

      EmailMailboxDownloadMessageRequest *wrapper = EmailMailboxDownloadMessageRequest::Unwrap<EmailMailboxDownloadMessageRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMessageId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxDownloadMessageRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ UnwrapEmailMailboxDownloadMessageRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxDownloadMessageRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxDownloadMessageRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxDownloadMessageRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ UnwrapEmailMailboxDownloadMessageRequest(Local<Value> value) {
     return EmailMailboxDownloadMessageRequest::Unwrap<EmailMailboxDownloadMessageRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxDownloadMessageRequest(Local<Object> exports) {
    EmailMailboxDownloadMessageRequest::Init(exports);
  }

  class EmailMailboxDownloadMessageRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxDownloadMessageRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxDownloadMessageRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxDownloadMessageRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxDownloadMessageRequestEventArgs *wrapperInstance = new EmailMailboxDownloadMessageRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxDownloadMessageRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxDownloadMessageRequestEventArgs *wrapper = EmailMailboxDownloadMessageRequestEventArgs::Unwrap<EmailMailboxDownloadMessageRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxDownloadMessageRequestEventArgs *wrapper = EmailMailboxDownloadMessageRequestEventArgs::Unwrap<EmailMailboxDownloadMessageRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxDownloadMessageRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxDownloadMessageRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ UnwrapEmailMailboxDownloadMessageRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxDownloadMessageRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxDownloadMessageRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxDownloadMessageRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxDownloadMessageRequestEventArgs^ UnwrapEmailMailboxDownloadMessageRequestEventArgs(Local<Value> value) {
     return EmailMailboxDownloadMessageRequestEventArgs::Unwrap<EmailMailboxDownloadMessageRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxDownloadMessageRequestEventArgs(Local<Object> exports) {
    EmailMailboxDownloadMessageRequestEventArgs::Init(exports);
  }

  class EmailMailboxEmptyFolderRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxEmptyFolderRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailFolderId").ToLocalChecked(), EmailFolderIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxEmptyFolderRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxEmptyFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxEmptyFolderRequest *wrapperInstance = new EmailMailboxEmptyFolderRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxEmptyFolderRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxEmptyFolderRequest *wrapper = EmailMailboxEmptyFolderRequest::Unwrap<EmailMailboxEmptyFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxEmptyFolderRequest *wrapper = EmailMailboxEmptyFolderRequest::Unwrap<EmailMailboxEmptyFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailMailboxEmptyFolderStatus arg0 = static_cast<::Windows::ApplicationModel::Email::EmailMailboxEmptyFolderStatus>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          op = wrapper->_instance->ReportFailedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailFolderIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxEmptyFolderRequest *wrapper = EmailMailboxEmptyFolderRequest::Unwrap<EmailMailboxEmptyFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailFolderId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxEmptyFolderRequest *wrapper = EmailMailboxEmptyFolderRequest::Unwrap<EmailMailboxEmptyFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxEmptyFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ UnwrapEmailMailboxEmptyFolderRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxEmptyFolderRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxEmptyFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxEmptyFolderRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ UnwrapEmailMailboxEmptyFolderRequest(Local<Value> value) {
     return EmailMailboxEmptyFolderRequest::Unwrap<EmailMailboxEmptyFolderRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxEmptyFolderRequest(Local<Object> exports) {
    EmailMailboxEmptyFolderRequest::Init(exports);
  }

  class EmailMailboxEmptyFolderRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxEmptyFolderRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxEmptyFolderRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxEmptyFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxEmptyFolderRequestEventArgs *wrapperInstance = new EmailMailboxEmptyFolderRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxEmptyFolderRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxEmptyFolderRequestEventArgs *wrapper = EmailMailboxEmptyFolderRequestEventArgs::Unwrap<EmailMailboxEmptyFolderRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxEmptyFolderRequestEventArgs *wrapper = EmailMailboxEmptyFolderRequestEventArgs::Unwrap<EmailMailboxEmptyFolderRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxEmptyFolderRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxEmptyFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ UnwrapEmailMailboxEmptyFolderRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxEmptyFolderRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxEmptyFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxEmptyFolderRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxEmptyFolderRequestEventArgs^ UnwrapEmailMailboxEmptyFolderRequestEventArgs(Local<Value> value) {
     return EmailMailboxEmptyFolderRequestEventArgs::Unwrap<EmailMailboxEmptyFolderRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxEmptyFolderRequestEventArgs(Local<Object> exports) {
    EmailMailboxEmptyFolderRequestEventArgs::Init(exports);
  }

  class EmailMailboxForwardMeetingRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxForwardMeetingRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMessageId").ToLocalChecked(), EmailMessageIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("forwardHeader").ToLocalChecked(), ForwardHeaderGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("forwardHeaderType").ToLocalChecked(), ForwardHeaderTypeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("recipients").ToLocalChecked(), RecipientsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("subject").ToLocalChecked(), SubjectGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxForwardMeetingRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxForwardMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxForwardMeetingRequest *wrapperInstance = new EmailMailboxForwardMeetingRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxForwardMeetingRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMessageIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMessageId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ForwardHeaderGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->ForwardHeader;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ForwardHeaderTypeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::EmailMessageBodyKind result = wrapper->_instance->ForwardHeaderType;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RecipientsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        ::Windows::Foundation::Collections::IVectorView<::Windows::ApplicationModel::Email::EmailRecipient^>^ result = wrapper->_instance->Recipients;
        info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::ApplicationModel::Email::EmailRecipient^>::CreateVectorViewWrapper(result, 
            [](::Windows::ApplicationModel::Email::EmailRecipient^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Email", "EmailRecipient", val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::EmailRecipient^>(value);
            },
            [](Local<Value> value) -> ::Windows::ApplicationModel::Email::EmailRecipient^ {
              return dynamic_cast<::Windows::ApplicationModel::Email::EmailRecipient^>(NodeRT::Utils::GetObjectInstance(value));
            }
          ));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SubjectGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequest *wrapper = EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Subject;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxForwardMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ UnwrapEmailMailboxForwardMeetingRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxForwardMeetingRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxForwardMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxForwardMeetingRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ UnwrapEmailMailboxForwardMeetingRequest(Local<Value> value) {
     return EmailMailboxForwardMeetingRequest::Unwrap<EmailMailboxForwardMeetingRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxForwardMeetingRequest(Local<Object> exports) {
    EmailMailboxForwardMeetingRequest::Init(exports);
  }

  class EmailMailboxForwardMeetingRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxForwardMeetingRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxForwardMeetingRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxForwardMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxForwardMeetingRequestEventArgs *wrapperInstance = new EmailMailboxForwardMeetingRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxForwardMeetingRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequestEventArgs *wrapper = EmailMailboxForwardMeetingRequestEventArgs::Unwrap<EmailMailboxForwardMeetingRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxForwardMeetingRequestEventArgs *wrapper = EmailMailboxForwardMeetingRequestEventArgs::Unwrap<EmailMailboxForwardMeetingRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxForwardMeetingRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxForwardMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ UnwrapEmailMailboxForwardMeetingRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxForwardMeetingRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxForwardMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxForwardMeetingRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxForwardMeetingRequestEventArgs^ UnwrapEmailMailboxForwardMeetingRequestEventArgs(Local<Value> value) {
     return EmailMailboxForwardMeetingRequestEventArgs::Unwrap<EmailMailboxForwardMeetingRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxForwardMeetingRequestEventArgs(Local<Object> exports) {
    EmailMailboxForwardMeetingRequestEventArgs::Init(exports);
  }

  class EmailMailboxGetAutoReplySettingsRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxGetAutoReplySettingsRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("requestedFormat").ToLocalChecked(), RequestedFormatGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxGetAutoReplySettingsRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxGetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxGetAutoReplySettingsRequest *wrapperInstance = new EmailMailboxGetAutoReplySettingsRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxGetAutoReplySettingsRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxGetAutoReplySettingsRequest *wrapper = EmailMailboxGetAutoReplySettingsRequest::Unwrap<EmailMailboxGetAutoReplySettingsRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::EmailMailboxAutoReplySettings^>(info[0]))
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailMailboxAutoReplySettings^ arg0 = dynamic_cast<::Windows::ApplicationModel::Email::EmailMailboxAutoReplySettings^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          op = wrapper->_instance->ReportCompletedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxGetAutoReplySettingsRequest *wrapper = EmailMailboxGetAutoReplySettingsRequest::Unwrap<EmailMailboxGetAutoReplySettingsRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      EmailMailboxGetAutoReplySettingsRequest *wrapper = EmailMailboxGetAutoReplySettingsRequest::Unwrap<EmailMailboxGetAutoReplySettingsRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RequestedFormatGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      EmailMailboxGetAutoReplySettingsRequest *wrapper = EmailMailboxGetAutoReplySettingsRequest::Unwrap<EmailMailboxGetAutoReplySettingsRequest>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::EmailMailboxAutoReplyMessageResponseKind result = wrapper->_instance->RequestedFormat;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxGetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ UnwrapEmailMailboxGetAutoReplySettingsRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxGetAutoReplySettingsRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxGetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxGetAutoReplySettingsRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ UnwrapEmailMailboxGetAutoReplySettingsRequest(Local<Value> value) {
     return EmailMailboxGetAutoReplySettingsRequest::Unwrap<EmailMailboxGetAutoReplySettingsRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxGetAutoReplySettingsRequest(Local<Object> exports) {
    EmailMailboxGetAutoReplySettingsRequest::Init(exports);
  }

  class EmailMailboxGetAutoReplySettingsRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxGetAutoReplySettingsRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxGetAutoReplySettingsRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxGetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxGetAutoReplySettingsRequestEventArgs *wrapperInstance = new EmailMailboxGetAutoReplySettingsRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxGetAutoReplySettingsRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxGetAutoReplySettingsRequestEventArgs *wrapper = EmailMailboxGetAutoReplySettingsRequestEventArgs::Unwrap<EmailMailboxGetAutoReplySettingsRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxGetAutoReplySettingsRequestEventArgs *wrapper = EmailMailboxGetAutoReplySettingsRequestEventArgs::Unwrap<EmailMailboxGetAutoReplySettingsRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxGetAutoReplySettingsRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxGetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ UnwrapEmailMailboxGetAutoReplySettingsRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxGetAutoReplySettingsRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxGetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxGetAutoReplySettingsRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxGetAutoReplySettingsRequestEventArgs^ UnwrapEmailMailboxGetAutoReplySettingsRequestEventArgs(Local<Value> value) {
     return EmailMailboxGetAutoReplySettingsRequestEventArgs::Unwrap<EmailMailboxGetAutoReplySettingsRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxGetAutoReplySettingsRequestEventArgs(Local<Object> exports) {
    EmailMailboxGetAutoReplySettingsRequestEventArgs::Init(exports);
  }

  class EmailMailboxMoveFolderRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxMoveFolderRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailFolderId").ToLocalChecked(), EmailFolderIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("newFolderName").ToLocalChecked(), NewFolderNameGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("newParentFolderId").ToLocalChecked(), NewParentFolderIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxMoveFolderRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxMoveFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxMoveFolderRequest *wrapperInstance = new EmailMailboxMoveFolderRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxMoveFolderRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxMoveFolderRequest *wrapper = EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxMoveFolderRequest *wrapper = EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailFolderIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxMoveFolderRequest *wrapper = EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailFolderId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxMoveFolderRequest *wrapper = EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NewFolderNameGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxMoveFolderRequest *wrapper = EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->NewFolderName;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NewParentFolderIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^>(info.This())) {
        return;
      }

      EmailMailboxMoveFolderRequest *wrapper = EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->NewParentFolderId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxMoveFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ UnwrapEmailMailboxMoveFolderRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxMoveFolderRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxMoveFolderRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxMoveFolderRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ UnwrapEmailMailboxMoveFolderRequest(Local<Value> value) {
     return EmailMailboxMoveFolderRequest::Unwrap<EmailMailboxMoveFolderRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxMoveFolderRequest(Local<Object> exports) {
    EmailMailboxMoveFolderRequest::Init(exports);
  }

  class EmailMailboxMoveFolderRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxMoveFolderRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxMoveFolderRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxMoveFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxMoveFolderRequestEventArgs *wrapperInstance = new EmailMailboxMoveFolderRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxMoveFolderRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxMoveFolderRequestEventArgs *wrapper = EmailMailboxMoveFolderRequestEventArgs::Unwrap<EmailMailboxMoveFolderRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxMoveFolderRequestEventArgs *wrapper = EmailMailboxMoveFolderRequestEventArgs::Unwrap<EmailMailboxMoveFolderRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxMoveFolderRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxMoveFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ UnwrapEmailMailboxMoveFolderRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxMoveFolderRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxMoveFolderRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxMoveFolderRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxMoveFolderRequestEventArgs^ UnwrapEmailMailboxMoveFolderRequestEventArgs(Local<Value> value) {
     return EmailMailboxMoveFolderRequestEventArgs::Unwrap<EmailMailboxMoveFolderRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxMoveFolderRequestEventArgs(Local<Object> exports) {
    EmailMailboxMoveFolderRequestEventArgs::Init(exports);
  }

  class EmailMailboxProposeNewTimeForMeetingRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxProposeNewTimeForMeetingRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMessageId").ToLocalChecked(), EmailMessageIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("newDuration").ToLocalChecked(), NewDurationGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("newStartTime").ToLocalChecked(), NewStartTimeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("subject").ToLocalChecked(), SubjectGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxProposeNewTimeForMeetingRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxProposeNewTimeForMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxProposeNewTimeForMeetingRequest *wrapperInstance = new EmailMailboxProposeNewTimeForMeetingRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxProposeNewTimeForMeetingRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMessageIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMessageId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NewDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->NewDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void NewStartTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      try  {
        ::Windows::Foundation::DateTime result = wrapper->_instance->NewStartTime;
        info.GetReturnValue().Set(NodeRT::Utils::DateTimeToJS(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SubjectGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequest *wrapper = EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Subject;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxProposeNewTimeForMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ UnwrapEmailMailboxProposeNewTimeForMeetingRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxProposeNewTimeForMeetingRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxProposeNewTimeForMeetingRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxProposeNewTimeForMeetingRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ UnwrapEmailMailboxProposeNewTimeForMeetingRequest(Local<Value> value) {
     return EmailMailboxProposeNewTimeForMeetingRequest::Unwrap<EmailMailboxProposeNewTimeForMeetingRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxProposeNewTimeForMeetingRequest(Local<Object> exports) {
    EmailMailboxProposeNewTimeForMeetingRequest::Init(exports);
  }

  class EmailMailboxProposeNewTimeForMeetingRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxProposeNewTimeForMeetingRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxProposeNewTimeForMeetingRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxProposeNewTimeForMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxProposeNewTimeForMeetingRequestEventArgs *wrapperInstance = new EmailMailboxProposeNewTimeForMeetingRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequestEventArgs *wrapper = EmailMailboxProposeNewTimeForMeetingRequestEventArgs::Unwrap<EmailMailboxProposeNewTimeForMeetingRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxProposeNewTimeForMeetingRequestEventArgs *wrapper = EmailMailboxProposeNewTimeForMeetingRequestEventArgs::Unwrap<EmailMailboxProposeNewTimeForMeetingRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxProposeNewTimeForMeetingRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ UnwrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxProposeNewTimeForMeetingRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxProposeNewTimeForMeetingRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxProposeNewTimeForMeetingRequestEventArgs^ UnwrapEmailMailboxProposeNewTimeForMeetingRequestEventArgs(Local<Value> value) {
     return EmailMailboxProposeNewTimeForMeetingRequestEventArgs::Unwrap<EmailMailboxProposeNewTimeForMeetingRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxProposeNewTimeForMeetingRequestEventArgs(Local<Object> exports) {
    EmailMailboxProposeNewTimeForMeetingRequestEventArgs::Init(exports);
  }

  class EmailMailboxResolveRecipientsRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxResolveRecipientsRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("recipients").ToLocalChecked(), RecipientsGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxResolveRecipientsRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxResolveRecipientsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxResolveRecipientsRequest *wrapperInstance = new EmailMailboxResolveRecipientsRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxResolveRecipientsRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxResolveRecipientsRequest *wrapper = EmailMailboxResolveRecipientsRequest::Unwrap<EmailMailboxResolveRecipientsRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^ {
                   return dynamic_cast<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>(NodeRT::Utils::GetObjectInstance(value));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailRecipientResolutionResult^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          op = wrapper->_instance->ReportCompletedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxResolveRecipientsRequest *wrapper = EmailMailboxResolveRecipientsRequest::Unwrap<EmailMailboxResolveRecipientsRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^>(info.This())) {
        return;
      }

      EmailMailboxResolveRecipientsRequest *wrapper = EmailMailboxResolveRecipientsRequest::Unwrap<EmailMailboxResolveRecipientsRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RecipientsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^>(info.This())) {
        return;
      }

      EmailMailboxResolveRecipientsRequest *wrapper = EmailMailboxResolveRecipientsRequest::Unwrap<EmailMailboxResolveRecipientsRequest>(info.This());

      try  {
        ::Windows::Foundation::Collections::IVectorView<::Platform::String^>^ result = wrapper->_instance->Recipients;
        info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Platform::String^>::CreateVectorViewWrapper(result, 
            [](::Platform::String^ val) -> Local<Value> {
              return NodeRT::Utils::NewString(val->Data());
            },
            [](Local<Value> value) -> bool {
              return value->IsString();
            },
            [](Local<Value> value) -> ::Platform::String^ {
              return ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));
            }
          ));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxResolveRecipientsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ UnwrapEmailMailboxResolveRecipientsRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxResolveRecipientsRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxResolveRecipientsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxResolveRecipientsRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ UnwrapEmailMailboxResolveRecipientsRequest(Local<Value> value) {
     return EmailMailboxResolveRecipientsRequest::Unwrap<EmailMailboxResolveRecipientsRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxResolveRecipientsRequest(Local<Object> exports) {
    EmailMailboxResolveRecipientsRequest::Init(exports);
  }

  class EmailMailboxResolveRecipientsRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxResolveRecipientsRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxResolveRecipientsRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxResolveRecipientsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxResolveRecipientsRequestEventArgs *wrapperInstance = new EmailMailboxResolveRecipientsRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxResolveRecipientsRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxResolveRecipientsRequestEventArgs *wrapper = EmailMailboxResolveRecipientsRequestEventArgs::Unwrap<EmailMailboxResolveRecipientsRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxResolveRecipientsRequestEventArgs *wrapper = EmailMailboxResolveRecipientsRequestEventArgs::Unwrap<EmailMailboxResolveRecipientsRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxResolveRecipientsRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxResolveRecipientsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ UnwrapEmailMailboxResolveRecipientsRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxResolveRecipientsRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxResolveRecipientsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxResolveRecipientsRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxResolveRecipientsRequestEventArgs^ UnwrapEmailMailboxResolveRecipientsRequestEventArgs(Local<Value> value) {
     return EmailMailboxResolveRecipientsRequestEventArgs::Unwrap<EmailMailboxResolveRecipientsRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxResolveRecipientsRequestEventArgs(Local<Object> exports) {
    EmailMailboxResolveRecipientsRequestEventArgs::Init(exports);
  }

  class EmailMailboxServerSearchReadBatchRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxServerSearchReadBatchRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "saveMessageAsync", SaveMessageAsync);
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailFolderId").ToLocalChecked(), EmailFolderIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("options").ToLocalChecked(), OptionsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sessionId").ToLocalChecked(), SessionIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("suggestedBatchSize").ToLocalChecked(), SuggestedBatchSizeGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxServerSearchReadBatchRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxServerSearchReadBatchRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxServerSearchReadBatchRequest *wrapperInstance = new EmailMailboxServerSearchReadBatchRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxServerSearchReadBatchRequest(winRtInstance));
    }

    static void SaveMessageAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::EmailMessage^>(info[0]))
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailMessage^ arg0 = dynamic_cast<::Windows::ApplicationModel::Email::EmailMessage^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          op = wrapper->_instance->SaveMessageAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::ApplicationModel::Email::EmailBatchStatus arg0 = static_cast<::Windows::ApplicationModel::Email::EmailBatchStatus>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          op = wrapper->_instance->ReportFailedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailFolderIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailFolderId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OptionsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::EmailQueryOptions^ result = wrapper->_instance->Options;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Email", "EmailQueryOptions", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SessionIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->SessionId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SuggestedBatchSizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequest *wrapper = EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(info.This());

      try  {
        unsigned int result = wrapper->_instance->SuggestedBatchSize;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxServerSearchReadBatchRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ UnwrapEmailMailboxServerSearchReadBatchRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxServerSearchReadBatchRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxServerSearchReadBatchRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxServerSearchReadBatchRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ UnwrapEmailMailboxServerSearchReadBatchRequest(Local<Value> value) {
     return EmailMailboxServerSearchReadBatchRequest::Unwrap<EmailMailboxServerSearchReadBatchRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxServerSearchReadBatchRequest(Local<Object> exports) {
    EmailMailboxServerSearchReadBatchRequest::Init(exports);
  }

  class EmailMailboxServerSearchReadBatchRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxServerSearchReadBatchRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxServerSearchReadBatchRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxServerSearchReadBatchRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxServerSearchReadBatchRequestEventArgs *wrapperInstance = new EmailMailboxServerSearchReadBatchRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxServerSearchReadBatchRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequestEventArgs *wrapper = EmailMailboxServerSearchReadBatchRequestEventArgs::Unwrap<EmailMailboxServerSearchReadBatchRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxServerSearchReadBatchRequestEventArgs *wrapper = EmailMailboxServerSearchReadBatchRequestEventArgs::Unwrap<EmailMailboxServerSearchReadBatchRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxServerSearchReadBatchRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxServerSearchReadBatchRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ UnwrapEmailMailboxServerSearchReadBatchRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxServerSearchReadBatchRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxServerSearchReadBatchRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxServerSearchReadBatchRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxServerSearchReadBatchRequestEventArgs^ UnwrapEmailMailboxServerSearchReadBatchRequestEventArgs(Local<Value> value) {
     return EmailMailboxServerSearchReadBatchRequestEventArgs::Unwrap<EmailMailboxServerSearchReadBatchRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxServerSearchReadBatchRequestEventArgs(Local<Object> exports) {
    EmailMailboxServerSearchReadBatchRequestEventArgs::Init(exports);
  }

  class EmailMailboxSetAutoReplySettingsRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxSetAutoReplySettingsRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("autoReplySettings").ToLocalChecked(), AutoReplySettingsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxSetAutoReplySettingsRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxSetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxSetAutoReplySettingsRequest *wrapperInstance = new EmailMailboxSetAutoReplySettingsRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxSetAutoReplySettingsRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxSetAutoReplySettingsRequest *wrapper = EmailMailboxSetAutoReplySettingsRequest::Unwrap<EmailMailboxSetAutoReplySettingsRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxSetAutoReplySettingsRequest *wrapper = EmailMailboxSetAutoReplySettingsRequest::Unwrap<EmailMailboxSetAutoReplySettingsRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void AutoReplySettingsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      EmailMailboxSetAutoReplySettingsRequest *wrapper = EmailMailboxSetAutoReplySettingsRequest::Unwrap<EmailMailboxSetAutoReplySettingsRequest>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::EmailMailboxAutoReplySettings^ result = wrapper->_instance->AutoReplySettings;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Email", "EmailMailboxAutoReplySettings", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^>(info.This())) {
        return;
      }

      EmailMailboxSetAutoReplySettingsRequest *wrapper = EmailMailboxSetAutoReplySettingsRequest::Unwrap<EmailMailboxSetAutoReplySettingsRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxSetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ UnwrapEmailMailboxSetAutoReplySettingsRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxSetAutoReplySettingsRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxSetAutoReplySettingsRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxSetAutoReplySettingsRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ UnwrapEmailMailboxSetAutoReplySettingsRequest(Local<Value> value) {
     return EmailMailboxSetAutoReplySettingsRequest::Unwrap<EmailMailboxSetAutoReplySettingsRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxSetAutoReplySettingsRequest(Local<Object> exports) {
    EmailMailboxSetAutoReplySettingsRequest::Init(exports);
  }

  class EmailMailboxSetAutoReplySettingsRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxSetAutoReplySettingsRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxSetAutoReplySettingsRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxSetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxSetAutoReplySettingsRequestEventArgs *wrapperInstance = new EmailMailboxSetAutoReplySettingsRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxSetAutoReplySettingsRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxSetAutoReplySettingsRequestEventArgs *wrapper = EmailMailboxSetAutoReplySettingsRequestEventArgs::Unwrap<EmailMailboxSetAutoReplySettingsRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxSetAutoReplySettingsRequestEventArgs *wrapper = EmailMailboxSetAutoReplySettingsRequestEventArgs::Unwrap<EmailMailboxSetAutoReplySettingsRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxSetAutoReplySettingsRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxSetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ UnwrapEmailMailboxSetAutoReplySettingsRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxSetAutoReplySettingsRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxSetAutoReplySettingsRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxSetAutoReplySettingsRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSetAutoReplySettingsRequestEventArgs^ UnwrapEmailMailboxSetAutoReplySettingsRequestEventArgs(Local<Value> value) {
     return EmailMailboxSetAutoReplySettingsRequestEventArgs::Unwrap<EmailMailboxSetAutoReplySettingsRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxSetAutoReplySettingsRequestEventArgs(Local<Object> exports) {
    EmailMailboxSetAutoReplySettingsRequestEventArgs::Init(exports);
  }

  class EmailMailboxSyncManagerSyncRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxSyncManagerSyncRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxSyncManagerSyncRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxSyncManagerSyncRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxSyncManagerSyncRequest *wrapperInstance = new EmailMailboxSyncManagerSyncRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxSyncManagerSyncRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxSyncManagerSyncRequest *wrapper = EmailMailboxSyncManagerSyncRequest::Unwrap<EmailMailboxSyncManagerSyncRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxSyncManagerSyncRequest *wrapper = EmailMailboxSyncManagerSyncRequest::Unwrap<EmailMailboxSyncManagerSyncRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^>(info.This())) {
        return;
      }

      EmailMailboxSyncManagerSyncRequest *wrapper = EmailMailboxSyncManagerSyncRequest::Unwrap<EmailMailboxSyncManagerSyncRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxSyncManagerSyncRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ UnwrapEmailMailboxSyncManagerSyncRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxSyncManagerSyncRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxSyncManagerSyncRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxSyncManagerSyncRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ UnwrapEmailMailboxSyncManagerSyncRequest(Local<Value> value) {
     return EmailMailboxSyncManagerSyncRequest::Unwrap<EmailMailboxSyncManagerSyncRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxSyncManagerSyncRequest(Local<Object> exports) {
    EmailMailboxSyncManagerSyncRequest::Init(exports);
  }

  class EmailMailboxSyncManagerSyncRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxSyncManagerSyncRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxSyncManagerSyncRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxSyncManagerSyncRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxSyncManagerSyncRequestEventArgs *wrapperInstance = new EmailMailboxSyncManagerSyncRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxSyncManagerSyncRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxSyncManagerSyncRequestEventArgs *wrapper = EmailMailboxSyncManagerSyncRequestEventArgs::Unwrap<EmailMailboxSyncManagerSyncRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxSyncManagerSyncRequestEventArgs *wrapper = EmailMailboxSyncManagerSyncRequestEventArgs::Unwrap<EmailMailboxSyncManagerSyncRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxSyncManagerSyncRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxSyncManagerSyncRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ UnwrapEmailMailboxSyncManagerSyncRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxSyncManagerSyncRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxSyncManagerSyncRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxSyncManagerSyncRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxSyncManagerSyncRequestEventArgs^ UnwrapEmailMailboxSyncManagerSyncRequestEventArgs(Local<Value> value) {
     return EmailMailboxSyncManagerSyncRequestEventArgs::Unwrap<EmailMailboxSyncManagerSyncRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxSyncManagerSyncRequestEventArgs(Local<Object> exports) {
    EmailMailboxSyncManagerSyncRequestEventArgs::Init(exports);
  }

  class EmailMailboxUpdateMeetingResponseRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxUpdateMeetingResponseRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMessageId").ToLocalChecked(), EmailMessageIdGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("response").ToLocalChecked(), ResponseGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sendUpdate").ToLocalChecked(), SendUpdateGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("subject").ToLocalChecked(), SubjectGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxUpdateMeetingResponseRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxUpdateMeetingResponseRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxUpdateMeetingResponseRequest *wrapperInstance = new EmailMailboxUpdateMeetingResponseRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxUpdateMeetingResponseRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportCompletedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMessageIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMessageId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ResponseGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::EmailMeetingResponseType result = wrapper->_instance->Response;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SendUpdateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      try  {
        bool result = wrapper->_instance->SendUpdate;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SubjectGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequest *wrapper = EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Subject;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxUpdateMeetingResponseRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ UnwrapEmailMailboxUpdateMeetingResponseRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxUpdateMeetingResponseRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxUpdateMeetingResponseRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxUpdateMeetingResponseRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ UnwrapEmailMailboxUpdateMeetingResponseRequest(Local<Value> value) {
     return EmailMailboxUpdateMeetingResponseRequest::Unwrap<EmailMailboxUpdateMeetingResponseRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxUpdateMeetingResponseRequest(Local<Object> exports) {
    EmailMailboxUpdateMeetingResponseRequest::Init(exports);
  }

  class EmailMailboxUpdateMeetingResponseRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxUpdateMeetingResponseRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxUpdateMeetingResponseRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxUpdateMeetingResponseRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxUpdateMeetingResponseRequestEventArgs *wrapperInstance = new EmailMailboxUpdateMeetingResponseRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxUpdateMeetingResponseRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequestEventArgs *wrapper = EmailMailboxUpdateMeetingResponseRequestEventArgs::Unwrap<EmailMailboxUpdateMeetingResponseRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxUpdateMeetingResponseRequestEventArgs *wrapper = EmailMailboxUpdateMeetingResponseRequestEventArgs::Unwrap<EmailMailboxUpdateMeetingResponseRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxUpdateMeetingResponseRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxUpdateMeetingResponseRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ UnwrapEmailMailboxUpdateMeetingResponseRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxUpdateMeetingResponseRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxUpdateMeetingResponseRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxUpdateMeetingResponseRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxUpdateMeetingResponseRequestEventArgs^ UnwrapEmailMailboxUpdateMeetingResponseRequestEventArgs(Local<Value> value) {
     return EmailMailboxUpdateMeetingResponseRequestEventArgs::Unwrap<EmailMailboxUpdateMeetingResponseRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxUpdateMeetingResponseRequestEventArgs(Local<Object> exports) {
    EmailMailboxUpdateMeetingResponseRequestEventArgs::Init(exports);
  }

  class EmailMailboxValidateCertificatesRequest : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxValidateCertificatesRequest").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);

        Local<Function> func;
        Local<FunctionTemplate> funcTemplate;


          
            Nan::SetPrototypeMethod(localRef, "reportCompletedAsync", ReportCompletedAsync);
            Nan::SetPrototypeMethod(localRef, "reportFailedAsync", ReportFailedAsync);
          


          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("certificates").ToLocalChecked(), CertificatesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("emailMailboxId").ToLocalChecked(), EmailMailboxIdGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxValidateCertificatesRequest").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxValidateCertificatesRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxValidateCertificatesRequest *wrapperInstance = new EmailMailboxValidateCertificatesRequest(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxValidateCertificatesRequest(winRtInstance));
    }

    static void ReportCompletedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxValidateCertificatesRequest *wrapper = EmailMailboxValidateCertificatesRequest::Unwrap<EmailMailboxValidateCertificatesRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 2
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailCertificateValidationStatus>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailCertificateValidationStatus>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailCertificateValidationStatus>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Windows::ApplicationModel::Email::EmailCertificateValidationStatus>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> ::Windows::ApplicationModel::Email::EmailCertificateValidationStatus {
                   return static_cast<::Windows::ApplicationModel::Email::EmailCertificateValidationStatus>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IIterable<::Windows::ApplicationModel::Email::EmailCertificateValidationStatus>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          op = wrapper->_instance->ReportCompletedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }
    static void ReportFailedAsync(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^>(info.This())) {
        return;
      }

      if (info.Length() == 0 || !info[info.Length() -1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
        return;
      }

      EmailMailboxValidateCertificatesRequest *wrapper = EmailMailboxValidateCertificatesRequest::Unwrap<EmailMailboxValidateCertificatesRequest>(info.This());

      ::Windows::Foundation::IAsyncAction^ op;


      if (info.Length() == 1)
      {
        try
        {
          op = wrapper->_instance->ReportFailedAsync();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }

      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(info[info.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<void> t) {
        try {
          t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            Local<Value> args[] = {Undefined()};


            invokeCallback(_countof(args), args);
          });
        } catch (Platform::Exception^ exception) {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
            Local<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);

            Local<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }
      });
    }




    static void CertificatesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^>(info.This())) {
        return;
      }

      EmailMailboxValidateCertificatesRequest *wrapper = EmailMailboxValidateCertificatesRequest::Unwrap<EmailMailboxValidateCertificatesRequest>(info.This());

      try  {
        ::Windows::Foundation::Collections::IVectorView<::Windows::Security::Cryptography::Certificates::Certificate^>^ result = wrapper->_instance->Certificates;
        info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::Security::Cryptography::Certificates::Certificate^>::CreateVectorViewWrapper(result, 
            [](::Windows::Security::Cryptography::Certificates::Certificate^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.Security.Cryptography.Certificates", "Certificate", val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Security::Cryptography::Certificates::Certificate^>(value);
            },
            [](Local<Value> value) -> ::Windows::Security::Cryptography::Certificates::Certificate^ {
              return dynamic_cast<::Windows::Security::Cryptography::Certificates::Certificate^>(NodeRT::Utils::GetObjectInstance(value));
            }
          ));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EmailMailboxIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^>(info.This())) {
        return;
      }

      EmailMailboxValidateCertificatesRequest *wrapper = EmailMailboxValidateCertificatesRequest::Unwrap<EmailMailboxValidateCertificatesRequest>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->EmailMailboxId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxValidateCertificatesRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ UnwrapEmailMailboxValidateCertificatesRequest(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxValidateCertificatesRequest::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxValidateCertificatesRequest(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxValidateCertificatesRequest::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ UnwrapEmailMailboxValidateCertificatesRequest(Local<Value> value) {
     return EmailMailboxValidateCertificatesRequest::Unwrap<EmailMailboxValidateCertificatesRequest>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxValidateCertificatesRequest(Local<Object> exports) {
    EmailMailboxValidateCertificatesRequest::Init(exports);
  }

  class EmailMailboxValidateCertificatesRequestEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("EmailMailboxValidateCertificatesRequestEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("request").ToLocalChecked(), RequestGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("EmailMailboxValidateCertificatesRequestEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      EmailMailboxValidateCertificatesRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      EmailMailboxValidateCertificatesRequestEventArgs *wrapperInstance = new EmailMailboxValidateCertificatesRequestEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapEmailMailboxValidateCertificatesRequestEventArgs(winRtInstance));
    }


    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxValidateCertificatesRequestEventArgs *wrapper = EmailMailboxValidateCertificatesRequestEventArgs::Unwrap<EmailMailboxValidateCertificatesRequestEventArgs>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Deferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Deferral", result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void RequestGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^>(info.This())) {
        return;
      }

      EmailMailboxValidateCertificatesRequestEventArgs *wrapper = EmailMailboxValidateCertificatesRequestEventArgs::Unwrap<EmailMailboxValidateCertificatesRequestEventArgs>(info.This());

      try  {
        ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequest^ result = wrapper->_instance->Request;
        info.GetReturnValue().Set(WrapEmailMailboxValidateCertificatesRequest(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapEmailMailboxValidateCertificatesRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ wintRtInstance);
      friend ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ UnwrapEmailMailboxValidateCertificatesRequestEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> EmailMailboxValidateCertificatesRequestEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapEmailMailboxValidateCertificatesRequestEventArgs(::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(EmailMailboxValidateCertificatesRequestEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::ApplicationModel::Email::DataProvider::EmailMailboxValidateCertificatesRequestEventArgs^ UnwrapEmailMailboxValidateCertificatesRequestEventArgs(Local<Value> value) {
     return EmailMailboxValidateCertificatesRequestEventArgs::Unwrap<EmailMailboxValidateCertificatesRequestEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitEmailMailboxValidateCertificatesRequestEventArgs(Local<Object> exports) {
    EmailMailboxValidateCertificatesRequestEventArgs::Init(exports);
  }


} } } } } 

NAN_MODULE_INIT(init) {
  // We ignore failures for now since it probably means that
  // the initialization already happened for STA, and that's cool

  CoInitializeEx(nullptr, COINIT_MULTITHREADED);

  /*
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) {
    Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  */

      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailDataProviderConnection(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailDataProviderTriggerDetails(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxCreateFolderRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxCreateFolderRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxDeleteFolderRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxDeleteFolderRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxDownloadAttachmentRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxDownloadAttachmentRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxDownloadMessageRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxDownloadMessageRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxEmptyFolderRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxEmptyFolderRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxForwardMeetingRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxForwardMeetingRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxGetAutoReplySettingsRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxGetAutoReplySettingsRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxMoveFolderRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxMoveFolderRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxProposeNewTimeForMeetingRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxProposeNewTimeForMeetingRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxResolveRecipientsRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxResolveRecipientsRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxServerSearchReadBatchRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxServerSearchReadBatchRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxSetAutoReplySettingsRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxSetAutoReplySettingsRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxSyncManagerSyncRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxSyncManagerSyncRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxUpdateMeetingResponseRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxUpdateMeetingResponseRequestEventArgs(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxValidateCertificatesRequest(target);
      NodeRT::Windows::ApplicationModel::Email::DataProvider::InitEmailMailboxValidateCertificatesRequestEventArgs(target);


  NodeRT::Utils::RegisterNameSpace("Windows.ApplicationModel.Email.DataProvider", target);
}



NODE_MODULE(binding, init)
