github.com/algorand/go-algorand-sdk@v1.24.0/client/v2/indexer/lookupApplicationLogsByID.go (about)

     1  package indexer
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  
     7  	"github.com/algorand/go-algorand-sdk/client/v2/common"
     8  	"github.com/algorand/go-algorand-sdk/client/v2/common/models"
     9  )
    10  
    11  // LookupApplicationLogsByIDParams contains all of the query parameters for url serialization.
    12  type LookupApplicationLogsByIDParams struct {
    13  
    14  	// Limit maximum number of results to return. There could be additional pages even
    15  	// if the limit is not reached.
    16  	Limit uint64 `url:"limit,omitempty"`
    17  
    18  	// MaxRound include results at or before the specified max-round.
    19  	MaxRound uint64 `url:"max-round,omitempty"`
    20  
    21  	// MinRound include results at or after the specified min-round.
    22  	MinRound uint64 `url:"min-round,omitempty"`
    23  
    24  	// Next the next page of results. Use the next token provided by the previous
    25  	// results.
    26  	Next string `url:"next,omitempty"`
    27  
    28  	// SenderAddress only include transactions with this sender address.
    29  	SenderAddress string `url:"sender-address,omitempty"`
    30  
    31  	// Txid lookup the specific transaction by ID.
    32  	Txid string `url:"txid,omitempty"`
    33  }
    34  
    35  // LookupApplicationLogsByID lookup application logs.
    36  type LookupApplicationLogsByID struct {
    37  	c *Client
    38  
    39  	applicationId uint64
    40  
    41  	p LookupApplicationLogsByIDParams
    42  }
    43  
    44  // Limit maximum number of results to return. There could be additional pages even
    45  // if the limit is not reached.
    46  func (s *LookupApplicationLogsByID) Limit(Limit uint64) *LookupApplicationLogsByID {
    47  	s.p.Limit = Limit
    48  
    49  	return s
    50  }
    51  
    52  // MaxRound include results at or before the specified max-round.
    53  func (s *LookupApplicationLogsByID) MaxRound(MaxRound uint64) *LookupApplicationLogsByID {
    54  	s.p.MaxRound = MaxRound
    55  
    56  	return s
    57  }
    58  
    59  // MinRound include results at or after the specified min-round.
    60  func (s *LookupApplicationLogsByID) MinRound(MinRound uint64) *LookupApplicationLogsByID {
    61  	s.p.MinRound = MinRound
    62  
    63  	return s
    64  }
    65  
    66  // Next the next page of results. Use the next token provided by the previous
    67  // results.
    68  func (s *LookupApplicationLogsByID) Next(Next string) *LookupApplicationLogsByID {
    69  	s.p.Next = Next
    70  
    71  	return s
    72  }
    73  
    74  // SenderAddress only include transactions with this sender address.
    75  func (s *LookupApplicationLogsByID) SenderAddress(SenderAddress string) *LookupApplicationLogsByID {
    76  	s.p.SenderAddress = SenderAddress
    77  
    78  	return s
    79  }
    80  
    81  // Txid lookup the specific transaction by ID.
    82  func (s *LookupApplicationLogsByID) Txid(Txid string) *LookupApplicationLogsByID {
    83  	s.p.Txid = Txid
    84  
    85  	return s
    86  }
    87  
    88  // Do performs the HTTP request
    89  func (s *LookupApplicationLogsByID) Do(ctx context.Context, headers ...*common.Header) (response models.ApplicationLogsResponse, err error) {
    90  	err = s.c.get(ctx, &response, fmt.Sprintf("/v2/applications/%s/logs", common.EscapeParams(s.applicationId)...), s.p, headers)
    91  	return
    92  }