// 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/lex/util"
)

// 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 util.LexClient, did string) (*SyncGetLatestCommit_Output, error) {
	var out SyncGetLatestCommit_Output

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

	return &out, nil
}
