// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package atproto

// schema: com.atproto.sync.getLatestCommit

import (
	"context"

	"github.com/bluesky-social/indigo/xrpc"
)

// SyncGetLatestCommit_Output is the output of a com.atproto.sync.getLatestCommit call.
type SyncGetLatestCommit_Output struct {
	Cid string `json:"cid" cborgen:"cid"`
	Rev string `json:"rev" cborgen:"rev"`
}

// SyncGetLatestCommit calls the XRPC method "com.atproto.sync.getLatestCommit".
//
// did: The DID of the repo.
func SyncGetLatestCommit(ctx context.Context, c *xrpc.Client, did string) (*SyncGetLatestCommit_Output, error) {
	var out SyncGetLatestCommit_Output

	params := map[string]interface{}{
		"did": did,
	}
	if err := c.Do(ctx, xrpc.Query, "", "com.atproto.sync.getLatestCommit", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}
