~james/core

core/api/org_tangled/actorgetProfileActivity.go -rw-r--r-- 3.5 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 14 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package org_tangled

// schema: org.tangled.actor.getProfileActivity

import (
	"context"

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

const (
	ActorGetProfileActivityNSID = "org.tangled.actor.getProfileActivity"
)

// ActorGetProfileActivity_ActivityMonth is a "activityMonth" in the org.tangled.actor.getProfileActivity schema.
type ActorGetProfileActivity_ActivityMonth struct {
	Commits int64                                    `json:"commits" cborgen:"commits"`
	Issues  []*ActorGetProfileActivity_IssueActivity `json:"issues" cborgen:"issues"`
	Pulls   []*ActorGetProfileActivity_PullActivity  `json:"pulls" cborgen:"pulls"`
	Repos   []*ActorGetProfileActivity_RepoActivity  `json:"repos" cborgen:"repos"`
	// start: Start of this UTC calendar month.
	Start string `json:"start" cborgen:"start"`
}

// ActorGetProfileActivity_IssueActivity is a "issueActivity" in the org.tangled.actor.getProfileActivity schema.
type ActorGetProfileActivity_IssueActivity struct {
	Repo  *ActorGetProfileActivity_RepoRef `json:"repo" cborgen:"repo"`
	State string                           `json:"state" cborgen:"state"`
	Title string                           `json:"title" cborgen:"title"`
	Uri   string                           `json:"uri" cborgen:"uri"`
}

// ActorGetProfileActivity_Output is the output of a org.tangled.actor.getProfileActivity call.
type ActorGetProfileActivity_Output struct {
	Months []*ActorGetProfileActivity_ActivityMonth `json:"months" cborgen:"months"`
	// truncated: True when the result reached the server activity-item safety limit.
	Truncated bool `json:"truncated" cborgen:"truncated"`
}

// ActorGetProfileActivity_PullActivity is a "pullActivity" in the org.tangled.actor.getProfileActivity schema.
type ActorGetProfileActivity_PullActivity struct {
	Repo  *ActorGetProfileActivity_RepoRef `json:"repo" cborgen:"repo"`
	State string                           `json:"state" cborgen:"state"`
	Title string                           `json:"title" cborgen:"title"`
	Uri   string                           `json:"uri" cborgen:"uri"`
}

// ActorGetProfileActivity_RepoActivity is a "repoActivity" in the org.tangled.actor.getProfileActivity schema.
type ActorGetProfileActivity_RepoActivity struct {
	Kind string                           `json:"kind" cborgen:"kind"`
	Repo *ActorGetProfileActivity_RepoRef `json:"repo" cborgen:"repo"`
}

// ActorGetProfileActivity_RepoRef is a "repoRef" in the org.tangled.actor.getProfileActivity schema.
type ActorGetProfileActivity_RepoRef struct {
	Did         *string `json:"did,omitempty" cborgen:"did,omitempty"`
	Name        string  `json:"name" cborgen:"name"`
	OwnerDid    string  `json:"ownerDid" cborgen:"ownerDid"`
	OwnerHandle string  `json:"ownerHandle" cborgen:"ownerHandle"`
	Uri         string  `json:"uri" cborgen:"uri"`
}

// ActorGetProfileActivity calls the XRPC method "org.tangled.actor.getProfileActivity".
//
// actor: Actor whose activity to return.
// months: Number of UTC calendar months to include, including the current month.
func ActorGetProfileActivity(ctx context.Context, c util.LexClient, actor string, months int64) (*ActorGetProfileActivity_Output, error) {
	var out ActorGetProfileActivity_Output

	params := map[string]interface{}{}
	params["actor"] = actor
	if months != 0 {
		params["months"] = months
	}
	if err := c.LexDo(ctx, util.Query, "", "org.tangled.actor.getProfileActivity", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}