From 7b9ed275550b2a7ab1271ed0ff99ca2c13a86141 Mon Sep 17 00:00:00 2001
From: Karel van Klink <karel.vanklink@geant.org>
Date: Wed, 11 Dec 2024 15:39:34 +0100
Subject: [PATCH] Update docstrings in a few product blocks

---
 gso/products/product_blocks/edge_port.py      | 39 ++++++++++---------
 .../product_blocks/l3_core_service.py         | 14 ++++---
 .../product_blocks/service_binding_port.py    | 14 ++++---
 3 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/gso/products/product_blocks/edge_port.py b/gso/products/product_blocks/edge_port.py
index 8f5c4bb1..d7249d34 100644
--- a/gso/products/product_blocks/edge_port.py
+++ b/gso/products/product_blocks/edge_port.py
@@ -12,16 +12,14 @@ from gso.utils.types.interfaces import LAGMemberList, PhysicalPortCapacity
 
 
 class EncapsulationType(strEnum):
-    """Types of encapsulation for edge ports.
-
-    Null supports a single service on the port.
-    Dot1Q supports multiple services for one customer or services for multiple customers.
-    QinQ expands VLAN space by double-tagging frames.
-    """
+    """Types of encapsulation for edge ports."""
 
     DOT1Q = "dot1q"
+    """Dot1Q supports multiple services for one customer or services for multiple customers."""
     QINQ = "qinq"
+    """QinQ expands VLAN space by double-tagging frames."""
     NULL = "null"
+    """Null supports a single service on the port."""
 
 
 class EdgePortType(strEnum):
@@ -94,29 +92,32 @@ class EdgePortBlockProvisioning(EdgePortBlockInactive, lifecycle=[SubscriptionLi
 
 
 class EdgePortBlock(EdgePortBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """An edge port that's currently deployed in the network."""
+    """An edge port that's currently deployed in the network.
+
+    Attributes:
+        node: The router that this Edge Port is connected to.
+        edge_port_name: The name of the edge port, in our case, corresponds to the name of the LAG interface.
+        edge_port_description: A description of the edge port.
+        enable_lacp: Indicates whether LACP is enabled for this edge port.
+        encapsulation: The type of encapsulation used on this edge port, by default DOT1Q.
+        mac_address: The MAC address assigned to this edge port, if applicable.
+        member_speed: The speed capacity of each member in the physical port.
+        minimum_links: The minimum number of links required for this edge port.
+        edge_port_type: The type of edge port (e.g., customer, private, public).
+        ignore_if_down: If set to True, the edge port will be ignored if it is down.
+        ga_id: The GEANT GA ID associated with this edge port, if any.
+        edge_port_ae_members: A list of LAG members associated with this edge port.
+    """
 
-    #: The router that this edge port is connected to.
     node: RouterBlock
-    #: The name of the edge port, in our case, corresponds to the name of the LAG interface.
     edge_port_name: str
-    #: A description of the edge port.
     edge_port_description: str | None = None
-    #: Indicates whether LACP is enabled for this edge port.
     enable_lacp: bool
-    #: The type of encapsulation used on this edge port, by default DOT1Q.
     encapsulation: EncapsulationType = EncapsulationType.DOT1Q
-    #: The MAC address assigned to this edge port, if applicable.
     mac_address: str | None = None
-    #: The speed capacity of each member in the physical port.
     member_speed: PhysicalPortCapacity
-    #: The minimum number of links required for this edge port.
     minimum_links: int | None = None
-    #: The type of edge port (e.g., customer, private, public).
     edge_port_type: EdgePortType
-    #: If set to True, the edge port will be ignored if it is down.
     ignore_if_down: bool = False
-    #: The GEANT GA ID associated with this edge port, if any.
     ga_id: str | None = None
-    #: A list of LAG members associated with this edge port.
     edge_port_ae_members: LAGMemberList[EdgePortAEMemberBlock]  # type: ignore[assignment]
diff --git a/gso/products/product_blocks/l3_core_service.py b/gso/products/product_blocks/l3_core_service.py
index 129b9477..088dd5ee 100644
--- a/gso/products/product_blocks/l3_core_service.py
+++ b/gso/products/product_blocks/l3_core_service.py
@@ -27,11 +27,13 @@ class AccessPortProvisioning(AccessPortInactive, lifecycle=[SubscriptionLifecycl
 
 
 class AccessPort(AccessPortProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """An access port for an R&E service."""
+    """An access port for an R&E service.
 
-    #: The type of Access Port
+    Attributes:
+        ap_type: The type of Access Port
+        sbp: The corresponding SBP of this Access Port.
+    """
     ap_type: APType
-    #: The corresponding SBP of this Access Port.
     sbp: ServiceBindingPort
 
 
@@ -50,7 +52,9 @@ class L3CoreServiceBlockProvisioning(L3CoreServiceBlockInactive, lifecycle=[Subs
 
 
 class L3CoreServiceBlock(L3CoreServiceBlockProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """An active L3 Core Service subscription block."""
+    """An active L3 Core Service subscription block.
 
-    #: The list of Access Points where this service is present.
+    Attributes:
+        ap_list: The list of Access Points where this service is present.
+    """
     ap_list: list[AccessPort]  # type: ignore[assignment]
diff --git a/gso/products/product_blocks/service_binding_port.py b/gso/products/product_blocks/service_binding_port.py
index 6d736f56..33c88720 100644
--- a/gso/products/product_blocks/service_binding_port.py
+++ b/gso/products/product_blocks/service_binding_port.py
@@ -39,15 +39,17 @@ class BFDSettingsProvisioning(BFDSettingsInactive, lifecycle=[SubscriptionLifecy
 
 
 class BFDSettings(BFDSettingsProvisioning, lifecycle=[SubscriptionLifecycle.ACTIVE]):
-    """A set of settings for BFD."""
-
-    #: Whether BFD is enabled.
+    """A set of settings for BFD.
+
+    Attributes:
+        bfd_enabled: Whether BFD is enabled.
+        bfd_interval_rx: The BFD interval RX, if enabled.
+        bfd_interval_tx: The BFD interval TX, if enabled.
+        bfd_multiplier: The BFD multiplier, if enabled.
+    """
     bfd_enabled: bool
-    #: The BFD interval RX, if enabled.
     bfd_interval_rx: int | None
-    #: The BFD interval TX, if enabled.
     bfd_interval_tx: int | None
-    #: The BFD multiplier, if enabled.
     bfd_multiplier: int | None
 
 
-- 
GitLab