Skip to content

Commit 75f93c0

Browse files
chore(api): update composite API spec
1 parent 841da55 commit 75f93c0

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
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: 1895
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4e4a9e871d82e70a7ac93f03e8921ee452a7d01772adc0eb99dcd4dbe7a59e8.yml
3-
openapi_spec_hash: 195329a79dc7a999de4ceb1680746dee
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fe5f9f74ec7fae587b81aa6c4405a2129bbe6c146d36a6a8eee6cbc184dceb01.yml
3+
openapi_spec_hash: ad2c2470332035b5d92e2a94faefe5a6
44
config_hash: 47bfb436213622df92afdda8ce4f077f

d1/database.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ type DatabaseNewParams struct {
876876
AccountID param.Field[string] `path:"account_id,required"`
877877
// D1 database name.
878878
Name param.Field[string] `json:"name,required"`
879+
// Specify the location to restrict the D1 database to run and store data. If this
880+
// option is present, the location hint is ignored.
881+
Jurisdiction param.Field[DatabaseNewParamsJurisdiction] `json:"jurisdiction"`
879882
// Specify the region to create the D1 primary, if available. If this option is
880883
// omitted, the D1 will be created as close as possible to the current user.
881884
PrimaryLocationHint param.Field[DatabaseNewParamsPrimaryLocationHint] `json:"primary_location_hint"`
@@ -885,6 +888,23 @@ func (r DatabaseNewParams) MarshalJSON() (data []byte, err error) {
885888
return apijson.MarshalRoot(r)
886889
}
887890

891+
// Specify the location to restrict the D1 database to run and store data. If this
892+
// option is present, the location hint is ignored.
893+
type DatabaseNewParamsJurisdiction string
894+
895+
const (
896+
DatabaseNewParamsJurisdictionEu DatabaseNewParamsJurisdiction = "eu"
897+
DatabaseNewParamsJurisdictionFedramp DatabaseNewParamsJurisdiction = "fedramp"
898+
)
899+
900+
func (r DatabaseNewParamsJurisdiction) IsKnown() bool {
901+
switch r {
902+
case DatabaseNewParamsJurisdictionEu, DatabaseNewParamsJurisdictionFedramp:
903+
return true
904+
}
905+
return false
906+
}
907+
888908
// Specify the region to create the D1 primary, if available. If this option is
889909
// omitted, the D1 will be created as close as possible to the current user.
890910
type DatabaseNewParamsPrimaryLocationHint string

d1/database_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func TestDatabaseNewWithOptionalParams(t *testing.T) {
3030
_, err := client.D1.Database.New(context.TODO(), d1.DatabaseNewParams{
3131
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
3232
Name: cloudflare.F("my-database"),
33+
Jurisdiction: cloudflare.F(d1.DatabaseNewParamsJurisdictionEu),
3334
PrimaryLocationHint: cloudflare.F(d1.DatabaseNewParamsPrimaryLocationHintWnam),
3435
})
3536
if err != nil {

0 commit comments

Comments
 (0)