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