github.com/polygon-io/client-go@v1.16.4/rest/summaries.go (about)

     1  package polygon
     2  
     3  import (
     4  	"context"
     5  	"net/http"
     6  
     7  	"github.com/polygon-io/client-go/rest/client"
     8  	"github.com/polygon-io/client-go/rest/models"
     9  )
    10  
    11  const (
    12  	GetSummariesPath = "/v1/summaries"
    13  )
    14  
    15  // SummariesClient defines a REST client for the Polygon Snapshot Summary API.
    16  type SummariesClient struct {
    17  	client.Client
    18  }
    19  
    20  // GetSummaries retrieves summaries for the ticker list with the given params.
    21  // For more details see https://polygon.io/docs/stocks/get_v1_summaries.
    22  func (ic *SummariesClient) GetSummaries(ctx context.Context, params *models.GetSummaryParams, opts ...models.RequestOption) (*models.GetSummaryResponse, error) {
    23  	res := &models.GetSummaryResponse{}
    24  	err := ic.Call(ctx, http.MethodGet, GetSummariesPath, params, res, opts...)
    25  	return res, err
    26  }