fastly_api/apis/
logging_pubsub_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_gcp_pubsub`]
15#[derive(Clone, Debug, Default)]
16pub struct CreateLogGcpPubsubParams {
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    /// Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
34    pub user: Option<String>,
35    /// Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
36    pub secret_key: Option<String>,
37    /// The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
38    pub account_name: Option<String>,
39    /// The Google Cloud Pub/Sub topic to which logs will be published. Required.
40    pub topic: Option<String>,
41    /// Your Google Cloud Platform project ID. Required
42    pub project_id: Option<String>
43}
44
45/// struct for passing parameters to the method [`delete_log_gcp_pubsub`]
46#[derive(Clone, Debug, Default)]
47pub struct DeleteLogGcpPubsubParams {
48    /// Alphanumeric string identifying the service.
49    pub service_id: String,
50    /// Integer identifying a service version.
51    pub version_id: i32,
52    /// The name for the real-time logging configuration.
53    pub logging_google_pubsub_name: String
54}
55
56/// struct for passing parameters to the method [`get_log_gcp_pubsub`]
57#[derive(Clone, Debug, Default)]
58pub struct GetLogGcpPubsubParams {
59    /// Alphanumeric string identifying the service.
60    pub service_id: String,
61    /// Integer identifying a service version.
62    pub version_id: i32,
63    /// The name for the real-time logging configuration.
64    pub logging_google_pubsub_name: String
65}
66
67/// struct for passing parameters to the method [`list_log_gcp_pubsub`]
68#[derive(Clone, Debug, Default)]
69pub struct ListLogGcpPubsubParams {
70    /// Alphanumeric string identifying the service.
71    pub service_id: String,
72    /// Integer identifying a service version.
73    pub version_id: i32
74}
75
76/// struct for passing parameters to the method [`update_log_gcp_pubsub`]
77#[derive(Clone, Debug, Default)]
78pub struct UpdateLogGcpPubsubParams {
79    /// Alphanumeric string identifying the service.
80    pub service_id: String,
81    /// Integer identifying a service version.
82    pub version_id: i32,
83    /// The name for the real-time logging configuration.
84    pub logging_google_pubsub_name: String,
85    /// The name for the real-time logging configuration.
86    pub name: Option<String>,
87    /// 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`. 
88    pub placement: Option<String>,
89    /// The name of an existing condition in the configured endpoint, or leave blank to always execute.
90    pub response_condition: Option<String>,
91    /// A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).
92    pub format: Option<String>,
93    /// The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.
94    pub log_processing_region: Option<String>,
95    /// 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`. 
96    pub format_version: Option<i32>,
97    /// Your Google Cloud Platform service account email address. The `client_email` field in your service account authentication JSON. Not required if `account_name` is specified.
98    pub user: Option<String>,
99    /// Your Google Cloud Platform account secret key. The `private_key` field in your service account authentication JSON. Not required if `account_name` is specified.
100    pub secret_key: Option<String>,
101    /// The name of the Google Cloud Platform service account associated with the target log collection service. Not required if `user` and `secret_key` are provided.
102    pub account_name: Option<String>,
103    /// The Google Cloud Pub/Sub topic to which logs will be published. Required.
104    pub topic: Option<String>,
105    /// Your Google Cloud Platform project ID. Required
106    pub project_id: Option<String>
107}
108
109
110/// struct for typed errors of method [`create_log_gcp_pubsub`]
111#[derive(Debug, Clone, Serialize, Deserialize)]
112#[serde(untagged)]
113pub enum CreateLogGcpPubsubError {
114    UnknownValue(serde_json::Value),
115}
116
117/// struct for typed errors of method [`delete_log_gcp_pubsub`]
118#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum DeleteLogGcpPubsubError {
121    UnknownValue(serde_json::Value),
122}
123
124/// struct for typed errors of method [`get_log_gcp_pubsub`]
125#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum GetLogGcpPubsubError {
128    UnknownValue(serde_json::Value),
129}
130
131/// struct for typed errors of method [`list_log_gcp_pubsub`]
132#[derive(Debug, Clone, Serialize, Deserialize)]
133#[serde(untagged)]
134pub enum ListLogGcpPubsubError {
135    UnknownValue(serde_json::Value),
136}
137
138/// struct for typed errors of method [`update_log_gcp_pubsub`]
139#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum UpdateLogGcpPubsubError {
142    UnknownValue(serde_json::Value),
143}
144
145
146/// Create a Pub/Sub logging object for a particular service and version.
147pub async fn create_log_gcp_pubsub(configuration: &mut configuration::Configuration, params: CreateLogGcpPubsubParams) -> Result<crate::models::LoggingGooglePubsubResponse, Error<CreateLogGcpPubsubError>> {
148    let local_var_configuration = configuration;
149
150    // unbox the parameters
151    let service_id = params.service_id;
152    let version_id = params.version_id;
153    let name = params.name;
154    let placement = params.placement;
155    let response_condition = params.response_condition;
156    let format = params.format;
157    let log_processing_region = params.log_processing_region;
158    let format_version = params.format_version;
159    let user = params.user;
160    let secret_key = params.secret_key;
161    let account_name = params.account_name;
162    let topic = params.topic;
163    let project_id = params.project_id;
164
165
166    let local_var_client = &local_var_configuration.client;
167
168    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/pubsub", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id);
169    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
170
171    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
172        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
173    }
174    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
175        let local_var_key = local_var_apikey.key.clone();
176        let local_var_value = match local_var_apikey.prefix {
177            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
178            None => local_var_key,
179        };
180        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
181    };
182    let mut local_var_form_params = std::collections::HashMap::new();
183    if let Some(local_var_param_value) = name {
184        local_var_form_params.insert("name", local_var_param_value.to_string());
185    }
186    if let Some(local_var_param_value) = placement {
187        local_var_form_params.insert("placement", local_var_param_value.to_string());
188    }
189    if let Some(local_var_param_value) = response_condition {
190        local_var_form_params.insert("response_condition", local_var_param_value.to_string());
191    }
192    if let Some(local_var_param_value) = format {
193        local_var_form_params.insert("format", local_var_param_value.to_string());
194    }
195    if let Some(local_var_param_value) = log_processing_region {
196        local_var_form_params.insert("log_processing_region", local_var_param_value.to_string());
197    }
198    if let Some(local_var_param_value) = format_version {
199        local_var_form_params.insert("format_version", local_var_param_value.to_string());
200    }
201    if let Some(local_var_param_value) = user {
202        local_var_form_params.insert("user", local_var_param_value.to_string());
203    }
204    if let Some(local_var_param_value) = secret_key {
205        local_var_form_params.insert("secret_key", local_var_param_value.to_string());
206    }
207    if let Some(local_var_param_value) = account_name {
208        local_var_form_params.insert("account_name", local_var_param_value.to_string());
209    }
210    if let Some(local_var_param_value) = topic {
211        local_var_form_params.insert("topic", local_var_param_value.to_string());
212    }
213    if let Some(local_var_param_value) = project_id {
214        local_var_form_params.insert("project_id", local_var_param_value.to_string());
215    }
216    local_var_req_builder = local_var_req_builder.form(&local_var_form_params);
217
218    let local_var_req = local_var_req_builder.build()?;
219    let local_var_resp = local_var_client.execute(local_var_req).await?;
220
221    if "POST" != "GET" && "POST" != "HEAD" {
222      let headers = local_var_resp.headers();
223      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
224          Some(v) => v.to_str().unwrap().parse().unwrap(),
225          None => configuration::DEFAULT_RATELIMIT,
226      };
227      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
228          Some(v) => v.to_str().unwrap().parse().unwrap(),
229          None => 0,
230      };
231    }
232
233    let local_var_status = local_var_resp.status();
234    let local_var_content = local_var_resp.text().await?;
235
236    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
237        serde_json::from_str(&local_var_content).map_err(Error::from)
238    } else {
239        let local_var_entity: Option<CreateLogGcpPubsubError> = serde_json::from_str(&local_var_content).ok();
240        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
241        Err(Error::ResponseError(local_var_error))
242    }
243}
244
245/// Delete a Pub/Sub logging object for a particular service and version.
246pub async fn delete_log_gcp_pubsub(configuration: &mut configuration::Configuration, params: DeleteLogGcpPubsubParams) -> Result<crate::models::InlineResponse200, Error<DeleteLogGcpPubsubError>> {
247    let local_var_configuration = configuration;
248
249    // unbox the parameters
250    let service_id = params.service_id;
251    let version_id = params.version_id;
252    let logging_google_pubsub_name = params.logging_google_pubsub_name;
253
254
255    let local_var_client = &local_var_configuration.client;
256
257    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_google_pubsub_name=crate::apis::urlencode(logging_google_pubsub_name));
258    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
259
260    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
261        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
262    }
263    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
264        let local_var_key = local_var_apikey.key.clone();
265        let local_var_value = match local_var_apikey.prefix {
266            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
267            None => local_var_key,
268        };
269        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
270    };
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 "DELETE" != "GET" && "DELETE" != "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<DeleteLogGcpPubsubError> = 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/// Get the details for a Pub/Sub logging object for a particular service and version.
300pub async fn get_log_gcp_pubsub(configuration: &mut configuration::Configuration, params: GetLogGcpPubsubParams) -> Result<crate::models::LoggingGooglePubsubResponse, Error<GetLogGcpPubsubError>> {
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_google_pubsub_name = params.logging_google_pubsub_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/pubsub/{logging_google_pubsub_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_google_pubsub_name=crate::apis::urlencode(logging_google_pubsub_name));
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, 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 "GET" != "GET" && "GET" != "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<GetLogGcpPubsubError> = 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/// List all of the Pub/Sub logging objects for a particular service and version.
354pub async fn list_log_gcp_pubsub(configuration: &mut configuration::Configuration, params: ListLogGcpPubsubParams) -> Result<Vec<crate::models::LoggingGooglePubsubResponse>, Error<ListLogGcpPubsubError>> {
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
361
362    let local_var_client = &local_var_configuration.client;
363
364    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/pubsub", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id);
365    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
366
367    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
368        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
369    }
370    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
371        let local_var_key = local_var_apikey.key.clone();
372        let local_var_value = match local_var_apikey.prefix {
373            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
374            None => local_var_key,
375        };
376        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
377    };
378
379    let local_var_req = local_var_req_builder.build()?;
380    let local_var_resp = local_var_client.execute(local_var_req).await?;
381
382    if "GET" != "GET" && "GET" != "HEAD" {
383      let headers = local_var_resp.headers();
384      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
385          Some(v) => v.to_str().unwrap().parse().unwrap(),
386          None => configuration::DEFAULT_RATELIMIT,
387      };
388      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
389          Some(v) => v.to_str().unwrap().parse().unwrap(),
390          None => 0,
391      };
392    }
393
394    let local_var_status = local_var_resp.status();
395    let local_var_content = local_var_resp.text().await?;
396
397    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
398        serde_json::from_str(&local_var_content).map_err(Error::from)
399    } else {
400        let local_var_entity: Option<ListLogGcpPubsubError> = serde_json::from_str(&local_var_content).ok();
401        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
402        Err(Error::ResponseError(local_var_error))
403    }
404}
405
406/// Update a Pub/Sub logging object for a particular service and version.
407pub async fn update_log_gcp_pubsub(configuration: &mut configuration::Configuration, params: UpdateLogGcpPubsubParams) -> Result<crate::models::LoggingGooglePubsubResponse, Error<UpdateLogGcpPubsubError>> {
408    let local_var_configuration = configuration;
409
410    // unbox the parameters
411    let service_id = params.service_id;
412    let version_id = params.version_id;
413    let logging_google_pubsub_name = params.logging_google_pubsub_name;
414    let name = params.name;
415    let placement = params.placement;
416    let response_condition = params.response_condition;
417    let format = params.format;
418    let log_processing_region = params.log_processing_region;
419    let format_version = params.format_version;
420    let user = params.user;
421    let secret_key = params.secret_key;
422    let account_name = params.account_name;
423    let topic = params.topic;
424    let project_id = params.project_id;
425
426
427    let local_var_client = &local_var_configuration.client;
428
429    let local_var_uri_str = format!("{}/service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name}", local_var_configuration.base_path, service_id=crate::apis::urlencode(service_id), version_id=version_id, logging_google_pubsub_name=crate::apis::urlencode(logging_google_pubsub_name));
430    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
431
432    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
433        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
434    }
435    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
436        let local_var_key = local_var_apikey.key.clone();
437        let local_var_value = match local_var_apikey.prefix {
438            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
439            None => local_var_key,
440        };
441        local_var_req_builder = local_var_req_builder.header("Fastly-Key", local_var_value);
442    };
443    let mut local_var_form_params = std::collections::HashMap::new();
444    if let Some(local_var_param_value) = name {
445        local_var_form_params.insert("name", local_var_param_value.to_string());
446    }
447    if let Some(local_var_param_value) = placement {
448        local_var_form_params.insert("placement", local_var_param_value.to_string());
449    }
450    if let Some(local_var_param_value) = response_condition {
451        local_var_form_params.insert("response_condition", local_var_param_value.to_string());
452    }
453    if let Some(local_var_param_value) = format {
454        local_var_form_params.insert("format", local_var_param_value.to_string());
455    }
456    if let Some(local_var_param_value) = log_processing_region {
457        local_var_form_params.insert("log_processing_region", local_var_param_value.to_string());
458    }
459    if let Some(local_var_param_value) = format_version {
460        local_var_form_params.insert("format_version", local_var_param_value.to_string());
461    }
462    if let Some(local_var_param_value) = user {
463        local_var_form_params.insert("user", local_var_param_value.to_string());
464    }
465    if let Some(local_var_param_value) = secret_key {
466        local_var_form_params.insert("secret_key", local_var_param_value.to_string());
467    }
468    if let Some(local_var_param_value) = account_name {
469        local_var_form_params.insert("account_name", local_var_param_value.to_string());
470    }
471    if let Some(local_var_param_value) = topic {
472        local_var_form_params.insert("topic", local_var_param_value.to_string());
473    }
474    if let Some(local_var_param_value) = project_id {
475        local_var_form_params.insert("project_id", local_var_param_value.to_string());
476    }
477    local_var_req_builder = local_var_req_builder.form(&local_var_form_params);
478
479    let local_var_req = local_var_req_builder.build()?;
480    let local_var_resp = local_var_client.execute(local_var_req).await?;
481
482    if "PUT" != "GET" && "PUT" != "HEAD" {
483      let headers = local_var_resp.headers();
484      local_var_configuration.rate_limit_remaining = match headers.get("Fastly-RateLimit-Remaining") {
485          Some(v) => v.to_str().unwrap().parse().unwrap(),
486          None => configuration::DEFAULT_RATELIMIT,
487      };
488      local_var_configuration.rate_limit_reset = match headers.get("Fastly-RateLimit-Reset") {
489          Some(v) => v.to_str().unwrap().parse().unwrap(),
490          None => 0,
491      };
492    }
493
494    let local_var_status = local_var_resp.status();
495    let local_var_content = local_var_resp.text().await?;
496
497    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
498        serde_json::from_str(&local_var_content).map_err(Error::from)
499    } else {
500        let local_var_entity: Option<UpdateLogGcpPubsubError> = serde_json::from_str(&local_var_content).ok();
501        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
502        Err(Error::ResponseError(local_var_error))
503    }
504}
505