You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: workers_cron_triggers.go
    path of file: ./repos/teller/vendor/github.com/cloudflare/cloudflare-go
    
    the code of the file until where you have to start completion: package cloudflare

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"time"

	"github.com/pkg/errors"
)

// WorkerCronTriggerResponse represents the response from the Worker cron trigger
// API endpoint.
type WorkerCronTriggerResponse struct {
	Response
	Result WorkerCronTriggerSchedules `json:"result"`
}

// WorkerCronTriggerSchedules contains the schedule of Worker cron triggers.
type WorkerCronTriggerSchedules struct {
	Schedules []WorkerCronTrigger `json:"schedules"
    
func (api *API) UpdateWorkerCronTriggers(ctx context.Context, scriptName string, crons []WorkerCronTrigger) ([]WorkerCronTrigger, error) {
	if err := api.checkAccountID(); err != nil {
		return []WorkerCronTrigger{}, err
	}

	uri := fmt.Sprintf("/accounts/%s/workers/scripts/%s/schedules", api.AccountID, scriptName)
	res, err := api.makeRequestContext(ctx, http.MethodPut, uri, crons)
	if err != nil {
		return []WorkerCronTrigger{}, err
	}

	result := WorkerCronTriggerResponse{}
	if err := json.Unmarshal(res, &result); err != nil {
		return []WorkerCronTrigger{}, errors.Wrap(err, errUnmarshalError)
	}

	return result.Result.Schedules, err
}