// AckUpdate persists an acknowledgment for a given (session, seqnum) pair. This
// removes the update from the set of committed updates, and validates the
// lastApplied value returned from the tower.
489687
func (m *ClientDB) AckUpdate(id *wtdb.SessionID, seqNum, lastApplied uint16) error {
	m.mu.Lock()
	defer m.mu.Unlock()

	// Fail if session doesn't exist.
	session, ok := m.activeSessions[*id]
	if !ok {
		return wtdb.ErrClientSessionNotFound
	}

	// Retrieve the committed update, failing if none is found. We should
	// only receive acks for state updates that we send.
	update, ok := session.CommittedUpdates[seqNum]
	if !ok {
		return wtdb.ErrCommittedUpdateNotFound
	}

	// Ensure the returned last applied value does not exceed the highest
	// allocated sequence number.
	if lastApplied > session.SeqNum {
		return wtdb.ErrUnallocatedLastApplied
	}

	// Ensure the last applied value isn't lower than a previous one sent by
	// the tower.
	if lastApplied < session.TowerLastApplied {
		return wtdb.ErrLastAppliedReversion
	}

	// Finally, remove the committed update from disk and mark the update as
	// acked. The tower last applied value is also recorded to send along
	// with the next update.
	delete(session.CommittedUpdates, seqNum)
	session.AckedUpdates[seqNum] = update.BackupID
	session.TowerLastApplied = lastApplied

	return nil
}
949689
func (s *AssociationDescription) SetLastUpdateAssociationDate(v time.Time) *AssociationDescription {
	s.LastUpdateAssociationDate = &v
	return s
}
708686
func (s *DataSource) SetLastUpdatedAt(v time.Time) *DataSource {
	s.LastUpdatedAt = &v
	return s
}
1170029
func (s *GetEvaluationOutput) SetLastUpdatedAt(v time.Time) *GetEvaluationOutput {
	s.LastUpdatedAt = &v
	return s
}
40534
func (so *syncOp) AddSelfUpdate(ptr data.BlockPointer) {
	so.AddUpdate(ptr, ptr)
}
337822
func unacknowledgedUpdates(state *internalState) (result []executor.Call_Update) {
	if n := len(state.unackedUpdates); n > 0 {
		result = make([]executor.Call_Update, 0, n)
		for k := range state.unackedUpdates {
			result = append(result, state.unackedUpdates[k])
		}
	}
	return
}
1040793
func (s *DescribeRobotApplicationOutput) SetLastUpdatedAt(v time.Time) *DescribeRobotApplicationOutput {
	s.LastUpdatedAt = &v
	return s
}
351409
func (ss *SQLSubStore) AckSeqPending(subid, seqno uint64) error {
	var err error
	ss.Lock()
	if !ss.closed {
		if ss.cache != nil {
			var isFull bool
			isFull, err = ss.ackSeq(subid, seqno)
			if err == nil && isFull {
				err = ss.flush()
			}
		} else {
			updateLastSent := false
			ls := ss.subLastSent[subid]
			if seqno >= ls {
				if seqno > ls {
					ss.subLastSent[subid] = seqno
				}
				updateLastSent = true
			}
			if updateLastSent {
				if _, err := ss.sqlStore.preparedStmts[sqlSubUpdateLastSent].Exec(seqno, ss.channelID, subid); err != nil {
					ss.Unlock()
					return sqlStmtError(sqlSubUpdateLastSent, err)
				}
			}
			_, err = ss.sqlStore.preparedStmts[sqlSubDeletePending].Exec(subid, seqno)
			if err != nil {
				err = sqlStmtError(sqlSubDeletePending, err)
			}
		}
	}
	ss.Unlock()
	return err
}
371341
func (s *SimulationApplicationSummary) SetLastUpdatedAt(v time.Time) *SimulationApplicationSummary {
	s.LastUpdatedAt = &v
	return s
}
1336116
func (s *Preset) SetLastUpdated(v time.Time) *Preset {
	s.LastUpdated = &v
	return s
}
1363497
func (s *JobSummary) SetLastUpdatedAt(v time.Time) *JobSummary {
	s.LastUpdatedAt = &v
	return s
}
1221658
func (s *GetBatchPredictionOutput) SetLastUpdatedAt(v time.Time) *GetBatchPredictionOutput {
	s.LastUpdatedAt = &v
	return s
}
1341733
func (s *Job) SetLastUpdatedAt(v time.Time) *Job {
	s.LastUpdatedAt = &v
	return s
}
352771
func (cli *Client) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error {
	if err := cli.NewVersionError("1.30", "config update"); err != nil {
		return err
	}
	query := url.Values{}
	query.Set("version", strconv.FormatUint(version.Index, 10))
	resp, err := cli.post(ctx, "/configs/"+id+"/update", query, config, nil)
	ensureReaderClosed(resp)
	return err
}
1328189
func (s *CreateSimulationApplicationOutput) SetLastUpdatedAt(v time.Time) *CreateSimulationApplicationOutput {
	s.LastUpdatedAt = &v
	return s
}
408569
func (s *UpdateSimulationApplicationOutput) SetLastUpdatedAt(v time.Time) *UpdateSimulationApplicationOutput {
	s.LastUpdatedAt = &v
	return s
}
1098723
func (s *PatchStatus) SetApprovalDate(v time.Time) *PatchStatus {
	s.ApprovalDate = &v
	return s
}