Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#2975)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Aug 29, 2024
1 parent 03bdcaa commit b91681b
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1312
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ec8c4582651a8866e291ddfb749da957e659657c3f1db488736ffdaad02d6b20.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-060f62b355205e23ad193fada7198b5ec983c549cb4fa0c2dab08e8da0268c42.yml
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 @@ -138,7 +138,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 @@ -183,7 +183,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 @@ -207,7 +207,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 @@ -223,15 +223,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 @@ -255,7 +255,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
8 changes: 6 additions & 2 deletions load_balancers/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ const (
SessionAffinityCookie SessionAffinity = "cookie"
SessionAffinityIPCookie SessionAffinity = "ip_cookie"
SessionAffinityHeader SessionAffinity = "header"
SessionAffinityEmpty SessionAffinity = "\"\""
SessionAffinityEmpty SessionAffinity = ""
)

func (r SessionAffinity) IsKnown() bool {
Expand Down Expand Up @@ -1661,7 +1661,7 @@ const (
SteeringPolicyProximity SteeringPolicy = "proximity"
SteeringPolicyLeastOutstandingRequests SteeringPolicy = "least_outstanding_requests"
SteeringPolicyLeastConnections SteeringPolicy = "least_connections"
SteeringPolicyEmpty SteeringPolicy = "\"\""
SteeringPolicyEmpty SteeringPolicy = ""
)

func (r SteeringPolicy) IsKnown() bool {
Expand Down Expand Up @@ -1721,6 +1721,8 @@ type LoadBalancerNewParams struct {
// Controls location-based steering for non-proxied requests. See `steering_policy`
// to learn how steering is affected.
LocationStrategy param.Field[LocationStrategyParam] `json:"location_strategy"`
// List of networks where Load Balancer or Pool is enabled.
Networks param.Field[[]string] `json:"networks"`
// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
// explicitly defined will fall back to using the corresponding country_pool, then
Expand Down Expand Up @@ -1886,6 +1888,8 @@ type LoadBalancerUpdateParams struct {
// Controls location-based steering for non-proxied requests. See `steering_policy`
// to learn how steering is affected.
LocationStrategy param.Field[LocationStrategyParam] `json:"location_strategy"`
// List of networks where Load Balancer or Pool is enabled.
Networks param.Field[[]string] `json:"networks"`
// (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs
// (ordered by their failover priority) for the PoP (datacenter). Any PoPs not
// explicitly defined will fall back to using the corresponding country_pool, then
Expand Down
2 changes: 2 additions & 0 deletions load_balancers/loadbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func TestLoadBalancerNewWithOptionalParams(t *testing.T) {
Mode: cloudflare.F(load_balancers.LocationStrategyModePop),
PreferECS: cloudflare.F(load_balancers.LocationStrategyPreferECSAlways),
}),
Networks: cloudflare.F([]string{"string", "string", "string"}),
PopPools: cloudflare.F(map[string][]string{
"LAX": {"de90f38ced07c2e2f4df50b1f61d4194", "9290f38c5d07c2e2f4df57b1f61d4196"},
"LHR": {"abd90f38ced07c2e2f4df50b1f61d4194", "f9138c5d07c2e2f4df57b1f61d4196"},
Expand Down Expand Up @@ -283,6 +284,7 @@ func TestLoadBalancerUpdateWithOptionalParams(t *testing.T) {
Mode: cloudflare.F(load_balancers.LocationStrategyModePop),
PreferECS: cloudflare.F(load_balancers.LocationStrategyPreferECSAlways),
}),
Networks: cloudflare.F([]string{"string", "string", "string"}),
PopPools: cloudflare.F(map[string][]string{
"LAX": {"de90f38ced07c2e2f4df50b1f61d4194", "9290f38c5d07c2e2f4df57b1f61d4196"},
"LHR": {"abd90f38ced07c2e2f4df50b1f61d4194", "f9138c5d07c2e2f4df57b1f61d4196"},
Expand Down
24 changes: 12 additions & 12 deletions queues/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,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 @@ -338,7 +338,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 @@ -364,7 +364,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 @@ -411,7 +411,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 @@ -424,7 +424,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 @@ -450,7 +450,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 @@ -497,15 +497,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 @@ -531,7 +531,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 @@ -578,15 +578,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 @@ -612,7 +612,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

0 comments on commit b91681b

Please sign in to comment.