@@ -16,7 +16,6 @@ import (
1616 "github.com/cloudflare/cloudflare-go/v6/internal/requestconfig"
1717 "github.com/cloudflare/cloudflare-go/v6/option"
1818 "github.com/cloudflare/cloudflare-go/v6/packages/pagination"
19- "github.com/cloudflare/cloudflare-go/v6/shared"
2019 "github.com/tidwall/gjson"
2120)
2221
@@ -117,7 +116,15 @@ type Setting struct {
117116 Status string `json:"status"`
118117 // This is the time the tls setting was updated.
119118 UpdatedAt time.Time `json:"updated_at" format:"date-time"`
120- // The tls setting value.
119+ // The TLS setting value. The type depends on the `setting_id` used in the request
120+ // path:
121+ //
122+ // - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g.,
123+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
124+ // - `min_tls_version`: a string indicating the minimum TLS version — one of
125+ // `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`)
126+ // - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"`
127+ // (e.g., `"on"`)
121128 Value SettingValueUnion `json:"value"`
122129 JSON settingJSON `json:"-"`
123130}
@@ -141,25 +148,28 @@ func (r settingJSON) RawJSON() string {
141148 return r .raw
142149}
143150
144- // The tls setting value.
151+ // The TLS setting value. The type depends on the `setting_id` used in the request
152+ // path:
145153//
146- // Union satisfied by [shared.UnionFloat], [shared.UnionString] or
147- // [SettingValueArray].
154+ // - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g.,
155+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
156+ // - `min_tls_version`: a string indicating the minimum TLS version — one of
157+ // `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`)
158+ // - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"`
159+ // (e.g., `"on"`)
160+ //
161+ // Union satisfied by [SettingValueString] or [SettingValueArray].
148162type SettingValueUnion interface {
149- ImplementsSettingValueUnion ()
163+ implementsSettingValueUnion ()
150164}
151165
152166func init () {
153167 apijson .RegisterUnion (
154168 reflect .TypeOf ((* SettingValueUnion )(nil )).Elem (),
155169 "" ,
156- apijson.UnionVariant {
157- TypeFilter : gjson .Number ,
158- Type : reflect .TypeOf (shared .UnionFloat (0 )),
159- },
160170 apijson.UnionVariant {
161171 TypeFilter : gjson .String ,
162- Type : reflect .TypeOf (shared . UnionString ("" )),
172+ Type : reflect .TypeOf (SettingValueString ("" )),
163173 },
164174 apijson.UnionVariant {
165175 TypeFilter : gjson .JSON ,
@@ -168,21 +178,51 @@ func init() {
168178 )
169179}
170180
181+ type SettingValueString string
182+
183+ const (
184+ SettingValueString1_0 SettingValueString = "1.0"
185+ SettingValueString1_1 SettingValueString = "1.1"
186+ SettingValueString1_2 SettingValueString = "1.2"
187+ SettingValueString1_3 SettingValueString = "1.3"
188+ SettingValueStringOn SettingValueString = "on"
189+ SettingValueStringOff SettingValueString = "off"
190+ )
191+
192+ func (r SettingValueString ) IsKnown () bool {
193+ switch r {
194+ case SettingValueString1_0 , SettingValueString1_1 , SettingValueString1_2 , SettingValueString1_3 , SettingValueStringOn , SettingValueStringOff :
195+ return true
196+ }
197+ return false
198+ }
199+
200+ func (r SettingValueString ) implementsSettingValueUnion () {}
201+
202+ func (r SettingValueString ) implementsSettingValueUnionParam () {}
203+
171204type SettingValueArray []string
172205
173- func (r SettingValueArray ) ImplementsSettingValueUnion () {}
206+ func (r SettingValueArray ) implementsSettingValueUnion () {}
174207
175- // The tls setting value.
208+ // The TLS setting value. The type depends on the `setting_id` used in the request
209+ // path:
176210//
177- // Satisfied by [shared.UnionFloat], [shared.UnionString],
178- // [hostnames.SettingValueArrayParam].
211+ // - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g.,
212+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
213+ // - `min_tls_version`: a string indicating the minimum TLS version — one of
214+ // `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`)
215+ // - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"`
216+ // (e.g., `"on"`)
217+ //
218+ // Satisfied by [hostnames.SettingValueString], [hostnames.SettingValueArrayParam].
179219type SettingValueUnionParam interface {
180- ImplementsSettingValueUnionParam ()
220+ implementsSettingValueUnionParam ()
181221}
182222
183223type SettingValueArrayParam []string
184224
185- func (r SettingValueArrayParam ) ImplementsSettingValueUnionParam () {}
225+ func (r SettingValueArrayParam ) implementsSettingValueUnionParam () {}
186226
187227type SettingTLSDeleteResponse struct {
188228 // This is the time the tls setting was originally created for this hostname.
@@ -193,7 +233,15 @@ type SettingTLSDeleteResponse struct {
193233 Status string `json:"status"`
194234 // This is the time the tls setting was updated.
195235 UpdatedAt time.Time `json:"updated_at" format:"date-time"`
196- // The tls setting value.
236+ // The TLS setting value. The type depends on the `setting_id` used in the request
237+ // path:
238+ //
239+ // - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g.,
240+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
241+ // - `min_tls_version`: a string indicating the minimum TLS version — one of
242+ // `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`)
243+ // - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"`
244+ // (e.g., `"on"`)
197245 Value SettingValueUnion `json:"value"`
198246 JSON settingTLSDeleteResponseJSON `json:"-"`
199247}
@@ -227,7 +275,15 @@ type SettingTLSGetResponse struct {
227275 Status string `json:"status"`
228276 // This is the time the tls setting was updated.
229277 UpdatedAt time.Time `json:"updated_at" format:"date-time"`
230- // The tls setting value.
278+ // The TLS setting value. The type depends on the `setting_id` used in the request
279+ // path:
280+ //
281+ // - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g.,
282+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
283+ // - `min_tls_version`: a string indicating the minimum TLS version — one of
284+ // `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`)
285+ // - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"`
286+ // (e.g., `"on"`)
231287 Value SettingValueUnion `json:"value"`
232288 JSON settingTLSGetResponseJSON `json:"-"`
233289}
@@ -255,15 +311,29 @@ func (r settingTLSGetResponseJSON) RawJSON() string {
255311type SettingTLSUpdateParams struct {
256312 // Identifier.
257313 ZoneID param.Field [string ] `path:"zone_id,required"`
258- // The tls setting value.
314+ // The TLS setting value. The type depends on the `setting_id` used in the request
315+ // path:
316+ //
317+ // - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g.,
318+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
319+ // - `min_tls_version`: a string indicating the minimum TLS version — one of
320+ // `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`)
321+ // - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"`
322+ // (e.g., `"on"`)
259323 Value param.Field [SettingValueUnionParam ] `json:"value,required"`
260324}
261325
262326func (r SettingTLSUpdateParams ) MarshalJSON () (data []byte , err error ) {
263327 return apijson .MarshalRoot (r )
264328}
265329
266- // The TLS Setting name.
330+ // The TLS Setting name. The value type depends on the setting:
331+ //
332+ // - `ciphers`: value is an array of cipher suite strings (e.g.,
333+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
334+ // - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`,
335+ // or `"1.3"`)
336+ // - `http2`: value is `"on"` or `"off"`
267337type SettingTLSUpdateParamsSettingID string
268338
269339const (
@@ -424,7 +494,13 @@ type SettingTLSDeleteParams struct {
424494 ZoneID param.Field [string ] `path:"zone_id,required"`
425495}
426496
427- // The TLS Setting name.
497+ // The TLS Setting name. The value type depends on the setting:
498+ //
499+ // - `ciphers`: value is an array of cipher suite strings (e.g.,
500+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
501+ // - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`,
502+ // or `"1.3"`)
503+ // - `http2`: value is `"on"` or `"off"`
428504type SettingTLSDeleteParamsSettingID string
429505
430506const (
@@ -585,7 +661,13 @@ type SettingTLSGetParams struct {
585661 ZoneID param.Field [string ] `path:"zone_id,required"`
586662}
587663
588- // The TLS Setting name.
664+ // The TLS Setting name. The value type depends on the setting:
665+ //
666+ // - `ciphers`: value is an array of cipher suite strings (e.g.,
667+ // `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`)
668+ // - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`,
669+ // or `"1.3"`)
670+ // - `http2`: value is `"on"` or `"off"`
589671type SettingTLSGetParamsSettingID string
590672
591673const (
0 commit comments