Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #3171

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1330
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-99efdcf5060f25ba1576729a151acb2726725a177dca035edc656df1c7bfdf0b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6a6cdd177549929eb7cd114d80ea1dac5ffd4e70b7f48f8aa8d590590c5c8448.yml
45 changes: 4 additions & 41 deletions dns/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,15 +808,17 @@ type RecordListParams struct {
// Identifier
ZoneID param.Field[string] `path:"zone_id,required"`
Comment param.Field[RecordListParamsComment] `query:"comment"`
Content param.Field[RecordListParamsContent] `query:"content"`
// DNS record content.
Content param.Field[string] `query:"content"`
// Direction to order DNS records in.
Direction param.Field[shared.SortDirection] `query:"direction"`
// Whether to match all search requirements or at least one (any). If set to `all`,
// acts like a logical AND between filters. If set to `any`, acts like a logical OR
// instead. Note that the interaction between tag filters is controlled by the
// `tag-match` parameter instead.
Match param.Field[RecordListParamsMatch] `query:"match"`
Name param.Field[RecordListParamsName] `query:"name"`
// DNS record name (or @ for the zone apex) in Punycode.
Name param.Field[string] `query:"name"`
// Field to order DNS records by.
Order param.Field[RecordListParamsOrder] `query:"order"`
// Page number of paginated results.
Expand Down Expand Up @@ -874,26 +876,6 @@ func (r RecordListParamsComment) URLQuery() (v url.Values) {
})
}

type RecordListParamsContent struct {
// Substring of the DNS record content. Content filters are case-insensitive.
Contains param.Field[string] `query:"contains"`
// Suffix of the DNS record content. Content filters are case-insensitive.
Endswith param.Field[string] `query:"endswith"`
// Exact value of the DNS record content. Content filters are case-insensitive.
Exact param.Field[string] `query:"exact"`
// Prefix of the DNS record content. Content filters are case-insensitive.
Startswith param.Field[string] `query:"startswith"`
}

// URLQuery serializes [RecordListParamsContent]'s query parameters as
// `url.Values`.
func (r RecordListParamsContent) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatDots,
})
}

// Whether to match all search requirements or at least one (any). If set to `all`,
// acts like a logical AND between filters. If set to `any`, acts like a logical OR
// instead. Note that the interaction between tag filters is controlled by the
Expand All @@ -913,25 +895,6 @@ func (r RecordListParamsMatch) IsKnown() bool {
return false
}

type RecordListParamsName struct {
// Substring of the DNS record name. Name filters are case-insensitive.
Contains param.Field[string] `query:"contains"`
// Suffix of the DNS record name. Name filters are case-insensitive.
Endswith param.Field[string] `query:"endswith"`
// Exact value of the DNS record name. Name filters are case-insensitive.
Exact param.Field[string] `query:"exact"`
// Prefix of the DNS record name. Name filters are case-insensitive.
Startswith param.Field[string] `query:"startswith"`
}

// URLQuery serializes [RecordListParamsName]'s query parameters as `url.Values`.
func (r RecordListParamsName) URLQuery() (v url.Values) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatDots,
})
}

// Field to order DNS records by.
type RecordListParamsOrder string

