hanzo_client/models/worker_script_put.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WorkerScriptPut {
16 #[serde(rename = "bindings", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17 pub bindings: Option<Option<serde_json::Value>>,
18 /// CompatibilityDate pins which Workers runtime behaviour the script runs under, as a plain calendar date (\"2024-01-01\"). Absent leaves the account's own default in force.
19 #[serde(rename = "compatibilityDate", skip_serializing_if = "Option::is_none")]
20 pub compatibility_date: Option<String>,
21 /// CompatibilityFlags turn individual runtime behaviours on or off around that date (\"nodejs_compat\"), in Cloudflare's own flag vocabulary. Absent means the date alone decides.
22 #[serde(rename = "compatibilityFlags", skip_serializing_if = "Option::is_none")]
23 pub compatibility_flags: Option<Vec<String>>,
24 /// MainModule is the module file the runtime starts at. Absent means \"worker.js\".
25 #[serde(rename = "mainModule", skip_serializing_if = "Option::is_none")]
26 pub main_module: Option<String>,
27 /// Script means two things on this route, and the document says so in both places it appears: the PATH segment names the Worker to publish, and the BODY field carries that Worker's ES-module source — the code itself, never a name or a URL. A blank or absent source is refused; there is no empty Worker.
28 #[serde(rename = "script", skip_serializing_if = "Option::is_none")]
29 pub script: Option<String>,
30}
31
32impl WorkerScriptPut {
33 pub fn new() -> WorkerScriptPut {
34 WorkerScriptPut {
35 bindings: None,
36 compatibility_date: None,
37 compatibility_flags: None,
38 main_module: None,
39 script: None,
40 }
41 }
42}
43