func (c *ApiService) ListBucket(ServiceSid string, RateLimitSid string, params *ListBucketParams) ([]VerifyV2Bucket, error) {
	if params == nil {
		params = &ListBucketParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageBucket(ServiceSid, RateLimitSid, params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	var records []VerifyV2Bucket
	for response != nil {
		records = append(records, response.Buckets...)
		var record interface{}
		if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListBucketResponse); record == nil || err != nil {
			return records, err
		}
		response = record.(*ListBucketResponse)
	}
	return records, err
}
Lists Bucket records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
package openapi
import (
	"encoding/json"
	"fmt"
	"net/url"
	"strings"
	"github.com/twilio/twilio-go/client"
)
type CreateBucketParams struct {
	Interval *int `json:"Interval,omitempty"`
	Max *int `json:"Max,omitempty"`
}
func (params *CreateBucketParams) SetInterval(Interval int) *CreateBucketParams {
	params.Interval = &Interval
	return params
}
func (params *CreateBucketParams) SetMax(Max int) *CreateBucketParams {
	params.Max = &Max
	return params
}
func (c *ApiService) CreateBucket(ServiceSid string, RateLimitSid string, params *CreateBucketParams) (*VerifyV2Bucket, error) {
	path := "/v2/Services/{ServiceSid}/RateLimits/{RateLimitSid}/Buckets"
	path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1)
	path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.Interval != nil {
		data.Set("Interval", fmt.Sprint(*params.Interval))
	}
	if params != nil && params.Max != nil {
		data.Set("Max", fmt.Sprint(*params.Max))
	}
	resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &VerifyV2Bucket{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) DeleteBucket(ServiceSid string, RateLimitSid string, Sid string) error {
	path := "/v2/Services/{ServiceSid}/RateLimits/{RateLimitSid}/Buckets/{Sid}"
	path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1)
	path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1)
	path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	return nil
}
func (c *ApiService) FetchBucket(ServiceSid string, RateLimitSid string, Sid string) (*VerifyV2Bucket, error) {
	path := "/v2/Services/{ServiceSid}/RateLimits/{RateLimitSid}/Buckets/{Sid}"
	path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1)
	path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1)
	path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &VerifyV2Bucket{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
type ListBucketParams struct {
	PageSize *int `json:"PageSize,omitempty"`
	Limit *int `json:"limit,omitempty"`
}
func (params *ListBucketParams) SetPageSize(PageSize int) *ListBucketParams {
	params.PageSize = &PageSize
	return params
}
func (params *ListBucketParams) SetLimit(Limit int) *ListBucketParams {
	params.Limit = &Limit
	return params
}
func (c *ApiService) PageBucket(ServiceSid string, RateLimitSid string, params *ListBucketParams, pageToken, pageNumber string) (*ListBucketResponse, error) {
	path := "/v2/Services/{ServiceSid}/RateLimits/{RateLimitSid}/Buckets"
	path = strings.Replace(path, "{"+"ServiceSid"+"}", ServiceSid, -1)
	path = strings.Replace(path, "{"+"RateLimitSid"+"}", RateLimitSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.PageSize != nil {
		data.Set("PageSize", fmt.Sprint(*params.PageSize))
	}
	if pageToken != "" {
		data.Set("PageToken", pageToken)
	}
	if pageNumber != "" {
		data.Set("Page", pageNumber)
	}
	resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &ListBucketResponse{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}