public Protocols.ToolkitResultProtocol UpdateAppointment(Protocols.FieldOps.UpdateAppointmentSetupProtocol setupParam)
        {
            ClarifySession session = Global.GetSession( AuthHeader );
            FChoice.Toolkits.Clarify.FieldOps.FieldOpsToolkit toolkit = new FChoice.Toolkits.Clarify.FieldOps.FieldOpsToolkit( session );
            FChoice.Toolkits.Clarify.FieldOps.UpdateAppointmentSetup setup;

            switch( setupParam.ConstructorCue )
            {
                case 0:
                    setup = new FChoice.Toolkits.Clarify.FieldOps.UpdateAppointmentSetup(setupParam.AppointmentObjid);
                    break;
                default:
                    throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue));
            }

            if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) )
            {
                setup.AppointmentObjid = setupParam.AppointmentObjid;
            }

            if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) )
            {
                setup.StartDate = setupParam.StartDate;
            }

            if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) )
            {
                setup.EndDate = setupParam.EndDate;
            }

            if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) )
            {
                setup.Duration = TimeSpan.FromSeconds(setupParam.Duration);
            }

            if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) )
            {
                setup.Description = setupParam.Description;
            }

            if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) )
            {
                setup.CellText = setupParam.CellText;
            }

            if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) )
            {
                setup.AppointmentClass = setupParam.AppointmentClass;
            }

            if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) )
            {
                setup.AppointmentType = setupParam.AppointmentType;
            }

            if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) )
            {
                setup.UserName = setupParam.UserName;
            }

            if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) )
            {
                setup.CreateDate = setupParam.CreateDate;
            }

            return new Protocols.ToolkitResultProtocol( toolkit.UpdateAppointment(setup) );
        }