@@ -133,6 +133,40 @@ func (enum *DomainStatus) UnmarshalJSON(data []byte) error {
133133 return nil
134134}
135135
136+ type FunctionHTTPOption string
137+
138+ const (
139+ // FunctionHTTPOptionUnknownHTTPOption is [insert doc].
140+ FunctionHTTPOptionUnknownHTTPOption = FunctionHTTPOption ("unknown_http_option" )
141+ // FunctionHTTPOptionEnabled is [insert doc].
142+ FunctionHTTPOptionEnabled = FunctionHTTPOption ("enabled" )
143+ // FunctionHTTPOptionRedirected is [insert doc].
144+ FunctionHTTPOptionRedirected = FunctionHTTPOption ("redirected" )
145+ )
146+
147+ func (enum FunctionHTTPOption ) String () string {
148+ if enum == "" {
149+ // return default value if empty
150+ return "unknown_http_option"
151+ }
152+ return string (enum )
153+ }
154+
155+ func (enum FunctionHTTPOption ) MarshalJSON () ([]byte , error ) {
156+ return []byte (fmt .Sprintf (`"%s"` , enum )), nil
157+ }
158+
159+ func (enum * FunctionHTTPOption ) UnmarshalJSON (data []byte ) error {
160+ tmp := ""
161+
162+ if err := json .Unmarshal (data , & tmp ); err != nil {
163+ return err
164+ }
165+
166+ * enum = FunctionHTTPOption (FunctionHTTPOption (tmp ).String ())
167+ return nil
168+ }
169+
136170type FunctionPrivacy string
137171
138172const (
@@ -967,13 +1001,14 @@ type Function struct {
9671001 SecretEnvironmentVariables []* SecretHashedValue `json:"secret_environment_variables"`
9681002
9691003 Region scw.Region `json:"region"`
970- // Deprecated: HTTPOption: configure how HTTP and HTTPS requests are handled
1004+ // HTTPOption: configure how HTTP and HTTPS requests are handled
9711005 //
9721006 // possible values:
9731007 // - redirected: Responds to HTTP request with a 302 redirect to ask the clients to use HTTPS.
9741008 // - enabled: Serve both HTTP and HTTPS traffic.
9751009 //
976- HTTPOption * string `json:"http_option,omitempty"`
1010+ // Default value: unknown_http_option
1011+ HTTPOption FunctionHTTPOption `json:"http_option"`
9771012
9781013 RuntimeMessage string `json:"runtime_message"`
9791014}
@@ -1657,13 +1692,14 @@ type CreateFunctionRequest struct {
16571692 Description * string `json:"description"`
16581693
16591694 SecretEnvironmentVariables []* Secret `json:"secret_environment_variables"`
1660- // Deprecated: HTTPOption: configure how HTTP and HTTPS requests are handled
1695+ // HTTPOption: configure how HTTP and HTTPS requests are handled
16611696 //
16621697 // possible values:
16631698 // - redirected: Responds to HTTP request with a 302 redirect to ask the clients to use HTTPS.
16641699 // - enabled: Serve both HTTP and HTTPS traffic.
16651700 //
1666- HTTPOption * string `json:"http_option,omitempty"`
1701+ // Default value: unknown_http_option
1702+ HTTPOption FunctionHTTPOption `json:"http_option"`
16671703}
16681704
16691705// CreateFunction: create a new function
@@ -1736,13 +1772,14 @@ type UpdateFunctionRequest struct {
17361772 Description * string `json:"description"`
17371773
17381774 SecretEnvironmentVariables []* Secret `json:"secret_environment_variables"`
1739- // Deprecated: HTTPOption: configure how HTTP and HTTPS requests are handled
1775+ // HTTPOption: configure how HTTP and HTTPS requests are handled
17401776 //
17411777 // possible values:
17421778 // - redirected: Responds to HTTP request with a 302 redirect to ask the clients to use HTTPS.
17431779 // - enabled: Serve both HTTP and HTTPS traffic.
17441780 //
1745- HTTPOption * string `json:"http_option,omitempty"`
1781+ // Default value: unknown_http_option
1782+ HTTPOption FunctionHTTPOption `json:"http_option"`
17461783}
17471784
17481785// UpdateFunction: update an existing function
0 commit comments