Skip to content

Commit a0ea18a

Browse files
feat(api): api update
1 parent 4321027 commit a0ea18a

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
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: 1782
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9437feb23d81453829170341fd809fd1f6899c8b9f94fd1f65be90772be4ec83.yml
3-
openapi_spec_hash: d9006e1941cceabd20a5c883069a7424
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24631e39af233973e51129ca7090195b430ab835af32564981169e12e5f6eedf.yml
3+
openapi_spec_hash: 743b8f14b73519c3b813ed9159cbe6e3
44
config_hash: eda5b3d9487ce675d1fadf88153b457d

zero_trust/gatewayconfiguration.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,10 @@ func (r AntiVirusSettingsParam) MarshalJSON() (data []byte, err error) {
177177

178178
// Block page layout settings.
179179
type BlockPageSettings struct {
180-
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
181-
Enabled bool `json:"enabled,required,nullable"`
182-
// Controls whether the user is redirected to a Cloudflare-hosted block page or to
183-
// a customer-provided URI.
184-
Mode BlockPageSettingsMode `json:"mode,required"`
185180
// If mode is customized_block_page: block page background color in #rrggbb format.
186181
BackgroundColor string `json:"background_color"`
182+
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
183+
Enabled bool `json:"enabled,nullable"`
187184
// If mode is customized_block_page: block page footer text.
188185
FooterText string `json:"footer_text"`
189186
// If mode is customized_block_page: block page header text.
@@ -198,6 +195,9 @@ type BlockPageSettings struct {
198195
// If mode is customized_block_page: subject line for emails created from block
199196
// page.
200197
MailtoSubject string `json:"mailto_subject"`
198+
// Controls whether the user is redirected to a Cloudflare-hosted block page or to
199+
// a customer-provided URI.
200+
Mode BlockPageSettingsMode `json:"mode"`
201201
// If mode is customized_block_page: block page title.
202202
Name string `json:"name"`
203203
// This setting was shared via the Orgs API and cannot be edited by the current
@@ -218,15 +218,15 @@ type BlockPageSettings struct {
218218
// blockPageSettingsJSON contains the JSON metadata for the struct
219219
// [BlockPageSettings]
220220
type blockPageSettingsJSON struct {
221-
Enabled apijson.Field
222-
Mode apijson.Field
223221
BackgroundColor apijson.Field
222+
Enabled apijson.Field
224223
FooterText apijson.Field
225224
HeaderText apijson.Field
226225
IncludeContext apijson.Field
227226
LogoPath apijson.Field
228227
MailtoAddress apijson.Field
229228
MailtoSubject apijson.Field
229+
Mode apijson.Field
230230
Name apijson.Field
231231
ReadOnly apijson.Field
232232
SourceAccount apijson.Field
@@ -264,13 +264,10 @@ func (r BlockPageSettingsMode) IsKnown() bool {
264264

265265
// Block page layout settings.
266266
type BlockPageSettingsParam struct {
267-
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
268-
Enabled param.Field[bool] `json:"enabled,required"`
269-
// Controls whether the user is redirected to a Cloudflare-hosted block page or to
270-
// a customer-provided URI.
271-
Mode param.Field[BlockPageSettingsMode] `json:"mode,required"`
272267
// If mode is customized_block_page: block page background color in #rrggbb format.
273268
BackgroundColor param.Field[string] `json:"background_color"`
269+
// Enable only cipher suites and TLS versions compliant with FIPS 140-2.
270+
Enabled param.Field[bool] `json:"enabled"`
274271
// If mode is customized_block_page: block page footer text.
275272
FooterText param.Field[string] `json:"footer_text"`
276273
// If mode is customized_block_page: block page header text.
@@ -285,6 +282,9 @@ type BlockPageSettingsParam struct {
285282
// If mode is customized_block_page: subject line for emails created from block
286283
// page.
287284
MailtoSubject param.Field[string] `json:"mailto_subject"`
285+
// Controls whether the user is redirected to a Cloudflare-hosted block page or to
286+
// a customer-provided URI.
287+
Mode param.Field[BlockPageSettingsMode] `json:"mode"`
288288
// If mode is customized_block_page: block page title.
289289
Name param.Field[string] `json:"name"`
290290
// If mode is customized_block_page: suppress detailed info at the bottom of the

zero_trust/gatewayconfiguration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ func TestGatewayConfigurationUpdateWithOptionalParams(t *testing.T) {
4545
}),
4646
}),
4747
BlockPage: cloudflare.F(zero_trust.BlockPageSettingsParam{
48-
Enabled: cloudflare.F(true),
49-
Mode: cloudflare.F(zero_trust.BlockPageSettingsModeCustomizedBlockPage),
5048
BackgroundColor: cloudflare.F("background_color"),
49+
Enabled: cloudflare.F(true),
5150
FooterText: cloudflare.F("--footer--"),
5251
HeaderText: cloudflare.F("--header--"),
5352
IncludeContext: cloudflare.F(true),
5453
LogoPath: cloudflare.F("https://logos.com/a.png"),
5554
MailtoAddress: cloudflare.F("admin@example.com"),
5655
MailtoSubject: cloudflare.F("Blocked User Inquiry"),
56+
Mode: cloudflare.F(zero_trust.BlockPageSettingsModeCustomizedBlockPage),
5757
Name: cloudflare.F("Cloudflare"),
5858
SuppressFooter: cloudflare.F(false),
5959
TargetURI: cloudflare.F("https://example.com"),
@@ -136,15 +136,15 @@ func TestGatewayConfigurationEditWithOptionalParams(t *testing.T) {
136136
}),
137137
}),
138138
BlockPage: cloudflare.F(zero_trust.BlockPageSettingsParam{
139-
Enabled: cloudflare.F(true),
140-
Mode: cloudflare.F(zero_trust.BlockPageSettingsModeCustomizedBlockPage),
141139
BackgroundColor: cloudflare.F("background_color"),
140+
Enabled: cloudflare.F(true),
142141
FooterText: cloudflare.F("--footer--"),
143142
HeaderText: cloudflare.F("--header--"),
144143
IncludeContext: cloudflare.F(true),
145144
LogoPath: cloudflare.F("https://logos.com/a.png"),
146145
MailtoAddress: cloudflare.F("admin@example.com"),
147146
MailtoSubject: cloudflare.F("Blocked User Inquiry"),
147+
Mode: cloudflare.F(zero_trust.BlockPageSettingsModeCustomizedBlockPage),
148148
Name: cloudflare.F("Cloudflare"),
149149
SuppressFooter: cloudflare.F(false),
150150
TargetURI: cloudflare.F("https://example.com"),

zero_trust/gatewayrule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ type RuleSetting struct {
466466
BlockPageEnabled bool `json:"block_page_enabled"`
467467
// The text describing why this block occurred, displayed on the custom block page
468468
// (if enabled).
469-
BlockReason string `json:"block_reason"`
469+
BlockReason string `json:"block_reason,nullable"`
470470
// Set by children MSP accounts to bypass their parent's rules.
471471
BypassParentRule bool `json:"bypass_parent_rule,nullable"`
472472
// Configure how session check behaves.

0 commit comments

Comments
 (0)