Skip to content

Commit f3ff236

Browse files
stainless-app[bot]stainless-bot
authored andcommittedNov 20, 2024·
feat(api): api update (#3632)
1 parent 7a327f0 commit f3ff236

File tree

3 files changed

+13
-129
lines changed

3 files changed

+13
-129
lines changed
 

‎.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1449
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-829ade7062fed63a30accc2a5e1a14c6c26fd4dc003d300d1b25a5416b8b8727.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-47eb882cbdc1acad6371a1827ff0a63b642a7b9a7a61049445cc4c2c4e7b9397.yml

‎api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7487,7 +7487,7 @@ Response Types:
74877487

74887488
Methods:
74897489

7490-
- <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions">client.Workflows.Versions.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, workflowName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows">workflows</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionListParams">VersionListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination#V4PagePagination">V4PagePagination</a>[<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows">workflows</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionListResponse">VersionListResponse</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
7490+
- <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions">client.Workflows.Versions.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionService.List">List</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, workflowName <a href="https://pkg.go.dev/builtin#string">string</a>, params <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows">workflows</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionListParams">VersionListParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination">pagination</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/packages/pagination#V4PagePaginationArray">V4PagePaginationArray</a>[<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows">workflows</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionListResponse">VersionListResponse</a>], <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
74917491
- <code title="get /accounts/{account_id}/workflows/{workflow_name}/versions/{version_id}">client.Workflows.Versions.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionService.Get">Get</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, workflowName <a href="https://pkg.go.dev/builtin#string">string</a>, versionID <a href="https://pkg.go.dev/builtin#string">string</a>, query <a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows">workflows</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionGetParams">VersionGetParams</a>) (<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows">workflows</a>.<a href="https://pkg.go.dev/github.com/cloudflare/cloudflare-go/v3/workflows#VersionGetResponse">VersionGetResponse</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
74927492

74937493
# ResourceSharing

‎workflows/version.go

+11-127
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func NewVersionService(opts ...option.RequestOption) (r *VersionService) {
3838
}
3939

4040
// List deployed Workflow versions
41-
func (r *VersionService) List(ctx context.Context, workflowName string, params VersionListParams, opts ...option.RequestOption) (res *pagination.V4PagePagination[VersionListResponse], err error) {
41+
func (r *VersionService) List(ctx context.Context, workflowName string, params VersionListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[VersionListResponse], err error) {
4242
var raw *http.Response
4343
opts = append(r.Options[:], opts...)
4444
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
@@ -64,8 +64,8 @@ func (r *VersionService) List(ctx context.Context, workflowName string, params V
6464
}
6565

6666
// List deployed Workflow versions
67-
func (r *VersionService) ListAutoPaging(ctx context.Context, workflowName string, params VersionListParams, opts ...option.RequestOption) *pagination.V4PagePaginationAutoPager[VersionListResponse] {
68-
return pagination.NewV4PagePaginationAutoPager(r.List(ctx, workflowName, params, opts...))
67+
func (r *VersionService) ListAutoPaging(ctx context.Context, workflowName string, params VersionListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[VersionListResponse] {
68+
return pagination.NewV4PagePaginationArrayAutoPager(r.List(ctx, workflowName, params, opts...))
6969
}
7070

7171
// Get Workflow version details
@@ -94,92 +94,17 @@ func (r *VersionService) Get(ctx context.Context, workflowName string, versionID
9494
}
9595

9696
type VersionListResponse struct {
97-
Errors []VersionListResponseError `json:"errors,required"`
98-
Messages []VersionListResponseMessage `json:"messages,required"`
99-
Result VersionListResponseResult `json:"result,required"`
100-
Success VersionListResponseSuccess `json:"success,required"`
101-
ResultInfo VersionListResponseResultInfo `json:"result_info"`
102-
JSON versionListResponseJSON `json:"-"`
97+
ID string `json:"id,required" format:"uuid"`
98+
ClassName string `json:"class_name,required"`
99+
CreatedOn time.Time `json:"created_on,required" format:"date-time"`
100+
ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
101+
WorkflowID string `json:"workflow_id,required" format:"uuid"`
102+
JSON versionListResponseJSON `json:"-"`
103103
}
104104

105105
// versionListResponseJSON contains the JSON metadata for the struct
106106
// [VersionListResponse]
107107
type versionListResponseJSON struct {
108-
Errors apijson.Field
109-
Messages apijson.Field
110-
Result apijson.Field
111-
Success apijson.Field
112-
ResultInfo apijson.Field
113-
raw string
114-
ExtraFields map[string]apijson.Field
115-
}
116-
117-
func (r *VersionListResponse) UnmarshalJSON(data []byte) (err error) {
118-
return apijson.UnmarshalRoot(data, r)
119-
}
120-
121-
func (r versionListResponseJSON) RawJSON() string {
122-
return r.raw
123-
}
124-
125-
type VersionListResponseError struct {
126-
Code float64 `json:"code,required"`
127-
Message string `json:"message,required"`
128-
JSON versionListResponseErrorJSON `json:"-"`
129-
}
130-
131-
// versionListResponseErrorJSON contains the JSON metadata for the struct
132-
// [VersionListResponseError]
133-
type versionListResponseErrorJSON struct {
134-
Code apijson.Field
135-
Message apijson.Field
136-
raw string
137-
ExtraFields map[string]apijson.Field
138-
}
139-
140-
func (r *VersionListResponseError) UnmarshalJSON(data []byte) (err error) {
141-
return apijson.UnmarshalRoot(data, r)
142-
}
143-
144-
func (r versionListResponseErrorJSON) RawJSON() string {
145-
return r.raw
146-
}
147-
148-
type VersionListResponseMessage struct {
149-
Code float64 `json:"code,required"`
150-
Message string `json:"message,required"`
151-
JSON versionListResponseMessageJSON `json:"-"`
152-
}
153-
154-
// versionListResponseMessageJSON contains the JSON metadata for the struct
155-
// [VersionListResponseMessage]
156-
type versionListResponseMessageJSON struct {
157-
Code apijson.Field
158-
Message apijson.Field
159-
raw string
160-
ExtraFields map[string]apijson.Field
161-
}
162-
163-
func (r *VersionListResponseMessage) UnmarshalJSON(data []byte) (err error) {
164-
return apijson.UnmarshalRoot(data, r)
165-
}
166-
167-
func (r versionListResponseMessageJSON) RawJSON() string {
168-
return r.raw
169-
}
170-
171-
type VersionListResponseResult struct {
172-
ID string `json:"id,required" format:"uuid"`
173-
ClassName string `json:"class_name,required"`
174-
CreatedOn time.Time `json:"created_on,required" format:"date-time"`
175-
ModifiedOn time.Time `json:"modified_on,required" format:"date-time"`
176-
WorkflowID string `json:"workflow_id,required" format:"uuid"`
177-
JSON versionListResponseResultJSON `json:"-"`
178-
}
179-
180-
// versionListResponseResultJSON contains the JSON metadata for the struct
181-
// [VersionListResponseResult]
182-
type versionListResponseResultJSON struct {
183108
ID apijson.Field
184109
ClassName apijson.Field
185110
CreatedOn apijson.Field
@@ -189,52 +114,11 @@ type versionListResponseResultJSON struct {
189114
ExtraFields map[string]apijson.Field
190115
}
191116

192-
func (r *VersionListResponseResult) UnmarshalJSON(data []byte) (err error) {
193-
return apijson.UnmarshalRoot(data, r)
194-
}
195-
196-
func (r versionListResponseResultJSON) RawJSON() string {
197-
return r.raw
198-
}
199-
200-
type VersionListResponseSuccess bool
201-
202-
const (
203-
VersionListResponseSuccessTrue VersionListResponseSuccess = true
204-
)
205-
206-
func (r VersionListResponseSuccess) IsKnown() bool {
207-
switch r {
208-
case VersionListResponseSuccessTrue:
209-
return true
210-
}
211-
return false
212-
}
213-
214-
type VersionListResponseResultInfo struct {
215-
Count float64 `json:"count,required"`
216-
Page float64 `json:"page,required"`
217-
PerPage float64 `json:"per_page,required"`
218-
TotalCount float64 `json:"total_count,required"`
219-
JSON versionListResponseResultInfoJSON `json:"-"`
220-
}
221-
222-
// versionListResponseResultInfoJSON contains the JSON metadata for the struct
223-
// [VersionListResponseResultInfo]
224-
type versionListResponseResultInfoJSON struct {
225-
Count apijson.Field
226-
Page apijson.Field
227-
PerPage apijson.Field
228-
TotalCount apijson.Field
229-
raw string
230-
ExtraFields map[string]apijson.Field
231-
}
232-
233-
func (r *VersionListResponseResultInfo) UnmarshalJSON(data []byte) (err error) {
117+
func (r *VersionListResponse) UnmarshalJSON(data []byte) (err error) {
234118
return apijson.UnmarshalRoot(data, r)
235119
}
236120

237-
func (r versionListResponseResultInfoJSON) RawJSON() string {
121+
func (r versionListResponseJSON) RawJSON() string {
238122
return r.raw
239123
}
240124

0 commit comments

Comments
 (0)
Please sign in to comment.