Skip to main content

oci_rust_sdk/core/models/
service.rs

1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::*;
5/// An object that represents one or multiple Oracle services that you can enable for a {@link ServiceGateway}. In the User Guide topic [Access to Oracle Services: Service Gateway](https://docs.oracle.com/iaas/Content/Network/Tasks/servicegateway.htm), the term *service CIDR label* is used to refer to the string that represents the regional public IP address ranges of the Oracle service or services covered by a given {@code Service} object. That unique string is the value of the {@code Service} object's {@code cidrBlock} attribute.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct Service {
9    /// A string that represents the regional public IP address ranges for the Oracle service or services covered by this {@code Service} object. Also known as the {@code Service} object's *service CIDR label*. <p> When you set up a route rule to route traffic to the service gateway, use this value as the rule's destination. See {@link RouteTable}. Also, when you set up a security list rule to cover traffic with the service gateway, use the {@code cidrBlock} value as the rule's destination (for an egress rule) or the source (for an ingress rule). See {@link SecurityList}. <p> Example: {@code oci-phx-objectstorage}
10    pub cidr_block: String,
11
12    /// Description of the Oracle service or services covered by this {@code Service} object. <p> Example: {@code OCI PHX Object Storage}
13    pub description: String,
14
15    /// The {@code Service} object's [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
16    pub id: String,
17
18    /// Name of the {@code Service} object. This name can change and is not guaranteed to be unique. <p> Example: {@code OCI PHX Object Storage}
19    pub name: String,
20}
21
22/// Required fields for Service
23pub struct ServiceRequired {
24    /// A string that represents the regional public IP address ranges for the Oracle service or services covered by this {@code Service} object. Also known as the {@code Service} object's *service CIDR label*. <p> When you set up a route rule to route traffic to the service gateway, use this value as the rule's destination. See {@link RouteTable}. Also, when you set up a security list rule to cover traffic with the service gateway, use the {@code cidrBlock} value as the rule's destination (for an egress rule) or the source (for an ingress rule). See {@link SecurityList}. <p> Example: {@code oci-phx-objectstorage}
25    pub cidr_block: String,
26
27    /// Description of the Oracle service or services covered by this {@code Service} object. <p> Example: {@code OCI PHX Object Storage}
28    pub description: String,
29
30    /// The {@code Service} object's [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
31    pub id: String,
32
33    /// Name of the {@code Service} object. This name can change and is not guaranteed to be unique. <p> Example: {@code OCI PHX Object Storage}
34    pub name: String,
35}
36
37impl Service {
38    /// Create a new Service with required fields
39    pub fn new(required: ServiceRequired) -> Self {
40        Self {
41            cidr_block: required.cidr_block,
42
43            description: required.description,
44
45            id: required.id,
46
47            name: required.name,
48        }
49    }
50
51    /// Set cidr_block
52    pub fn set_cidr_block(mut self, value: String) -> Self {
53        self.cidr_block = value;
54        self
55    }
56
57    /// Set description
58    pub fn set_description(mut self, value: String) -> Self {
59        self.description = value;
60        self
61    }
62
63    /// Set id
64    pub fn set_id(mut self, value: String) -> Self {
65        self.id = value;
66        self
67    }
68
69    /// Set name
70    pub fn set_name(mut self, value: String) -> Self {
71        self.name = value;
72        self
73    }
74}