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