Expand Down
24 changes: 7 additions & 17 deletions dns/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,25 +110,15 @@ func TestRecordListWithOptionalParams(t *testing.T) {
Present: cloudflare.F("present"),
Startswith: cloudflare.F("Hello, w"),
}),
Content: cloudflare.F(dns.RecordListParamsContent{
Contains: cloudflare.F("7.0.0."),
Endswith: cloudflare.F(".0.1"),
Exact: cloudflare.F("127.0.0.1"),
Startswith: cloudflare.F("127.0."),
}),
Content: cloudflare.F("127.0.0.1"),
Direction: cloudflare.F(shared.SortDirectionAsc),
Match: cloudflare.F(dns.RecordListParamsMatchAny),
Name: cloudflare.F(dns.RecordListParamsName{
Contains: cloudflare.F("w.example."),
Endswith: cloudflare.F(".example.com"),
Exact: cloudflare.F("www.example.com"),
Startswith: cloudflare.F("www.example"),
}),
Order: cloudflare.F(dns.RecordListParamsOrderType),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
Proxied: cloudflare.F(true),
Search: cloudflare.F("www.cloudflare.com"),
Name: cloudflare.F("example.com"),
Order: cloudflare.F(dns.RecordListParamsOrderType),
Page: cloudflare.F(1.000000),
PerPage: cloudflare.F(5.000000),
Proxied: cloudflare.F(true),
Search: cloudflare.F("www.cloudflare.com"),
Tag: cloudflare.F(dns.RecordListParamsTag{
Absent: cloudflare.F("important"),
Contains: cloudflare.F("greeting:ello, worl"),
Expand Down
6 changes: 3 additions & 3 deletions event_notifications/r2configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ func (r R2ConfigurationGetResponseItemRulesAction) IsKnown() bool {
}

type R2ConfigurationGetParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
}

type R2ConfigurationGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result R2ConfigurationGetResponse `json:"result,required"`
// Whether the API call was successful.
// Whether the API call was successful
Success R2ConfigurationGetResponseEnvelopeSuccess `json:"success,required"`
JSON r2ConfigurationGetResponseEnvelopeJSON `json:"-"`
}
Expand All @@ -164,7 +164,7 @@ func (r r2ConfigurationGetResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type R2ConfigurationGetResponseEnvelopeSuccess bool

const (
Expand Down
12 changes: 6 additions & 6 deletions event_notifications/r2configurationqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (r R2ConfigurationQueueDeleteResponseArray) ImplementsEventNotificationsR2C
}

type R2ConfigurationQueueUpdateParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// Array of rules to drive notifications
Rules param.Field[[]R2ConfigurationQueueUpdateParamsRule] `json:"rules"`
Expand Down Expand Up @@ -181,7 +181,7 @@ type R2ConfigurationQueueUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result R2ConfigurationQueueUpdateResponse `json:"result,required"`
// Whether the API call was successful.
// Whether the API call was successful
Success R2ConfigurationQueueUpdateResponseEnvelopeSuccess `json:"success,required"`
JSON r2ConfigurationQueueUpdateResponseEnvelopeJSON `json:"-"`
}
Expand All @@ -205,7 +205,7 @@ func (r r2ConfigurationQueueUpdateResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type R2ConfigurationQueueUpdateResponseEnvelopeSuccess bool

const (
Expand All @@ -221,15 +221,15 @@ func (r R2ConfigurationQueueUpdateResponseEnvelopeSuccess) IsKnown() bool {
}

type R2ConfigurationQueueDeleteParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
}

type R2ConfigurationQueueDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result R2ConfigurationQueueDeleteResponseUnion `json:"result,required"`
// Whether the API call was successful.
// Whether the API call was successful
Success R2ConfigurationQueueDeleteResponseEnvelopeSuccess `json:"success,required"`
JSON r2ConfigurationQueueDeleteResponseEnvelopeJSON `json:"-"`
}
Expand All @@ -253,7 +253,7 @@ func (r r2ConfigurationQueueDeleteResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type R2ConfigurationQueueDeleteResponseEnvelopeSuccess bool

const (
Expand Down
24 changes: 12 additions & 12 deletions queues/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ type ConsumerDeleteResponseArray []interface{}
func (r ConsumerDeleteResponseArray) ImplementsQueuesConsumerDeleteResponseUnion() {}

type ConsumerNewParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}
Expand All @@ -337,7 +337,7 @@ type ConsumerNewResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ConsumerNewResponse `json:"result,required,nullable"`
// Whether the API call was successful.
// Whether the API call was successful
Success ConsumerNewResponseEnvelopeSuccess `json:"success,required"`
ResultInfo ConsumerNewResponseEnvelopeResultInfo `json:"result_info"`
JSON consumerNewResponseEnvelopeJSON `json:"-"`
Expand All @@ -363,7 +363,7 @@ func (r consumerNewResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type ConsumerNewResponseEnvelopeSuccess bool

const (
Expand Down Expand Up @@ -410,7 +410,7 @@ func (r consumerNewResponseEnvelopeResultInfoJSON) RawJSON() string {
}

type ConsumerUpdateParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Body interface{} `json:"body,required"`
}
Expand All @@ -423,7 +423,7 @@ type ConsumerUpdateResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ConsumerUpdateResponse `json:"result,required,nullable"`
// Whether the API call was successful.
// Whether the API call was successful
Success ConsumerUpdateResponseEnvelopeSuccess `json:"success,required"`
ResultInfo ConsumerUpdateResponseEnvelopeResultInfo `json:"result_info"`
JSON consumerUpdateResponseEnvelopeJSON `json:"-"`
Expand All @@ -449,7 +449,7 @@ func (r consumerUpdateResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type ConsumerUpdateResponseEnvelopeSuccess bool

const (
Expand Down Expand Up @@ -496,15 +496,15 @@ func (r consumerUpdateResponseEnvelopeResultInfoJSON) RawJSON() string {
}

type ConsumerDeleteParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
}

type ConsumerDeleteResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result ConsumerDeleteResponseUnion `json:"result,required,nullable"`
// Whether the API call was successful.
// Whether the API call was successful
Success ConsumerDeleteResponseEnvelopeSuccess `json:"success,required"`
ResultInfo ConsumerDeleteResponseEnvelopeResultInfo `json:"result_info"`
JSON consumerDeleteResponseEnvelopeJSON `json:"-"`
Expand All @@ -530,7 +530,7 @@ func (r consumerDeleteResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type ConsumerDeleteResponseEnvelopeSuccess bool

const (
Expand Down Expand Up @@ -577,15 +577,15 @@ func (r consumerDeleteResponseEnvelopeResultInfoJSON) RawJSON() string {
}

type ConsumerGetParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
}

type ConsumerGetResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result []Consumer `json:"result,required,nullable"`
// Whether the API call was successful.
// Whether the API call was successful
Success ConsumerGetResponseEnvelopeSuccess `json:"success,required"`
ResultInfo ConsumerGetResponseEnvelopeResultInfo `json:"result_info"`
JSON consumerGetResponseEnvelopeJSON `json:"-"`
Expand All @@ -611,7 +611,7 @@ func (r consumerGetResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type ConsumerGetResponseEnvelopeSuccess bool

const (
Expand Down
12 changes: 6 additions & 6 deletions queues/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (r messagePullResponseJSON) RawJSON() string {
}

type MessageAckParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
Acks param.Field[[]MessageAckParamsAck] `json:"acks"`
Retries param.Field[[]MessageAckParamsRetry] `json:"retries"`
Expand Down Expand Up @@ -170,7 +170,7 @@ type MessageAckResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result MessageAckResponse `json:"result,required,nullable"`
// Whether the API call was successful.
// Whether the API call was successful
Success MessageAckResponseEnvelopeSuccess `json:"success,required"`
ResultInfo MessageAckResponseEnvelopeResultInfo `json:"result_info"`
JSON messageAckResponseEnvelopeJSON `json:"-"`
Expand All @@ -196,7 +196,7 @@ func (r messageAckResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type MessageAckResponseEnvelopeSuccess bool

const (
Expand Down Expand Up @@ -243,7 +243,7 @@ func (r messageAckResponseEnvelopeResultInfoJSON) RawJSON() string {
}

type MessagePullParams struct {
// Identifier.
// Identifier
AccountID param.Field[string] `path:"account_id,required"`
// The maximum number of messages to include in a batch.
BatchSize param.Field[float64] `json:"batch_size"`
Expand All @@ -260,7 +260,7 @@ type MessagePullResponseEnvelope struct {
Errors []shared.ResponseInfo `json:"errors,required"`
Messages []shared.ResponseInfo `json:"messages,required"`
Result []MessagePullResponse `json:"result,required,nullable"`
// Whether the API call was successful.
// Whether the API call was successful
Success MessagePullResponseEnvelopeSuccess `json:"success,required"`
ResultInfo MessagePullResponseEnvelopeResultInfo `json:"result_info"`
JSON messagePullResponseEnvelopeJSON `json:"-"`
Expand All @@ -286,7 +286,7 @@ func (r messagePullResponseEnvelopeJSON) RawJSON() string {
return r.raw
}

// Whether the API call was successful.
// Whether the API call was successful
type MessagePullResponseEnvelopeSuccess bool

const (
Expand Down
Loading