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