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

namespace QuantLib {

public class MakeSchedule : global::System.IDisposable {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal MakeSchedule(global::System.IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(MakeSchedule obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  ~MakeSchedule() {
    Dispose(false);
  }

  public void Dispose() {
    Dispose(true);
    global::System.GC.SuppressFinalize(this);
  }

  protected virtual void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          NQuantLibcPINVOKE.delete_MakeSchedule(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
    }
  }

  public MakeSchedule() : this(NQuantLibcPINVOKE.new_MakeSchedule(), true) {
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
  }

  public MakeSchedule from(Date effectiveDate) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_from(swigCPtr, Date.getCPtr(effectiveDate)), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule to(Date terminationDate) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_to(swigCPtr, Date.getCPtr(terminationDate)), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withTenor(Period arg0) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withTenor(swigCPtr, Period.getCPtr(arg0)), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withFrequency(Frequency arg0) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withFrequency(swigCPtr, (int)arg0), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withCalendar(Calendar arg0) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withCalendar(swigCPtr, Calendar.getCPtr(arg0)), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withConvention(BusinessDayConvention arg0) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withConvention(swigCPtr, (int)arg0), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withTerminationDateConvention(BusinessDayConvention arg0) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withTerminationDateConvention(swigCPtr, (int)arg0), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withRule(DateGeneration.Rule arg0) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withRule(swigCPtr, (int)arg0), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule forwards() {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_forwards(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule backwards() {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_backwards(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule endOfMonth(bool flag) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_endOfMonth__SWIG_0(swigCPtr, flag), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule endOfMonth() {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_endOfMonth__SWIG_1(swigCPtr), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withFirstDate(Date d) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withFirstDate(swigCPtr, Date.getCPtr(d)), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public MakeSchedule withNextToLastDate(Date d) {
    MakeSchedule ret = new MakeSchedule(NQuantLibcPINVOKE.MakeSchedule_withNextToLastDate(swigCPtr, Date.getCPtr(d)), false);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public Schedule schedule() {
    Schedule ret = new Schedule(NQuantLibcPINVOKE.MakeSchedule_schedule(swigCPtr), true);
    if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
