openshift_openapi/v4_5/api/network/v1/
net_namespace.rs

1// Generated from definition com.github.openshift.api.network.v1.NetNamespace
2
3/// NetNamespace describes a single isolated network. When using the redhat/openshift-ovs-multitenant plugin, every Namespace will have a corresponding NetNamespace object with the same name. (When using redhat/openshift-ovs-subnet, NetNamespaces are not used.)
4#[derive(Clone, Debug, Default, PartialEq)]
5pub struct NetNamespace {
6    /// EgressIPs is a list of reserved IPs that will be used as the source for external traffic coming from pods in this namespace. (If empty, external traffic will be masqueraded to Node IPs.)
7    pub egress_i_ps: Option<Vec<String>>,
8
9    /// Standard object's metadata.
10    pub metadata: k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta,
11
12    /// NetID is the network identifier of the network namespace assigned to each overlay network packet. This can be manipulated with the "oc adm pod-network" commands.
13    pub netid: i64,
14
15    /// NetName is the name of the network namespace. (This is the same as the object's name, but both fields must be set.)
16    pub netname: String,
17}
18
19// Begin network.openshift.io/v1/NetNamespace
20
21// Generated from operation createNetworkOpenshiftIoV1NetNamespace
22
23impl NetNamespace {
24    /// create a NetNamespace
25    ///
26    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::CreateResponse`]`<Self>>` constructor, or [`k8s_openapi::CreateResponse`]`<Self>` directly, to parse the HTTP response.
27    ///
28    /// # Arguments
29    ///
30    /// * `body`
31    ///
32    /// * `optional`
33    ///
34    ///     Optional parameters. Use `Default::default()` to not pass any.
35    #[cfg(feature = "api")]
36    pub fn create_net_namespace(
37        body: &crate::api::network::v1::NetNamespace,
38        optional: k8s_openapi::CreateOptional<'_>,
39    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::CreateResponse<Self>>), k8s_openapi::RequestError> {
40        let __url = "/apis/network.openshift.io/v1/netnamespaces?".to_owned();
41        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
42        optional.__serialize(&mut __query_pairs);
43        let __url = __query_pairs.finish();
44
45        let __request = http::Request::post(__url);
46        let __body = serde_json::to_vec(body).map_err(k8s_openapi::RequestError::Json)?;
47        let __request = __request.header(http::header::CONTENT_TYPE, http::header::HeaderValue::from_static("application/json"));
48        match __request.body(__body) {
49            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
50            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
51        }
52    }
53}
54
55// Generated from operation deleteNetworkOpenshiftIoV1CollectionNetNamespace
56
57impl NetNamespace {
58    /// delete collection of NetNamespace
59    ///
60    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::DeleteResponse`]`<`[`k8s_openapi::List`]`<Self>>>` constructor, or [`k8s_openapi::DeleteResponse`]`<`[`k8s_openapi::List`]`<Self>>` directly, to parse the HTTP response.
61    ///
62    /// # Arguments
63    ///
64    /// * `delete_optional`
65    ///
66    ///     Delete options. Use `Default::default()` to not pass any.
67    ///
68    /// * `list_optional`
69    ///
70    ///     List options. Use `Default::default()` to not pass any.
71    #[cfg(feature = "api")]
72    pub fn delete_collection_net_namespace(
73        delete_optional: k8s_openapi::DeleteOptional<'_>,
74        list_optional: k8s_openapi::ListOptional<'_>,
75    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::DeleteResponse<k8s_openapi::List<Self>>>), k8s_openapi::RequestError> {
76        let __url = "/apis/network.openshift.io/v1/netnamespaces?".to_owned();
77        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
78        list_optional.__serialize(&mut __query_pairs);
79        let __url = __query_pairs.finish();
80
81        let __request = http::Request::delete(__url);
82        let __body = serde_json::to_vec(&delete_optional).map_err(k8s_openapi::RequestError::Json)?;
83        let __request = __request.header(http::header::CONTENT_TYPE, http::header::HeaderValue::from_static("application/json"));
84        match __request.body(__body) {
85            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
86            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
87        }
88    }
89}
90
91// Generated from operation deleteNetworkOpenshiftIoV1NetNamespace
92
93impl NetNamespace {
94    /// delete a NetNamespace
95    ///
96    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::DeleteResponse`]`<Self>>` constructor, or [`k8s_openapi::DeleteResponse`]`<Self>` directly, to parse the HTTP response.
97    ///
98    /// # Arguments
99    ///
100    /// * `name`
101    ///
102    ///     name of the NetNamespace
103    ///
104    /// * `optional`
105    ///
106    ///     Optional parameters. Use `Default::default()` to not pass any.
107    #[cfg(feature = "api")]
108    pub fn delete_net_namespace(
109        name: &str,
110        optional: k8s_openapi::DeleteOptional<'_>,
111    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::DeleteResponse<Self>>), k8s_openapi::RequestError> {
112        let __url = format!("/apis/network.openshift.io/v1/netnamespaces/{name}",
113            name = k8s_openapi::percent_encoding::percent_encode(name.as_bytes(), k8s_openapi::percent_encoding2::PATH_SEGMENT_ENCODE_SET),
114        );
115
116        let __request = http::Request::delete(__url);
117        let __body = serde_json::to_vec(&optional).map_err(k8s_openapi::RequestError::Json)?;
118        let __request = __request.header(http::header::CONTENT_TYPE, http::header::HeaderValue::from_static("application/json"));
119        match __request.body(__body) {
120            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
121            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
122        }
123    }
124}
125
126// Generated from operation listNetworkOpenshiftIoV1NetNamespace
127
128impl NetNamespace {
129    /// list or watch objects of kind NetNamespace
130    ///
131    /// This operation only supports listing all items of this type.
132    ///
133    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::ListResponse`]`<Self>>` constructor, or [`k8s_openapi::ListResponse`]`<Self>` directly, to parse the HTTP response.
134    ///
135    /// # Arguments
136    ///
137    /// * `optional`
138    ///
139    ///     Optional parameters. Use `Default::default()` to not pass any.
140    #[cfg(feature = "api")]
141    pub fn list_net_namespace(
142        optional: k8s_openapi::ListOptional<'_>,
143    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::ListResponse<Self>>), k8s_openapi::RequestError> {
144        let __url = "/apis/network.openshift.io/v1/netnamespaces?".to_owned();
145        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
146        optional.__serialize(&mut __query_pairs);
147        let __url = __query_pairs.finish();
148
149        let __request = http::Request::get(__url);
150        let __body = vec![];
151        match __request.body(__body) {
152            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
153            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
154        }
155    }
156}
157
158// Generated from operation patchNetworkOpenshiftIoV1NetNamespace
159
160impl NetNamespace {
161    /// partially update the specified NetNamespace
162    ///
163    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::PatchResponse`]`<Self>>` constructor, or [`k8s_openapi::PatchResponse`]`<Self>` directly, to parse the HTTP response.
164    ///
165    /// # Arguments
166    ///
167    /// * `name`
168    ///
169    ///     name of the NetNamespace
170    ///
171    /// * `body`
172    ///
173    /// * `optional`
174    ///
175    ///     Optional parameters. Use `Default::default()` to not pass any.
176    #[cfg(feature = "api")]
177    pub fn patch_net_namespace(
178        name: &str,
179        body: &k8s_openapi::apimachinery::pkg::apis::meta::v1::Patch,
180        optional: k8s_openapi::PatchOptional<'_>,
181    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::PatchResponse<Self>>), k8s_openapi::RequestError> {
182        let __url = format!("/apis/network.openshift.io/v1/netnamespaces/{name}?",
183            name = k8s_openapi::percent_encoding::percent_encode(name.as_bytes(), k8s_openapi::percent_encoding2::PATH_SEGMENT_ENCODE_SET),
184        );
185        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
186        optional.__serialize(&mut __query_pairs);
187        let __url = __query_pairs.finish();
188
189        let __request = http::Request::patch(__url);
190        let __body = serde_json::to_vec(body).map_err(k8s_openapi::RequestError::Json)?;
191        let __request = __request.header(http::header::CONTENT_TYPE, http::header::HeaderValue::from_static(match body {
192            k8s_openapi::apimachinery::pkg::apis::meta::v1::Patch::Json(_) => "application/json-patch+json",
193            k8s_openapi::apimachinery::pkg::apis::meta::v1::Patch::Merge(_) => "application/merge-patch+json",
194            k8s_openapi::apimachinery::pkg::apis::meta::v1::Patch::StrategicMerge(_) => "application/strategic-merge-patch+json",
195        }));
196        match __request.body(__body) {
197            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
198            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
199        }
200    }
201}
202
203// Generated from operation readNetworkOpenshiftIoV1NetNamespace
204
205impl NetNamespace {
206    /// read the specified NetNamespace
207    ///
208    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`ReadNetNamespaceResponse`]`>` constructor, or [`ReadNetNamespaceResponse`] directly, to parse the HTTP response.
209    ///
210    /// # Arguments
211    ///
212    /// * `name`
213    ///
214    ///     name of the NetNamespace
215    ///
216    /// * `optional`
217    ///
218    ///     Optional parameters. Use `Default::default()` to not pass any.
219    #[cfg(feature = "api")]
220    pub fn read_net_namespace(
221        name: &str,
222        optional: ReadNetNamespaceOptional<'_>,
223    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<ReadNetNamespaceResponse>), k8s_openapi::RequestError> {
224        let ReadNetNamespaceOptional {
225            exact,
226            export,
227            pretty,
228        } = optional;
229        let __url = format!("/apis/network.openshift.io/v1/netnamespaces/{name}?",
230            name = k8s_openapi::percent_encoding::percent_encode(name.as_bytes(), k8s_openapi::percent_encoding2::PATH_SEGMENT_ENCODE_SET),
231        );
232        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
233        if let Some(exact) = exact {
234            __query_pairs.append_pair("exact", &exact.to_string());
235        }
236        if let Some(export) = export {
237            __query_pairs.append_pair("export", &export.to_string());
238        }
239        if let Some(pretty) = pretty {
240            __query_pairs.append_pair("pretty", pretty);
241        }
242        let __url = __query_pairs.finish();
243
244        let __request = http::Request::get(__url);
245        let __body = vec![];
246        match __request.body(__body) {
247            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
248            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
249        }
250    }
251}
252
253/// Optional parameters of [`NetNamespace::read_net_namespace`]
254#[cfg(feature = "api")]
255#[derive(Clone, Copy, Debug, Default)]
256pub struct ReadNetNamespaceOptional<'a> {
257    /// Should the export be exact.  Exact export maintains cluster-specific fields like 'Namespace'.
258    pub exact: Option<bool>,
259    /// Should this value be exported.  Export strips fields that a user can not specify.
260    pub export: Option<bool>,
261    /// If 'true', then the output is pretty printed.
262    pub pretty: Option<&'a str>,
263}
264
265/// Use `<ReadNetNamespaceResponse as Response>::try_from_parts` to parse the HTTP response body of [`NetNamespace::read_net_namespace`]
266#[cfg(feature = "api")]
267#[derive(Debug)]
268pub enum ReadNetNamespaceResponse {
269    Ok(crate::api::network::v1::NetNamespace),
270    Other(Result<Option<serde_json::Value>, serde_json::Error>),
271}
272
273#[cfg(feature = "api")]
274impl k8s_openapi::Response for ReadNetNamespaceResponse {
275    fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), k8s_openapi::ResponseError> {
276        match status_code {
277            http::StatusCode::OK => {
278                let result = match serde_json::from_slice(buf) {
279                    Ok(value) => value,
280                    Err(ref err) if err.is_eof() => return Err(k8s_openapi::ResponseError::NeedMoreData),
281                    Err(err) => return Err(k8s_openapi::ResponseError::Json(err)),
282                };
283                Ok((ReadNetNamespaceResponse::Ok(result), buf.len()))
284            },
285            _ => {
286                let (result, read) =
287                    if buf.is_empty() {
288                        (Ok(None), 0)
289                    }
290                    else {
291                        match serde_json::from_slice(buf) {
292                            Ok(value) => (Ok(Some(value)), buf.len()),
293                            Err(ref err) if err.is_eof() => return Err(k8s_openapi::ResponseError::NeedMoreData),
294                            Err(err) => (Err(err), 0),
295                        }
296                    };
297                Ok((ReadNetNamespaceResponse::Other(result), read))
298            },
299        }
300    }
301}
302
303// Generated from operation replaceNetworkOpenshiftIoV1NetNamespace
304
305impl NetNamespace {
306    /// replace the specified NetNamespace
307    ///
308    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::ReplaceResponse`]`<Self>>` constructor, or [`k8s_openapi::ReplaceResponse`]`<Self>` directly, to parse the HTTP response.
309    ///
310    /// # Arguments
311    ///
312    /// * `name`
313    ///
314    ///     name of the NetNamespace
315    ///
316    /// * `body`
317    ///
318    /// * `optional`
319    ///
320    ///     Optional parameters. Use `Default::default()` to not pass any.
321    #[cfg(feature = "api")]
322    pub fn replace_net_namespace(
323        name: &str,
324        body: &crate::api::network::v1::NetNamespace,
325        optional: k8s_openapi::ReplaceOptional<'_>,
326    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::ReplaceResponse<Self>>), k8s_openapi::RequestError> {
327        let __url = format!("/apis/network.openshift.io/v1/netnamespaces/{name}?",
328            name = k8s_openapi::percent_encoding::percent_encode(name.as_bytes(), k8s_openapi::percent_encoding2::PATH_SEGMENT_ENCODE_SET),
329        );
330        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
331        optional.__serialize(&mut __query_pairs);
332        let __url = __query_pairs.finish();
333
334        let __request = http::Request::put(__url);
335        let __body = serde_json::to_vec(body).map_err(k8s_openapi::RequestError::Json)?;
336        let __request = __request.header(http::header::CONTENT_TYPE, http::header::HeaderValue::from_static("application/json"));
337        match __request.body(__body) {
338            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
339            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
340        }
341    }
342}
343
344// Generated from operation watchNetworkOpenshiftIoV1NetNamespace
345
346impl NetNamespace {
347    /// list or watch objects of kind NetNamespace
348    ///
349    /// This operation only supports watching one item, or a list of items, of this type for changes.
350    ///
351    /// Use the returned [`k8s_openapi::ResponseBody`]`<`[`k8s_openapi::WatchResponse`]`<Self>>` constructor, or [`k8s_openapi::WatchResponse`]`<Self>` directly, to parse the HTTP response.
352    ///
353    /// # Arguments
354    ///
355    /// * `optional`
356    ///
357    ///     Optional parameters. Use `Default::default()` to not pass any.
358    #[cfg(feature = "api")]
359    pub fn watch_net_namespace(
360        optional: k8s_openapi::WatchOptional<'_>,
361    ) -> Result<(http::Request<Vec<u8>>, fn(http::StatusCode) -> k8s_openapi::ResponseBody<k8s_openapi::WatchResponse<Self>>), k8s_openapi::RequestError> {
362        let __url = "/apis/network.openshift.io/v1/netnamespaces?".to_owned();
363        let mut __query_pairs = k8s_openapi::url::form_urlencoded::Serializer::new(__url);
364        optional.__serialize(&mut __query_pairs);
365        let __url = __query_pairs.finish();
366
367        let __request = http::Request::get(__url);
368        let __body = vec![];
369        match __request.body(__body) {
370            Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
371            Err(err) => Err(k8s_openapi::RequestError::Http(err)),
372        }
373    }
374}
375
376// End network.openshift.io/v1/NetNamespace
377
378impl k8s_openapi::Resource for NetNamespace {
379    const API_VERSION: &'static str = "network.openshift.io/v1";
380    const GROUP: &'static str = "network.openshift.io";
381    const KIND: &'static str = "NetNamespace";
382    const VERSION: &'static str = "v1";
383}
384
385impl k8s_openapi::ListableResource for NetNamespace {
386    const LIST_KIND: &'static str = concat!("NetNamespace", "List");
387}
388
389impl k8s_openapi::Metadata for NetNamespace {
390    type Ty = k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta;
391
392    fn metadata(&self) -> &<Self as k8s_openapi::Metadata>::Ty {
393        &self.metadata
394    }
395
396    fn metadata_mut(&mut self) -> &mut<Self as k8s_openapi::Metadata>::Ty {
397        &mut self.metadata
398    }
399}
400
401impl<'de> serde::Deserialize<'de> for NetNamespace {
402    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de> {
403        #[allow(non_camel_case_types)]
404        enum Field {
405            Key_api_version,
406            Key_kind,
407            Key_egress_i_ps,
408            Key_metadata,
409            Key_netid,
410            Key_netname,
411            Other,
412        }
413
414        impl<'de> serde::Deserialize<'de> for Field {
415            fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: serde::Deserializer<'de> {
416                struct Visitor;
417
418                impl<'de> serde::de::Visitor<'de> for Visitor {
419                    type Value = Field;
420
421                    fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
422                        f.write_str("field identifier")
423                    }
424
425                    fn visit_str<E>(self, v: &str) -> Result<Self::Value, E> where E: serde::de::Error {
426                        Ok(match v {
427                            "apiVersion" => Field::Key_api_version,
428                            "kind" => Field::Key_kind,
429                            "egressIPs" => Field::Key_egress_i_ps,
430                            "metadata" => Field::Key_metadata,
431                            "netid" => Field::Key_netid,
432                            "netname" => Field::Key_netname,
433                            _ => Field::Other,
434                        })
435                    }
436                }
437
438                deserializer.deserialize_identifier(Visitor)
439            }
440        }
441
442        struct Visitor;
443
444        impl<'de> serde::de::Visitor<'de> for Visitor {
445            type Value = NetNamespace;
446
447            fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
448                f.write_str(<Self::Value as k8s_openapi::Resource>::KIND)
449            }
450
451            fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error> where A: serde::de::MapAccess<'de> {
452                let mut value_egress_i_ps: Option<Vec<String>> = None;
453                let mut value_metadata: Option<k8s_openapi::apimachinery::pkg::apis::meta::v1::ObjectMeta> = None;
454                let mut value_netid: Option<i64> = None;
455                let mut value_netname: Option<String> = None;
456
457                while let Some(key) = serde::de::MapAccess::next_key::<Field>(&mut map)? {
458                    match key {
459                        Field::Key_api_version => {
460                            let value_api_version: String = serde::de::MapAccess::next_value(&mut map)?;
461                            if value_api_version != <Self::Value as k8s_openapi::Resource>::API_VERSION {
462                                return Err(serde::de::Error::invalid_value(serde::de::Unexpected::Str(&value_api_version), &<Self::Value as k8s_openapi::Resource>::API_VERSION));
463                            }
464                        },
465                        Field::Key_kind => {
466                            let value_kind: String = serde::de::MapAccess::next_value(&mut map)?;
467                            if value_kind != <Self::Value as k8s_openapi::Resource>::KIND {
468                                return Err(serde::de::Error::invalid_value(serde::de::Unexpected::Str(&value_kind), &<Self::Value as k8s_openapi::Resource>::KIND));
469                            }
470                        },
471                        Field::Key_egress_i_ps => value_egress_i_ps = serde::de::MapAccess::next_value(&mut map)?,
472                        Field::Key_metadata => value_metadata = Some(serde::de::MapAccess::next_value(&mut map)?),
473                        Field::Key_netid => value_netid = Some(serde::de::MapAccess::next_value(&mut map)?),
474                        Field::Key_netname => value_netname = Some(serde::de::MapAccess::next_value(&mut map)?),
475                        Field::Other => { let _: serde::de::IgnoredAny = serde::de::MapAccess::next_value(&mut map)?; },
476                    }
477                }
478
479                Ok(NetNamespace {
480                    egress_i_ps: value_egress_i_ps,
481                    metadata: value_metadata.ok_or_else(|| serde::de::Error::missing_field("metadata"))?,
482                    netid: value_netid.ok_or_else(|| serde::de::Error::missing_field("netid"))?,
483                    netname: value_netname.ok_or_else(|| serde::de::Error::missing_field("netname"))?,
484                })
485            }
486        }
487
488        deserializer.deserialize_struct(
489            <Self as k8s_openapi::Resource>::KIND,
490            &[
491                "apiVersion",
492                "kind",
493                "egressIPs",
494                "metadata",
495                "netid",
496                "netname",
497            ],
498            Visitor,
499        )
500    }
501}
502
503impl serde::Serialize for NetNamespace {
504    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: serde::Serializer {
505        let mut state = serializer.serialize_struct(
506            <Self as k8s_openapi::Resource>::KIND,
507            5 +
508            self.egress_i_ps.as_ref().map_or(0, |_| 1),
509        )?;
510        serde::ser::SerializeStruct::serialize_field(&mut state, "apiVersion", <Self as k8s_openapi::Resource>::API_VERSION)?;
511        serde::ser::SerializeStruct::serialize_field(&mut state, "kind", <Self as k8s_openapi::Resource>::KIND)?;
512        if let Some(value) = &self.egress_i_ps {
513            serde::ser::SerializeStruct::serialize_field(&mut state, "egressIPs", value)?;
514        }
515        serde::ser::SerializeStruct::serialize_field(&mut state, "metadata", &self.metadata)?;
516        serde::ser::SerializeStruct::serialize_field(&mut state, "netid", &self.netid)?;
517        serde::ser::SerializeStruct::serialize_field(&mut state, "netname", &self.netname)?;
518        serde::ser::SerializeStruct::end(state)
519    }
520}