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