<commit_before>package lib

import "fmt"

type requestError struct {
	statusCode int
	body       string
}

func newRequestError(statusCode int, body string) *requestError {
	return &requestError{
		statusCode: statusCode,
		body:       body,
	}
}

func (r *requestError) Error() string {
	return fmt.Sprintf("Request error. Status code: %d. Body: %s", r.statusCode, r.body)
}

//ClanPayload maps the payload for the Create Clan route and Update Clan route
type ClanPayload struct {
	PublicID         string      `json:"publicID,omitempty"`
	Name             string      `json:"name"`
	OwnerPublicID    string      `json:"ownerPublicID"`
	Metadata         interface{} `json:"metadata"`
	AllowApplication bool        `json:"allowApplication"`
	AutoJoin         bool        `json:"autoJoin"`
}

// Player defines the struct returned by the khan API for retrieve player
type Player struct {
	PublicID    string              `json:"publicID"`<commit_msg>Status method on lib err<commit_after>package lib

import "fmt"

// RequestError contains code and body of a request that failed
type RequestError struct {
	statusCode int
	body       string
}

func newRequestError(statusCode int, body string) *RequestError {
	return &RequestError{
		statusCode: statusCode,
		body:       body,
	}
}

func (r *RequestError) Error() string {
	return fmt.Sprintf("Request error. Status code: %d. Body: %s", r.statusCode, r.body)
}

//Status returns the status code of the error
func (r *RequestError) Status() int {
	return r.statusCode
}

//ClanPayload maps the payload for the Create Clan route and Update Clan route
type ClanPayload struct {
	PublicID         string      `json:"publicID,omitempty"`
	Name             string      `json:"name"`
	OwnerPublicID    string      `json:"ownerPublicID"`
	Metadata         interface{} `json:"metadata"`
	AllowApplication bool        `json:"allowApplication"`
	AutoJoin         bool        `json:"autoJoin"`
}

// Player defines the struct returned by the khan API for retrieve player
type Player struct {
	PublicID    string              `json:"publicID"`
{'fraction_non_alphanumeric': 0.08938010571840461, 'fraction_numerical': 0.0, 'mean_word_length': 3.214574898785425, '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': '3043851', 'n_tokens_mistral': 584, 'n_tokens_neox': 579, 'n_words': 208}