Skip to content

Commit 3c68c7a

Browse files
feat(api): api update
1 parent 9fa2a4a commit 3c68c7a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1759
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bb4f00f35d216fc086f41a566a2008bf2d7665f18c9977f0c305df8aa50610f9.yml
3-
openapi_spec_hash: 07db6ce298038f2c1688b7b2ee9f4c43
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9da40dd6e26c12cb5cc2621882e3a721c33102947241937aecf8b1cf1bfd1906.yml
3+
openapi_spec_hash: 8e673d154552fd22c1291dc39644d664
44
config_hash: 920bb1b417565d337cbdb7c39e77be5b

images/v1.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"errors"
99
"fmt"
10+
"io"
1011
"mime/multipart"
1112
"net/http"
1213
"net/url"
@@ -228,9 +229,9 @@ type V1NewParams struct {
228229
// Account identifier tag.
229230
AccountID param.Field[string] `path:"account_id,required"`
230231
// An optional custom unique identifier for your image.
231-
ID param.Field[interface{}] `json:"id"`
232+
ID param.Field[string] `json:"id"`
232233
// An image binary data. Only needed when type is uploading a file.
233-
File param.Field[interface{}] `json:"file"`
234+
File param.Field[io.Reader] `json:"file" format:"binary"`
234235
// User modifiable key-value store. Can use used for keeping references to another
235236
// system of record for managing images.
236237
Metadata param.Field[interface{}] `json:"metadata"`

images/v1_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
package images_test
44

55
import (
6+
"bytes"
67
"context"
78
"errors"
9+
"io"
810
"os"
911
"testing"
1012

@@ -30,8 +32,8 @@ func TestV1NewWithOptionalParams(t *testing.T) {
3032
)
3133
_, err := client.Images.V1.New(context.TODO(), images.V1NewParams{
3234
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
33-
ID: cloudflare.F[any](map[string]interface{}{}),
34-
File: cloudflare.F[any](map[string]interface{}{}),
35+
ID: cloudflare.F("id"),
36+
File: cloudflare.F(io.Reader(bytes.NewBuffer([]byte("some file contents")))),
3537
Metadata: cloudflare.F[any](map[string]interface{}{}),
3638
RequireSignedURLs: cloudflare.F(true),
3739
URL: cloudflare.F("https://example.com/path/to/logo.png"),

0 commit comments

Comments
 (0)