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