<commit_before>package gobrightbox

// Volume represents a Brightbox Volume
// https://api.gb1.brightbox.com/1.0/#volume
type Volume struct {
	ID          string
	Name        string
	Status      string
	Description string
	Encrypted   bool
	Size        int
	StorageType string `json:"storage_type"`
	Server      *Server
	Account     *Account
	Image       *Image
}

// VolumeOptions is used to create and update volumes
// create and update servers.
type VolumeOptions struct {
	ID    string  `json:"-"`
	Size  *int    `json:"size,omitempty"`
	Image *string `json:"image,omitempty"`
}

// VolumeResizeOptions is used to change the size of a volume
type VolumeResizeOptions struct {
	From int `json:"from"`
	To   int `json:"to"`
}

// ResizeVolume changes the size of a volume
func (c *Client) ResizeVolume(identifier string, options *VolumeResizeOptions) error {
	_, err := c.MakeAPIRequest("POST", "/1.0/volumes/"+identifier+"/resize", options, nil)
	return err
}<commit_msg>Refactor ResizeVolume<commit_after>package gobrightbox

// Volume represents a Brightbox Volume
// https://api.gb1.brightbox.com/1.0/#volume
type Volume struct {
	ID          string
	Name        string
	Status      string
	Description string
	Encrypted   bool
	Size        int
	StorageType string `json:"storage_type"`
	Server      *Server
	Account     *Account
	Image       *Image
}

// VolumeOptions is used to create and update volumes
// create and update servers.
type VolumeOptions struct {
	ID    string  `json:"-"`
	Size  *int    `json:"size,omitempty"`
	Image *string `json:"image,omitempty"`
}

// ResizeVolume changes the size of a volume
func (c *Client) ResizeVolume(identifier string, oldSize int, newSize int) error {
	options := struct {
		From int `json:"from"`
		To   int `json:"to"`
	}{oldSize, newSize}
	_, err := c.MakeAPIRequest("POST", "/1.0/volumes/"+identifier+"/resize", &options, nil)
	return err
}
{'fraction_non_alphanumeric': 0.10842105263157895, 'fraction_numerical': 0.005263157894736842, 'mean_word_length': 3.451990632318501, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3453171', 'n_tokens_mistral': 573, 'n_tokens_neox': 570, 'n_words': 188}