fastly_api/apis/
logging_gcs_api.rs

1/*
2 * Fastly API
3 *
4 * Via the Fastly API you can perform any of the operations that are possible within the management console,  including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/) 
5 *
6 */
7
8
9use reqwest;
10
11use crate::apis::ResponseContent;
12use super::{Error, configuration};
13
14/// struct for passing parameters to the method [`create_log_gcs`]
15#[derive(Clone, Debug, Default)]
16pub struct CreateLogGcsParams {
17    /// Alphanumeric string identifying the service.
18    pub service_id: String,
19    /// Integer identifying a service version.
20    pub version_id: i32,
21    /// The name for the real-time logging configuration.
22    pub name: Option<String>,
23    /// Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. 
24    pub placement: Option<String>,
25    /// The name of an existing condition in the configured endpoint, or leave blank to always execute.
26    pub response_condition: Option<String>,
27    /// A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).
28    pub format: Option<String>,
29    /// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
30    pub log_processing_region: Option<String>,
31    /// The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. 
32    pub format_version: Option<i32>,
33    /// How the message should be formatted.
34    pub message_type: Option<String>,
35    /// A timestamp format
36    pub timestamp_format: Option<String>,
37    /// The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
38    pub compression_codec: Option<String>,
39    /// How frequently log files are finalized so they can be available for reading (in seconds).
40    pub period: Option<i32>,
41    /// The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
42    pub gzip_level: Option<i32>,
43    /// Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
44    pub user: Option<String>,
45    /// Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
46    pub secret_key: Option<String>,
47    /// The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
48    pub account_name: Option<String>,
49    /// The name of the GCS bucket.
50    pub bucket_name: Option<String>,
51    pub path: Option<String>,
52    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
53    pub public_key: Option<String>,
54    /// Your Google Cloud Platform project ID. Required
55    pub project_id: Option<String>
56}
57
58/// struct for passing parameters to the method [`delete_log_gcs`]
59#[derive(Clone, Debug, Default)]
60pub struct DeleteLogGcsParams {
61    /// Alphanumeric string identifying the service.
62    pub service_id: String,
63    /// Integer identifying a service version.
64    pub version_id: i32,
65    /// The name for the real-time logging configuration.
66    pub logging_gcs_name: String
67}
68
69/// struct for passing parameters to the method [`get_log_gcs`]
70#[derive(Clone, Debug, Default)]
71pub struct GetLogGcsParams {
72    /// Alphanumeric string identifying the service.
73    pub service_id: String,
74    /// Integer identifying a service version.
75    pub version_id: i32,
76    /// The name for the real-time logging configuration.
77    pub logging_gcs_name: String
78}
79
80/// struct for passing parameters to the method [`list_log_gcs`]
81#[derive(Clone, Debug, Default)]
82pub struct ListLogGcsParams {
83    /// Alphanumeric string identifying the service.
84    pub service_id: String,
85    /// Integer identifying a service version.
86    pub version_id: i32
87}
88
89/// struct for passing parameters to the method [`update_log_gcs`]
90#[derive(Clone, Debug, Default)]
91pub struct UpdateLogGcsParams {
92    /// Alphanumeric string identifying the service.
93    pub service_id: String,
94    /// Integer identifying a service version.
95    pub version_id: i32,
96    /// The name for the real-time logging configuration.
97    pub logging_gcs_name: String,
98    /// The name for the real-time logging configuration.
99    pub name: Option<String>,
100    /// Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. 
101    pub placement: Option<String>,
102    /// The name of an existing condition in the configured endpoint, or leave blank to always execute.
103    pub response_condition: Option<String>,
104    /// A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).
105    pub format: Option<String>,
106    /// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
107    pub log_processing_region: Option<String>,
108    /// The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. 
109    pub format_version: Option<i32>,
110    /// How the message should be formatted.
111    pub message_type: Option<String>,
112    /// A timestamp format
113    pub timestamp_format: Option<String>,
114    /// The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
115    pub compression_codec: Option<String>,
116    /// How frequently log files are finalized so they can be available for reading (in seconds).
117    pub period: Option<i32>,
118    /// The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.
119    pub gzip_level: Option<i32>,
120    /// Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
121    pub user: Option<String>,
122    /// Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
123    pub secret_key: Option<String>,
124    /// The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
125    pub account_name: Option<String>,
126    /// The name of the GCS bucket.
127    pub bucket_name: Option<String>,
128    pub path: Option<String>,
129    /// A PGP public key that Fastly will use to encrypt your log files before writing them to disk.
130    pub public_key: Option<String>,
131    /// Your Google Cloud Platform project ID. Required
132    pub project_id: Option<String>
133}
134
135
136/// struct for typed errors of method [`create_log_gcs`]
137#[derive(Debug, Clone, Serialize, Deserialize)]
138#[serde(untagged)]
139pub enum CreateLogGcsError {
140    UnknownValue(serde_json::Value),
141}
142
143/// struct for typed errors of method [`delete_log_gcs`]
144#[derive(Debug, Clone, Serialize, Deserialize)]
145#[serde(untagged)]
146pub enum DeleteLogGcsError {
147    UnknownValue(serde_json::Value),
148}
149
150/// struct for typed errors of method [`get_log_gcs`]
151#[derive(Debug, Clone, Serialize, Deserialize)]
152#[serde(untagged)]
153pub enum GetLogGcsError {
154    UnknownValue(serde_json::Value),
155}
156
157/// struct for typed errors of method [`list_log_gcs`]
158#[derive(Debug, Clone, Serialize, Deserialize)]
159#[serde(untagged)]
160pub enum ListLogGcsError {
161    UnknownValue(serde_json::Value),
162}
163
164/// struct for typed errors of method [`update_log_gcs`]
165#[derive(Debug, Clone, Serialize, Deserialize)]
166#[serde(untagged)]
167pub enum UpdateLogGcsError {
168    UnknownValue(serde_json::Value),
169}
170
171
172/// Create GCS logging for a particular service and version.
173pub async fn create_log_gcs(configuration: &mut configuration::Configuration, params: CreateLogGcsParams) -> Result<crate::models::LoggingGcsResponse, Error<CreateLogGcsError>> {
174    let local_var_configuration = configuration;
175
176    // unbox the parameters
177    let service_id = params.service_id;
178    let version_id = params.version_id;
179    let name = params.name;
180    let placement = params.placement;
181    let response_condition = params.response_condition;
182    let format = params.format;
183    let log_processing_region = params.log_processing_region;
184    let format_version = params.format_version;
185    let message_type = params.message_type;
186    let timestamp_format = params.timestamp_format;
187    let compression_codec = params.compression_codec;
188    let period = params.period;
189    let gzip_level = params.gzip_level;
190    let user = params.user;
191    let secret_key = params.secret_key;
192    let account_name = params.account_name;
193    let bucket_name = params.bucket_name;
194    let path = params.path;
195    let public_key = params.public_key;
196    let project_id = params.project_id;
197
198
199    let local_var_client = &local_var_configuration.client;
200
201    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/gcs", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id);
202    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
203
204    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
205        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
206    }
207    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
208        let local_var_key = local_var_apikey.key.clone();
209        let local_var_value = match local_var_apikey.prefix {
210            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
211            None => local_var_key,
212        };
213        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
214    };
215    let mut local_var_form_params = std::collections::HashMap::new();
216    if let Some(local_var_param_value) = name {
217        local_var_form_params.insert("name", local_var_param_value.to_string());
218    }
219    if let Some(local_var_param_value) = placement {
220        local_var_form_params.insert("placement", local_var_param_value.to_string());
221    }
222    if let Some(local_var_param_value) = response_condition {
223        local_var_form_params.insert("response_condition", local_var_param_value.to_string());
224    }
225    if let Some(local_var_param_value) = format {
226        local_var_form_params.insert("format", local_var_param_value.to_string());
227    }
228    if let Some(local_var_param_value) = log_processing_region {
229        local_var_form_params.insert("log_processing_region", local_var_param_value.to_string());
230    }
231    if let Some(local_var_param_value) = format_version {
232        local_var_form_params.insert("format_version", local_var_param_value.to_string());
233    }
234    if let Some(local_var_param_value) = message_type {
235        local_var_form_params.insert("message_type", local_var_param_value.to_string());
236    }
237    if let Some(local_var_param_value) = timestamp_format {
238        local_var_form_params.insert("timestamp_format", local_var_param_value.to_string());
239    }
240    if let Some(local_var_param_value) = compression_codec {
241        local_var_form_params.insert("compression_codec", local_var_param_value.to_string());
242    }
243    if let Some(local_var_param_value) = period {
244        local_var_form_params.insert("period", local_var_param_value.to_string());
245    }
246    if let Some(local_var_param_value) = gzip_level {
247        local_var_form_params.insert("gzip_level", local_var_param_value.to_string());
248    }
249    if let Some(local_var_param_value) = user {
250        local_var_form_params.insert("user", local_var_param_value.to_string());
251    }
252    if let Some(local_var_param_value) = secret_key {
253        local_var_form_params.insert("secret_key", local_var_param_value.to_string());
254    }
255    if let Some(local_var_param_value) = account_name {
256        local_var_form_params.insert("account_name", local_var_param_value.to_string());
257    }
258    if let Some(local_var_param_value) = bucket_name {
259        local_var_form_params.insert("bucket_name", local_var_param_value.to_string());
260    }
261    if let Some(local_var_param_value) = path {
262        local_var_form_params.insert("path", local_var_param_value.to_string());
263    }
264    if let Some(local_var_param_value) = public_key {
265        local_var_form_params.insert("public_key", local_var_param_value.to_string());
266    }
267    if let Some(local_var_param_value) = project_id {
268        local_var_form_params.insert("project_id", local_var_param_value.to_string());
269    }
270    local_var_req_builder = local_var_req_builder.form(&local_var_form_params);
271
272    let local_var_req = local_var_req_builder.build()?;
273    let local_var_resp = local_var_client.execute(local_var_req).await?;
274
275    if "POST" != "GET" && "POST" != "HEAD" {
276      let headers = local_var_resp.headers();
277      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
278          Some(v) => v.to_str().unwrap().parse().unwrap(),
279          None => configuration::DEFAULT_RATELIMIT,
280      };
281      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
282          Some(v) => v.to_str().unwrap().parse().unwrap(),
283          None => 0,
284      };
285    }
286
287    let local_var_status = local_var_resp.status();
288    let local_var_content = local_var_resp.text().await?;
289
290    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
291        serde_json::from_str(&local_var_content).map_err(Error::from)
292    } else {
293        let local_var_entity: Option<CreateLogGcsError> = serde_json::from_str(&local_var_content).ok();
294        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
295        Err(Error::ResponseError(local_var_error))
296    }
297}
298
299/// Delete the GCS Logging for a particular service and version.
300pub async fn delete_log_gcs(configuration: &mut configuration::Configuration, params: DeleteLogGcsParams) -> Result<crate::models::InlineResponse200, Error<DeleteLogGcsError>> {
301    let local_var_configuration = configuration;
302
303    // unbox the parameters
304    let service_id = params.service_id;
305    let version_id = params.version_id;
306    let logging_gcs_name = params.logging_gcs_name;
307
308
309    let local_var_client = &local_var_configuration.client;
310
311    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/gcs/{logging_gcs_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_gcs_name=crate::apis::urlencode(logging_gcs_name));
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
313
314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
316    }
317    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
318        let local_var_key = local_var_apikey.key.clone();
319        let local_var_value = match local_var_apikey.prefix {
320            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
321            None => local_var_key,
322        };
323        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
324    };
325
326    let local_var_req = local_var_req_builder.build()?;
327    let local_var_resp = local_var_client.execute(local_var_req).await?;
328
329    if "DELETE" != "GET" && "DELETE" != "HEAD" {
330      let headers = local_var_resp.headers();
331      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
332          Some(v) => v.to_str().unwrap().parse().unwrap(),
333          None => configuration::DEFAULT_RATELIMIT,
334      };
335      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
336          Some(v) => v.to_str().unwrap().parse().unwrap(),
337          None => 0,
338      };
339    }
340
341    let local_var_status = local_var_resp.status();
342    let local_var_content = local_var_resp.text().await?;
343
344    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
345        serde_json::from_str(&local_var_content).map_err(Error::from)
346    } else {
347        let local_var_entity: Option<DeleteLogGcsError> = serde_json::from_str(&local_var_content).ok();
348        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
349        Err(Error::ResponseError(local_var_error))
350    }
351}
352
353/// Get the GCS Logging for a particular service and version.
354pub async fn get_log_gcs(configuration: &mut configuration::Configuration, params: GetLogGcsParams) -> Result<crate::models::LoggingGcsResponse, Error<GetLogGcsError>> {
355    let local_var_configuration = configuration;
356
357    // unbox the parameters
358    let service_id = params.service_id;
359    let version_id = params.version_id;
360    let logging_gcs_name = params.logging_gcs_name;
361
362
363    let local_var_client = &local_var_configuration.client;
364
365    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/gcs/{logging_gcs_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_gcs_name=crate::apis::urlencode(logging_gcs_name));
366    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
367
368    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
369        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
370    }
371    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
372        let local_var_key = local_var_apikey.key.clone();
373        let local_var_value = match local_var_apikey.prefix {
374            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
375            None => local_var_key,
376        };
377        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
378    };
379
380    let local_var_req = local_var_req_builder.build()?;
381    let local_var_resp = local_var_client.execute(local_var_req).await?;
382
383    if "GET" != "GET" && "GET" != "HEAD" {
384      let headers = local_var_resp.headers();
385      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
386          Some(v) => v.to_str().unwrap().parse().unwrap(),
387          None => configuration::DEFAULT_RATELIMIT,
388      };
389      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
390          Some(v) => v.to_str().unwrap().parse().unwrap(),
391          None => 0,
392      };
393    }
394
395    let local_var_status = local_var_resp.status();
396    let local_var_content = local_var_resp.text().await?;
397
398    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
399        serde_json::from_str(&local_var_content).map_err(Error::from)
400    } else {
401        let local_var_entity: Option<GetLogGcsError> = serde_json::from_str(&local_var_content).ok();
402        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
403        Err(Error::ResponseError(local_var_error))
404    }
405}
406
407/// List all of the GCS log endpoints for a particular service and version.
408pub async fn list_log_gcs(configuration: &mut configuration::Configuration, params: ListLogGcsParams) -> Result<Vec<crate::models::LoggingGcsResponse>, Error<ListLogGcsError>> {
409    let local_var_configuration = configuration;
410
411    // unbox the parameters
412    let service_id = params.service_id;
413    let version_id = params.version_id;
414
415
416    let local_var_client = &local_var_configuration.client;
417
418    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/gcs", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id);
419    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
420
421    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
422        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
423    }
424    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
425        let local_var_key = local_var_apikey.key.clone();
426        let local_var_value = match local_var_apikey.prefix {
427            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
428            None => local_var_key,
429        };
430        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
431    };
432
433    let local_var_req = local_var_req_builder.build()?;
434    let local_var_resp = local_var_client.execute(local_var_req).await?;
435
436    if "GET" != "GET" && "GET" != "HEAD" {
437      let headers = local_var_resp.headers();
438      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
439          Some(v) => v.to_str().unwrap().parse().unwrap(),
440          None => configuration::DEFAULT_RATELIMIT,
441      };
442      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
443          Some(v) => v.to_str().unwrap().parse().unwrap(),
444          None => 0,
445      };
446    }
447
448    let local_var_status = local_var_resp.status();
449    let local_var_content = local_var_resp.text().await?;
450
451    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
452        serde_json::from_str(&local_var_content).map_err(Error::from)
453    } else {
454        let local_var_entity: Option<ListLogGcsError> = serde_json::from_str(&local_var_content).ok();
455        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
456        Err(Error::ResponseError(local_var_error))
457    }
458}
459
460/// Update the GCS for a particular service and version.
461pub async fn update_log_gcs(configuration: &mut configuration::Configuration, params: UpdateLogGcsParams) -> Result<crate::models::LoggingGcsResponse, Error<UpdateLogGcsError>> {
462    let local_var_configuration = configuration;
463
464    // unbox the parameters
465    let service_id = params.service_id;
466    let version_id = params.version_id;
467    let logging_gcs_name = params.logging_gcs_name;
468    let name = params.name;
469    let placement = params.placement;
470    let response_condition = params.response_condition;
471    let format = params.format;
472    let log_processing_region = params.log_processing_region;
473    let format_version = params.format_version;
474    let message_type = params.message_type;
475    let timestamp_format = params.timestamp_format;
476    let compression_codec = params.compression_codec;
477    let period = params.period;
478    let gzip_level = params.gzip_level;
479    let user = params.user;
480    let secret_key = params.secret_key;
481    let account_name = params.account_name;
482    let bucket_name = params.bucket_name;
483    let path = params.path;
484    let public_key = params.public_key;
485    let project_id = params.project_id;
486
487
488    let local_var_client = &local_var_configuration.client;
489
490    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/gcs/{logging_gcs_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_gcs_name=crate::apis::urlencode(logging_gcs_name));
491    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
492
493    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
494        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
495    }
496    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
497        let local_var_key = local_var_apikey.key.clone();
498        let local_var_value = match local_var_apikey.prefix {
499            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
500            None => local_var_key,
501        };
502        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
503    };
504    let mut local_var_form_params = std::collections::HashMap::new();
505    if let Some(local_var_param_value) = name {
506        local_var_form_params.insert("name", local_var_param_value.to_string());
507    }
508    if let Some(local_var_param_value) = placement {
509        local_var_form_params.insert("placement", local_var_param_value.to_string());
510    }
511    if let Some(local_var_param_value) = response_condition {
512        local_var_form_params.insert("response_condition", local_var_param_value.to_string());
513    }
514    if let Some(local_var_param_value) = format {
515        local_var_form_params.insert("format", local_var_param_value.to_string());
516    }
517    if let Some(local_var_param_value) = log_processing_region {
518        local_var_form_params.insert("log_processing_region", local_var_param_value.to_string());
519    }
520    if let Some(local_var_param_value) = format_version {
521        local_var_form_params.insert("format_version", local_var_param_value.to_string());
522    }
523    if let Some(local_var_param_value) = message_type {
524        local_var_form_params.insert("message_type", local_var_param_value.to_string());
525    }
526    if let Some(local_var_param_value) = timestamp_format {
527        local_var_form_params.insert("timestamp_format", local_var_param_value.to_string());
528    }
529    if let Some(local_var_param_value) = compression_codec {
530        local_var_form_params.insert("compression_codec", local_var_param_value.to_string());
531    }
532    if let Some(local_var_param_value) = period {
533        local_var_form_params.insert("period", local_var_param_value.to_string());
534    }
535    if let Some(local_var_param_value) = gzip_level {
536        local_var_form_params.insert("gzip_level", local_var_param_value.to_string());
537    }
538    if let Some(local_var_param_value) = user {
539        local_var_form_params.insert("user", local_var_param_value.to_string());
540    }
541    if let Some(local_var_param_value) = secret_key {
542        local_var_form_params.insert("secret_key", local_var_param_value.to_string());
543    }
544    if let Some(local_var_param_value) = account_name {
545        local_var_form_params.insert("account_name", local_var_param_value.to_string());
546    }
547    if let Some(local_var_param_value) = bucket_name {
548        local_var_form_params.insert("bucket_name", local_var_param_value.to_string());
549    }
550    if let Some(local_var_param_value) = path {
551        local_var_form_params.insert("path", local_var_param_value.to_string());
552    }
553    if let Some(local_var_param_value) = public_key {
554        local_var_form_params.insert("public_key", local_var_param_value.to_string());
555    }
556    if let Some(local_var_param_value) = project_id {
557        local_var_form_params.insert("project_id", local_var_param_value.to_string());
558    }
559    local_var_req_builder = local_var_req_builder.form(&local_var_form_params);
560
561    let local_var_req = local_var_req_builder.build()?;
562    let local_var_resp = local_var_client.execute(local_var_req).await?;
563
564    if "PUT" != "GET" && "PUT" != "HEAD" {
565      let headers = local_var_resp.headers();
566      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
567          Some(v) => v.to_str().unwrap().parse().unwrap(),
568          None => configuration::DEFAULT_RATELIMIT,
569      };
570      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
571          Some(v) => v.to_str().unwrap().parse().unwrap(),
572          None => 0,
573      };
574    }
575
576    let local_var_status = local_var_resp.status();
577    let local_var_content = local_var_resp.text().await?;
578
579    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
580        serde_json::from_str(&local_var_content).map_err(Error::from)
581    } else {
582        let local_var_entity: Option<UpdateLogGcsError> = serde_json::from_str(&local_var_content).ok();
583        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
584        Err(Error::ResponseError(local_var_error))
585    }
586}
587