/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace FreeSWITCH.Native {

using System;
using System.Runtime.InteropServices;

public class Api : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal Api(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(Api obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~Api() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        freeswitchPINVOKE.delete_Api(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
    }
  }

  public Api() : this(freeswitchPINVOKE.new_Api(), true) {
  }

  public string Execute(string command, string data) {
    string ret = freeswitchPINVOKE.Api_Execute(swigCPtr, command, data);
    return ret;
  }

  public string ExecuteString(string command) {
    string ret = freeswitchPINVOKE.Api_ExecuteString(swigCPtr, command);
    return ret;
  }

}

}
