-
Notifications
You must be signed in to change notification settings - Fork 90
/
lookupApplicationByID.go
41 lines (32 loc) · 1.24 KB
/
lookupApplicationByID.go
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
package indexer
import (
"context"
"fmt"
"github.com/algorand/go-algorand-sdk/client/v2/common"
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
)
// LookupApplicationByIDParams contains all of the query parameters for url serialization.
type LookupApplicationByIDParams struct {
// IncludeAll include all items including closed accounts, deleted applications,
// destroyed assets, opted-out asset holdings, and closed-out application
// localstates.
IncludeAll bool `url:"include-all,omitempty"`
}
// LookupApplicationByID lookup application.
type LookupApplicationByID struct {
c *Client
applicationId uint64
p LookupApplicationByIDParams
}
// IncludeAll include all items including closed accounts, deleted applications,
// destroyed assets, opted-out asset holdings, and closed-out application
// localstates.
func (s *LookupApplicationByID) IncludeAll(IncludeAll bool) *LookupApplicationByID {
s.p.IncludeAll = IncludeAll
return s
}
// Do performs the HTTP request
func (s *LookupApplicationByID) Do(ctx context.Context, headers ...*common.Header) (response models.ApplicationResponse, err error) {
err = s.c.get(ctx, &response, fmt.Sprintf("/v2/applications/%s", common.EscapeParams(s.applicationId)...), s.p, headers)
return
}