<commit_before>package pagerduty

import "net/http"

// AlertsService type
type AlertsService struct {
	client *Client
}

// Alert type
type Alert struct {
	ID                    string            `json:"id,omitempty"`
	Type                  string            `json:"type,omitempty"`
	StartedAt             string            `json:"started_at,omitempty"`
	UUser                 User              `json:"user,omitempty"` // This is conflicting with the package name on assignment in test. Not sure of the soltuion
	Address               string            `json:"address,omitempty"`
}

// Alerts is a list of alerts
type Alerts struct {
	*Pagination
	Alerts []Alert `json:"alerts,omitempty"`
}

// AlertsOptions provides optional parameters to list requests
type AlertsOptions struct {
	Pagination
	Type     string `url:"filter[type],omitempty"` // Can be one of SMS, Email, Phone, or Push
	Timezone string `url:"time_zone,omitempty"`
	Since    string `url:"since,omitempty"`        // Format 2006-01-02T15:04-07:00
	Until    string `url:"until,omitempty"`
}

// List returns a list of alerts
func (s *AlertsService) List(opt *AlertsOptions) ([]Alert, *http.Response, error) {
	u, err := addOptions("alerts", opt)
	if err != nil {
		return nil, nil, err
	}

	alerts := new(Alerts)

	res, err := s.client.Get(u, alerts)
	if err != nil {
		return nil, res, err
	}

	return alerts.Alerts, res, err
}<commit_msg>Updated documentation.<commit_after>package pagerduty

import "net/http"

// AlertsService type
type AlertsService struct {
	client *Client
}

// Alert type
type Alert struct {
	ID                    string            `json:"id,omitempty"`
	Type                  string            `json:"type,omitempty"`
	StartedAt             string            `json:"started_at,omitempty"`
	UUser                 User              `json:"user,omitempty"` // This is conflicting with the package name on assignment in test. Not sure of the soltuion
	Address               string            `json:"address,omitempty"`
}

// Alerts is a list of alerts
type Alerts struct {
	*Pagination
	Alerts []Alert `json:"alerts,omitempty"`
}

// AlertsOptions provides optional parameters to list requests
type AlertsOptions struct {
	Pagination
	Type     string `url:"filter[type],omitempty"` // Can be one of SMS, Email, Phone, or Push
	Timezone string `url:"time_zone,omitempty"`
	Since    string `url:"since,omitempty"`        // Format 2006-01-02T15:04:05-07:00
	Until    string `url:"until,omitempty"`
}

// List returns a list of alerts
func (s *AlertsService) List(opt *AlertsOptions) ([]Alert, *http.Response, error) {
	u, err := addOptions("alerts", opt)
	if err != nil {
		return nil, nil, err
	}

	alerts := new(Alerts)

	res, err := s.client.Get(u, alerts)
	if err != nil {
		return nil, res, err
	}

	return alerts.Alerts, res, err
}
{'fraction_non_alphanumeric': 0.11118980169971672, 'fraction_numerical': 0.012039660056657223, 'mean_word_length': 2.7716955941255006, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7178397', 'n_tokens_mistral': 887, 'n_tokens_neox': 832, 'n_words': 273}