1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use serde::{Deserialize, Serialize}; /*
* Service Control API
*
* Provides admission control and telemetry reporting for services integrated with Service Infrastructure.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::google_rest_apis::servicecontrol_v1::models;
/// Peer : This message defines attributes for a node that handles a network request. The node can be either a service or an application that sends, forwards, or receives the request. Service peers should fill in `principal` and `labels` as appropriate.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Peer {
/// The IP address of the peer.
#[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
pub ip: Option<String>,
/// The labels associated with the peer.
#[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
pub labels: Option<std::collections::HashMap<String, String>>,
/// The network port of the peer.
#[serde(rename = "port", skip_serializing_if = "Option::is_none")]
pub port: Option<String>,
/// The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.
#[serde(rename = "principal", skip_serializing_if = "Option::is_none")]
pub principal: Option<String>,
/// The CLDR country/region code associated with the above IP address. If the IP address is private, the `region_code` should reflect the physical location where this peer is running.
#[serde(rename = "regionCode", skip_serializing_if = "Option::is_none")]
pub region_code: Option<String>,
}
impl Peer {
/// This message defines attributes for a node that handles a network request. The node can be either a service or an application that sends, forwards, or receives the request. Service peers should fill in `principal` and `labels` as appropriate.
pub fn new() -> Peer {
Peer {
ip: None,
labels: None,
port: None,
principal: None,
region_code: None,
}
}
}