<commit_before>package rollbar

import (
	"encoding/json"
	"fmt"
)

type ItemsService struct {
	C *Client
}

type ItemsResponse struct {
	Err    int         `json:"err"`
	Result ItemsResult `json:"result"`
}

type SingleItemResponse struct {
	Err    int  `json:"err"`
	Result Item `json:"result"`
}

type ItemsResult struct {
	Page  int    `json:"page"`
	Items []Item `json:"items"`
}

type Item struct {
	Id                       int    `json:"id"`
	ProjectId                int    `json:"project_id"`
	Title                    string `json:"title"`
	LastOccurrenceId         int    `json:"last_occurrence_id"`
	LastOccurrenceTimestamp  int64  `json:"last_occurrence_timestamp"`
	TotalOccurrences         int    `json:"total_occurrences"`
	FirstOccurrenceId        int    `json:"first_occurrence_id"`
	FirstOccurrenceTimestamp int64  `json:"first_occurrence_timestamp"`
	Status                   string `json:"status"`
	Level                    string `json:"level"`
}

func (i *ItemsService) All() (*ItemsResponse, error) {
	response := &ItemsResponse{}

	body, err := i.C.Request("GET", "items")
	if err != nil {
		return response, err
	}

	defer body.Close()

	err = json.NewDecoder(body).Decode(&response)
	if err != nil {
		return response, err
	}

	return response, nil
}

func (i *ItemsService) GetItem(itemId int) (*SingleItemResponse, error) {
	response := &SingleItemResponse{}

	var url = fmt.Sprintf("items/%v", itemId)
	body, err := i.C.Request("GET", url)
	if err != nil {
		return response, err
	}

	defer body.Close()

	err = json.NewDecoder(body).Decode(&response)
	if err != nil {
		return response, err
	}

	return response, nil
}<commit_msg>rollbar: fix get items route<commit_after>package rollbar

import (
	"encoding/json"
	"fmt"
)

type ItemsService struct {
	C *Client
}

type ItemsResponse struct {
	Err    int         `json:"err"`
	Result ItemsResult `json:"result"`
}

type SingleItemResponse struct {
	Err    int  `json:"err"`
	Result Item `json:"result"`
}

type ItemsResult struct {
	Page  int    `json:"page"`
	Items []Item `json:"items"`
}

type Item struct {
	Id                       int    `json:"id"`
	ProjectId                int    `json:"project_id"`
	Title                    string `json:"title"`
	LastOccurrenceId         int    `json:"last_occurrence_id"`
	LastOccurrenceTimestamp  int64  `json:"last_occurrence_timestamp"`
	TotalOccurrences         int    `json:"total_occurrences"`
	FirstOccurrenceId        int    `json:"first_occurrence_id"`
	FirstOccurrenceTimestamp int64  `json:"first_occurrence_timestamp"`
	Status                   string `json:"status"`
	Level                    string `json:"level"`
}

func (i *ItemsService) All() (*ItemsResponse, error) {
	response := &ItemsResponse{}

	body, err := i.C.Request("GET", "items")
	if err != nil {
		return response, err
	}

	defer body.Close()

	err = json.NewDecoder(body).Decode(&response)
	if err != nil {
		return response, err
	}

	return response, nil
}

func (i *ItemsService) GetItem(itemId int) (*SingleItemResponse, error) {
	response := &SingleItemResponse{}

	var url = fmt.Sprintf("item/%v", itemId)
	body, err := i.C.Request("GET", url)
	if err != nil {
		return response, err
	}

	defer body.Close()

	err = json.NewDecoder(body).Decode(&response)
	if err != nil {
		return response, err
	}

	return response, nil
}
{'fraction_non_alphanumeric': 0.12612342720191733, 'fraction_numerical': 0.002396644697423607, 'mean_word_length': 3.1581569115815693, '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': '3006653', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1057, 'n_words': 278}