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

     1  package algod
     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  // GetApplicationBoxesParams contains all of the query parameters for url serialization.
    12  type GetApplicationBoxesParams struct {
    13  
    14  	// Max max number of box names to return. If max is not set, or max == 0, returns
    15  	// all box-names.
    16  	Max uint64 `url:"max,omitempty"`
    17  }
    18  
    19  // GetApplicationBoxes given an application ID, return all Box names. No particular
    20  // ordering is guaranteed. Request fails when client or server-side configured
    21  // limits prevent returning all Box names.
    22  type GetApplicationBoxes struct {
    23  	c *Client
    24  
    25  	applicationId uint64
    26  
    27  	p GetApplicationBoxesParams
    28  }
    29  
    30  // Max max number of box names to return. If max is not set, or max == 0, returns
    31  // all box-names.
    32  func (s *GetApplicationBoxes) Max(Max uint64) *GetApplicationBoxes {
    33  	s.p.Max = Max
    34  
    35  	return s
    36  }
    37  
    38  // Do performs the HTTP request
    39  func (s *GetApplicationBoxes) Do(ctx context.Context, headers ...*common.Header) (response models.BoxesResponse, err error) {
    40  	err = s.c.get(ctx, &response, fmt.Sprintf("/v2/applications/%s/boxes", common.EscapeParams(s.applicationId)...), s.p, headers)
    41  	return
    42  }