@@ -45,8 +45,8 @@ func NewBetaMessageBatchService(opts ...option.RequestOption) (r *BetaMessageBat
45
45
// once. Once a Message Batch is created, it begins processing immediately. Batches
46
46
// can take up to 24 hours to complete.
47
47
func (r * BetaMessageBatchService ) New (ctx context.Context , params BetaMessageBatchNewParams , opts ... option.RequestOption ) (res * BetaMessageBatch , err error ) {
48
- if params .Betas .Present {
49
- opts = append (opts , option .WithHeader ("betas" , fmt .Sprintf ("%s" , params . Betas )))
48
+ for _ , v := range params .Betas .Value {
49
+ opts = append (opts , option .WithHeaderAdd ("betas" , fmt .Sprintf ("%s" , v )))
50
50
}
51
51
opts = append (r .Options [:], opts ... )
52
52
opts = append ([]option.RequestOption {option .WithHeader ("anthropic-beta" , "message-batches-2024-09-24" )}, opts ... )
@@ -59,8 +59,8 @@ func (r *BetaMessageBatchService) New(ctx context.Context, params BetaMessageBat
59
59
// completion. To access the results of a Message Batch, make a request to the
60
60
// `results_url` field in the response.
61
61
func (r * BetaMessageBatchService ) Get (ctx context.Context , messageBatchID string , query BetaMessageBatchGetParams , opts ... option.RequestOption ) (res * BetaMessageBatch , err error ) {
62
- if query .Betas .Present {
63
- opts = append (opts , option .WithHeader ("betas" , fmt .Sprintf ("%s" , query . Betas )))
62
+ for _ , v := range query .Betas .Value {
63
+ opts = append (opts , option .WithHeaderAdd ("betas" , fmt .Sprintf ("%s" , v )))
64
64
}
65
65
opts = append (r .Options [:], opts ... )
66
66
opts = append ([]option.RequestOption {option .WithHeader ("anthropic-beta" , "message-batches-2024-09-24" )}, opts ... )
@@ -77,8 +77,8 @@ func (r *BetaMessageBatchService) Get(ctx context.Context, messageBatchID string
77
77
// returned first.
78
78
func (r * BetaMessageBatchService ) List (ctx context.Context , params BetaMessageBatchListParams , opts ... option.RequestOption ) (res * pagination.Page [BetaMessageBatch ], err error ) {
79
79
var raw * http.Response
80
- if params .Betas .Present {
81
- opts = append (opts , option .WithHeader ("betas" , fmt .Sprintf ("%s" , params . Betas )))
80
+ for _ , v := range params .Betas .Value {
81
+ opts = append (opts , option .WithHeaderAdd ("betas" , fmt .Sprintf ("%s" , v )))
82
82
}
83
83
opts = append (r .Options [:], opts ... )
84
84
opts = append ([]option.RequestOption {option .WithHeader ("anthropic-beta" , "message-batches-2024-09-24" ), option .WithResponseInto (& raw )}, opts ... )
@@ -105,8 +105,8 @@ func (r *BetaMessageBatchService) ListAutoPaging(ctx context.Context, params Bet
105
105
// completion. To access the results of a Message Batch, make a request to the
106
106
// `results_url` field in the response.
107
107
func (r * BetaMessageBatchService ) Delete (ctx context.Context , messageBatchID string , body BetaMessageBatchDeleteParams , opts ... option.RequestOption ) (res * BetaDeletedMessageBatch , err error ) {
108
- if body .Betas .Present {
109
- opts = append (opts , option .WithHeader ("betas" , fmt .Sprintf ("%s" , body . Betas )))
108
+ for _ , v := range body .Betas .Value {
109
+ opts = append (opts , option .WithHeaderAdd ("betas" , fmt .Sprintf ("%s" , v )))
110
110
}
111
111
opts = append (r .Options [:], opts ... )
112
112
opts = append ([]option.RequestOption {option .WithHeader ("anthropic-beta" , "message-batches-2024-09-24" )}, opts ... )
@@ -129,8 +129,8 @@ func (r *BetaMessageBatchService) Delete(ctx context.Context, messageBatchID str
129
129
// Note that cancellation may not result in any canceled requests if they were
130
130
// non-interruptible.
131
131
func (r * BetaMessageBatchService ) Cancel (ctx context.Context , messageBatchID string , body BetaMessageBatchCancelParams , opts ... option.RequestOption ) (res * BetaMessageBatch , err error ) {
132
- if body .Betas .Present {
133
- opts = append (opts , option .WithHeader ("betas" , fmt .Sprintf ("%s" , body . Betas )))
132
+ for _ , v := range body .Betas .Value {
133
+ opts = append (opts , option .WithHeaderAdd ("betas" , fmt .Sprintf ("%s" , v )))
134
134
}
135
135
opts = append (r .Options [:], opts ... )
136
136
opts = append ([]option.RequestOption {option .WithHeader ("anthropic-beta" , "message-batches-2024-09-24" )}, opts ... )
@@ -149,8 +149,8 @@ func (r *BetaMessageBatchService) Cancel(ctx context.Context, messageBatchID str
149
149
// in the Message Batch. Results are not guaranteed to be in the same order as
150
150
// requests. Use the `custom_id` field to match results to requests.
151
151
func (r * BetaMessageBatchService ) Results (ctx context.Context , messageBatchID string , query BetaMessageBatchResultsParams , opts ... option.RequestOption ) (res * http.Response , err error ) {
152
- if query .Betas .Present {
153
- opts = append (opts , option .WithHeader ("betas" , fmt .Sprintf ("%s" , query . Betas )))
152
+ for _ , v := range query .Betas .Value {
153
+ opts = append (opts , option .WithHeaderAdd ("betas" , fmt .Sprintf ("%s" , v )))
154
154
}
155
155
opts = append (r .Options [:], opts ... )
156
156
opts = append ([]option.RequestOption {option .WithHeader ("anthropic-beta" , "message-batches-2024-09-24" ), option .WithHeader ("Accept" , "application/binary" )}, opts ... )
0 commit comments