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

package atproto

// schema: com.atproto.sync.getRepoStatus

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

// SyncGetRepoStatus_Output is the output of a com.atproto.sync.getRepoStatus call.
type SyncGetRepoStatus_Output struct {
	Active bool   `json:"active" cborgen:"active"`
	Did    string `json:"did" cborgen:"did"`
	// rev: Optional field, the current rev of the repo, if active=true
	Rev *string `json:"rev,omitempty" cborgen:"rev,omitempty"`
	// status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted.
	Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
}

// SyncGetRepoStatus calls the XRPC method "com.atproto.sync.getRepoStatus".
//
// did: The DID of the repo.
func SyncGetRepoStatus(ctx context.Context, c util.LexClient, did string) (*SyncGetRepoStatus_Output, error) {
	var out SyncGetRepoStatus_Output

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

	return &out, nil
}
