Skip to content

Commit f366653

Browse files
feat(api): api update
1 parent db03de7 commit f366653

File tree

4 files changed

+3
-402
lines changed

4 files changed

+3
-402
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1808
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ff88658548577389a348a8beea805d3d0acd6ca847c4b612b4bb3b1aee28044.yml
3-
openapi_spec_hash: 817d5f31e18225d119be2e6b46ce52a4
1+
configured_endpoints: 1806
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-074798acdc9c8a7de78c8667d80911a6415eb6898ccd2f6dbb5636c810cbfe15.yml
3+
openapi_spec_hash: 096e417cb1f4c6e194ca24dfce55a976
44
config_hash: 03215e1e2607cd36fdac96c1ef923317

api.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4473,13 +4473,10 @@ Methods:
44734473

44744474
Response Types:
44754475

4476-
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadNewResponse">DownloadNewResponse</a>
44774476
- <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadGetResponse">DownloadGetResponse</a>
44784477

44794478
Methods:
44804479

4481-
- <code title="post /accounts/{account_id}/stream/{identifier}/downloads">client.Stream.Downloads.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadService.New">New</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadNewParams">DownloadNewParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadNewResponse">DownloadNewResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
4482-
- <code title="delete /accounts/{account_id}/stream/{identifier}/downloads">client.Stream.Downloads.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadService.Delete">Delete</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, body <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadDeleteParams">DownloadDeleteParams</a>) (<a href="https://pkg.go.dev/builtin#string">string</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
44834480
- <code title="get /accounts/{account_id}/stream/{identifier}/downloads">client.Stream.Downloads.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, identifier <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadGetParams">DownloadGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream">stream</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v5/stream#DownloadGetResponse">DownloadGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
44844481

44854482
## Embed

stream/download.go

Lines changed: 0 additions & 337 deletions
Original file line numberDiff line numberDiff line change
@@ -33,48 +33,6 @@ func NewDownloadService(opts ...option.RequestOption) (r *DownloadService) {
3333
return
3434
}
3535

36-
// Creates a download for a video when a video is ready to view.
37-
func (r *DownloadService) New(ctx context.Context, identifier string, params DownloadNewParams, opts ...option.RequestOption) (res *DownloadNewResponse, err error) {
38-
var env DownloadNewResponseEnvelope
39-
opts = append(r.Options[:], opts...)
40-
if params.AccountID.Value == "" {
41-
err = errors.New("missing required account_id parameter")
42-
return
43-
}
44-
if identifier == "" {
45-
err = errors.New("missing required identifier parameter")
46-
return
47-
}
48-
path := fmt.Sprintf("accounts/%s/stream/%s/downloads", params.AccountID, identifier)
49-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &env, opts...)
50-
if err != nil {
51-
return
52-
}
53-
res = &env.Result
54-
return
55-
}
56-
57-
// Delete the downloads for a video.
58-
func (r *DownloadService) Delete(ctx context.Context, identifier string, body DownloadDeleteParams, opts ...option.RequestOption) (res *string, err error) {
59-
var env DownloadDeleteResponseEnvelope
60-
opts = append(r.Options[:], opts...)
61-
if body.AccountID.Value == "" {
62-
err = errors.New("missing required account_id parameter")
63-
return
64-
}
65-
if identifier == "" {
66-
err = errors.New("missing required identifier parameter")
67-
return
68-
}
69-
path := fmt.Sprintf("accounts/%s/stream/%s/downloads", body.AccountID, identifier)
70-
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, nil, &env, opts...)
71-
if err != nil {
72-
return
73-
}
74-
res = &env.Result
75-
return
76-
}
77-
7836
// Lists the downloads created for a video.
7937
func (r *DownloadService) Get(ctx context.Context, identifier string, query DownloadGetParams, opts ...option.RequestOption) (res *DownloadGetResponse, err error) {
8038
var env DownloadGetResponseEnvelope
@@ -96,303 +54,8 @@ func (r *DownloadService) Get(ctx context.Context, identifier string, query Down
9654
return
9755
}
9856

99-
type DownloadNewResponse = interface{}
100-
10157
type DownloadGetResponse = interface{}
10258

103-
type DownloadNewParams struct {
104-
// Identifier.
105-
AccountID param.Field[string] `path:"account_id,required"`
106-
Body interface{} `json:"body,required"`
107-
}
108-
109-
func (r DownloadNewParams) MarshalJSON() (data []byte, err error) {
110-
return apijson.MarshalRoot(r.Body)
111-
}
112-
113-
type DownloadNewResponseEnvelope struct {
114-
Errors []DownloadNewResponseEnvelopeErrors `json:"errors,required"`
115-
Messages []DownloadNewResponseEnvelopeMessages `json:"messages,required"`
116-
// Whether the API call was successful.
117-
Success DownloadNewResponseEnvelopeSuccess `json:"success,required"`
118-
Result DownloadNewResponse `json:"result"`
119-
JSON downloadNewResponseEnvelopeJSON `json:"-"`
120-
}
121-
122-
// downloadNewResponseEnvelopeJSON contains the JSON metadata for the struct
123-
// [DownloadNewResponseEnvelope]
124-
type downloadNewResponseEnvelopeJSON struct {
125-
Errors apijson.Field
126-
Messages apijson.Field
127-
Success apijson.Field
128-
Result apijson.Field
129-
raw string
130-
ExtraFields map[string]apijson.Field
131-
}
132-
133-
func (r *DownloadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
134-
return apijson.UnmarshalRoot(data, r)
135-
}
136-
137-
func (r downloadNewResponseEnvelopeJSON) RawJSON() string {
138-
return r.raw
139-
}
140-
141-
type DownloadNewResponseEnvelopeErrors struct {
142-
Code int64 `json:"code,required"`
143-
Message string `json:"message,required"`
144-
DocumentationURL string `json:"documentation_url"`
145-
Source DownloadNewResponseEnvelopeErrorsSource `json:"source"`
146-
JSON downloadNewResponseEnvelopeErrorsJSON `json:"-"`
147-
}
148-
149-
// downloadNewResponseEnvelopeErrorsJSON contains the JSON metadata for the struct
150-
// [DownloadNewResponseEnvelopeErrors]
151-
type downloadNewResponseEnvelopeErrorsJSON struct {
152-
Code apijson.Field
153-
Message apijson.Field
154-
DocumentationURL apijson.Field
155-
Source apijson.Field
156-
raw string
157-
ExtraFields map[string]apijson.Field
158-
}
159-
160-
func (r *DownloadNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
161-
return apijson.UnmarshalRoot(data, r)
162-
}
163-
164-
func (r downloadNewResponseEnvelopeErrorsJSON) RawJSON() string {
165-
return r.raw
166-
}
167-
168-
type DownloadNewResponseEnvelopeErrorsSource struct {
169-
Pointer string `json:"pointer"`
170-
JSON downloadNewResponseEnvelopeErrorsSourceJSON `json:"-"`
171-
}
172-
173-
// downloadNewResponseEnvelopeErrorsSourceJSON contains the JSON metadata for the
174-
// struct [DownloadNewResponseEnvelopeErrorsSource]
175-
type downloadNewResponseEnvelopeErrorsSourceJSON struct {
176-
Pointer apijson.Field
177-
raw string
178-
ExtraFields map[string]apijson.Field
179-
}
180-
181-
func (r *DownloadNewResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
182-
return apijson.UnmarshalRoot(data, r)
183-
}
184-
185-
func (r downloadNewResponseEnvelopeErrorsSourceJSON) RawJSON() string {
186-
return r.raw
187-
}
188-
189-
type DownloadNewResponseEnvelopeMessages struct {
190-
Code int64 `json:"code,required"`
191-
Message string `json:"message,required"`
192-
DocumentationURL string `json:"documentation_url"`
193-
Source DownloadNewResponseEnvelopeMessagesSource `json:"source"`
194-
JSON downloadNewResponseEnvelopeMessagesJSON `json:"-"`
195-
}
196-
197-
// downloadNewResponseEnvelopeMessagesJSON contains the JSON metadata for the
198-
// struct [DownloadNewResponseEnvelopeMessages]
199-
type downloadNewResponseEnvelopeMessagesJSON struct {
200-
Code apijson.Field
201-
Message apijson.Field
202-
DocumentationURL apijson.Field
203-
Source apijson.Field
204-
raw string
205-
ExtraFields map[string]apijson.Field
206-
}
207-
208-
func (r *DownloadNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
209-
return apijson.UnmarshalRoot(data, r)
210-
}
211-
212-
func (r downloadNewResponseEnvelopeMessagesJSON) RawJSON() string {
213-
return r.raw
214-
}
215-
216-
type DownloadNewResponseEnvelopeMessagesSource struct {
217-
Pointer string `json:"pointer"`
218-
JSON downloadNewResponseEnvelopeMessagesSourceJSON `json:"-"`
219-
}
220-
221-
// downloadNewResponseEnvelopeMessagesSourceJSON contains the JSON metadata for the
222-
// struct [DownloadNewResponseEnvelopeMessagesSource]
223-
type downloadNewResponseEnvelopeMessagesSourceJSON struct {
224-
Pointer apijson.Field
225-
raw string
226-
ExtraFields map[string]apijson.Field
227-
}
228-
229-
func (r *DownloadNewResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
230-
return apijson.UnmarshalRoot(data, r)
231-
}
232-
233-
func (r downloadNewResponseEnvelopeMessagesSourceJSON) RawJSON() string {
234-
return r.raw
235-
}
236-
237-
// Whether the API call was successful.
238-
type DownloadNewResponseEnvelopeSuccess bool
239-
240-
const (
241-
DownloadNewResponseEnvelopeSuccessTrue DownloadNewResponseEnvelopeSuccess = true
242-
)
243-
244-
func (r DownloadNewResponseEnvelopeSuccess) IsKnown() bool {
245-
switch r {
246-
case DownloadNewResponseEnvelopeSuccessTrue:
247-
return true
248-
}
249-
return false
250-
}
251-
252-
type DownloadDeleteParams struct {
253-
// Identifier.
254-
AccountID param.Field[string] `path:"account_id,required"`
255-
}
256-
257-
type DownloadDeleteResponseEnvelope struct {
258-
Errors []DownloadDeleteResponseEnvelopeErrors `json:"errors,required"`
259-
Messages []DownloadDeleteResponseEnvelopeMessages `json:"messages,required"`
260-
// Whether the API call was successful.
261-
Success DownloadDeleteResponseEnvelopeSuccess `json:"success,required"`
262-
Result string `json:"result"`
263-
JSON downloadDeleteResponseEnvelopeJSON `json:"-"`
264-
}
265-
266-
// downloadDeleteResponseEnvelopeJSON contains the JSON metadata for the struct
267-
// [DownloadDeleteResponseEnvelope]
268-
type downloadDeleteResponseEnvelopeJSON struct {
269-
Errors apijson.Field
270-
Messages apijson.Field
271-
Success apijson.Field
272-
Result apijson.Field
273-
raw string
274-
ExtraFields map[string]apijson.Field
275-
}
276-
277-
func (r *DownloadDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error) {
278-
return apijson.UnmarshalRoot(data, r)
279-
}
280-
281-
func (r downloadDeleteResponseEnvelopeJSON) RawJSON() string {
282-
return r.raw
283-
}
284-
285-
type DownloadDeleteResponseEnvelopeErrors struct {
286-
Code int64 `json:"code,required"`
287-
Message string `json:"message,required"`
288-
DocumentationURL string `json:"documentation_url"`
289-
Source DownloadDeleteResponseEnvelopeErrorsSource `json:"source"`
290-
JSON downloadDeleteResponseEnvelopeErrorsJSON `json:"-"`
291-
}
292-
293-
// downloadDeleteResponseEnvelopeErrorsJSON contains the JSON metadata for the
294-
// struct [DownloadDeleteResponseEnvelopeErrors]
295-
type downloadDeleteResponseEnvelopeErrorsJSON struct {
296-
Code apijson.Field
297-
Message apijson.Field
298-
DocumentationURL apijson.Field
299-
Source apijson.Field
300-
raw string
301-
ExtraFields map[string]apijson.Field
302-
}
303-
304-
func (r *DownloadDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error) {
305-
return apijson.UnmarshalRoot(data, r)
306-
}
307-
308-
func (r downloadDeleteResponseEnvelopeErrorsJSON) RawJSON() string {
309-
return r.raw
310-
}
311-
312-
type DownloadDeleteResponseEnvelopeErrorsSource struct {
313-
Pointer string `json:"pointer"`
314-
JSON downloadDeleteResponseEnvelopeErrorsSourceJSON `json:"-"`
315-
}
316-
317-
// downloadDeleteResponseEnvelopeErrorsSourceJSON contains the JSON metadata for
318-
// the struct [DownloadDeleteResponseEnvelopeErrorsSource]
319-
type downloadDeleteResponseEnvelopeErrorsSourceJSON struct {
320-
Pointer apijson.Field
321-
raw string
322-
ExtraFields map[string]apijson.Field
323-
}
324-
325-
func (r *DownloadDeleteResponseEnvelopeErrorsSource) UnmarshalJSON(data []byte) (err error) {
326-
return apijson.UnmarshalRoot(data, r)
327-
}
328-
329-
func (r downloadDeleteResponseEnvelopeErrorsSourceJSON) RawJSON() string {
330-
return r.raw
331-
}
332-
333-
type DownloadDeleteResponseEnvelopeMessages struct {
334-
Code int64 `json:"code,required"`
335-
Message string `json:"message,required"`
336-
DocumentationURL string `json:"documentation_url"`
337-
Source DownloadDeleteResponseEnvelopeMessagesSource `json:"source"`
338-
JSON downloadDeleteResponseEnvelopeMessagesJSON `json:"-"`
339-
}
340-
341-
// downloadDeleteResponseEnvelopeMessagesJSON contains the JSON metadata for the
342-
// struct [DownloadDeleteResponseEnvelopeMessages]
343-
type downloadDeleteResponseEnvelopeMessagesJSON struct {
344-
Code apijson.Field
345-
Message apijson.Field
346-
DocumentationURL apijson.Field
347-
Source apijson.Field
348-
raw string
349-
ExtraFields map[string]apijson.Field
350-
}
351-
352-
func (r *DownloadDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error) {
353-
return apijson.UnmarshalRoot(data, r)
354-
}
355-
356-
func (r downloadDeleteResponseEnvelopeMessagesJSON) RawJSON() string {
357-
return r.raw
358-
}
359-
360-
type DownloadDeleteResponseEnvelopeMessagesSource struct {
361-
Pointer string `json:"pointer"`
362-
JSON downloadDeleteResponseEnvelopeMessagesSourceJSON `json:"-"`
363-
}
364-
365-
// downloadDeleteResponseEnvelopeMessagesSourceJSON contains the JSON metadata for
366-
// the struct [DownloadDeleteResponseEnvelopeMessagesSource]
367-
type downloadDeleteResponseEnvelopeMessagesSourceJSON struct {
368-
Pointer apijson.Field
369-
raw string
370-
ExtraFields map[string]apijson.Field
371-
}
372-
373-
func (r *DownloadDeleteResponseEnvelopeMessagesSource) UnmarshalJSON(data []byte) (err error) {
374-
return apijson.UnmarshalRoot(data, r)
375-
}
376-
377-
func (r downloadDeleteResponseEnvelopeMessagesSourceJSON) RawJSON() string {
378-
return r.raw
379-
}
380-
381-
// Whether the API call was successful.
382-
type DownloadDeleteResponseEnvelopeSuccess bool
383-
384-
const (
385-
DownloadDeleteResponseEnvelopeSuccessTrue DownloadDeleteResponseEnvelopeSuccess = true
386-
)
387-
388-
func (r DownloadDeleteResponseEnvelopeSuccess) IsKnown() bool {
389-
switch r {
390-
case DownloadDeleteResponseEnvelopeSuccessTrue:
391-
return true
392-
}
393-
return false
394-
}
395-
39659
type DownloadGetParams struct {
39760
// Identifier.
39861
AccountID param.Field[string] `path:"account_id,required"`

0 commit comments

Comments
 (0)