status.go
changeset 162 68df3a01e1a7
parent 161 6786f169b59f
child 188 5f4210c4921a
equal deleted inserted replaced
161:6786f169b59f 162:68df3a01e1a7
     8 
     8 
     9 import (
     9 import (
    10 	"fmt"
    10 	"fmt"
    11 	"strconv"
    11 	"strconv"
    12 
    12 
       
    13 	"github.com/pkg/errors"
    13 	"github.com/sendgrid/rest"
    14 	"github.com/sendgrid/rest"
    14 )
    15 )
    15 
    16 
    16 // updateStatusOptions contains option fields for POST and DELETE API calls
    17 // updateStatusOptions contains option fields for POST and DELETE API calls
    17 type updateStatusOptions struct {
    18 type updateStatusOptions struct {
    95 			// Okay
    96 			// Okay
    96 		default:
    97 		default:
    97 			return ErrInvalidParameter
    98 			return ErrInvalidParameter
    98 		}
    99 		}
    99 		if len(opts.MediaIDs) > 4 {
   100 		if len(opts.MediaIDs) > 4 {
   100 			return fmt.Errorf("too many (>4) media IDs")
   101 			return errors.New("too many (>4) media IDs")
   101 		}
   102 		}
   102 	case "delete":
   103 	case "delete":
   103 		method = rest.Delete
   104 		method = rest.Delete
   104 		if opts.ID < 1 {
   105 		if opts.ID < 1 {
   105 			return ErrInvalidID
   106 			return ErrInvalidID