Skip to content

Commit c288d8a

Browse files
docs: add comprehensive Sphinx RST documentation for Networks class
Added complete RST documentation for all 8 Networks class methods and 3 new TypedDict definitions. Documentation includes detailed parameter descriptions, return types, code examples, and links to official TagoIO documentation following the established pattern.
1 parent fcc2d62 commit c288d8a

2 files changed

Lines changed: 295 additions & 7 deletions

File tree

docs/source/Resources/IntegrationNetwork/IntegrationNetwork_Type.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,43 @@ TokenData
9696
| **serie_number**: Optional[str]
9797
| **verification_code**: Optional[str]
9898
| **middleware**: Optional[str]
99+
100+
101+
.. _NetworkTokenInfo:
102+
103+
NetworkTokenInfo
104+
----------------
105+
**Attributes:**
106+
107+
| **token**: str
108+
| **network**: :ref:`GenericID`
109+
| **name**: str
110+
| **permission**: str
111+
| **created_at**: datetime
112+
| **updated_at**: Optional[datetime]
113+
114+
115+
.. _NetworkQuery:
116+
117+
NetworkQuery
118+
------------
119+
**Attributes:**
120+
121+
| **page**: int
122+
| **amount**: int
123+
| **fields**: list[str]
124+
| **filter**: dict
125+
| **orderBy**: list[str]
126+
127+
128+
.. _ListTokenQuery:
129+
130+
ListTokenQuery
131+
--------------
132+
**Attributes:**
133+
134+
| **page**: int
135+
| **amount**: int
136+
| **fields**: list[str]
137+
| **filter**: dict
138+
| **orderBy**: list[str]

docs/source/Resources/IntegrationNetwork/index.rst

Lines changed: 255 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,277 @@
11
**Integration Network**
22
=======================
33

4-
Manage integration network in the account
4+
Manage integration networks in the account.
55

66
============
77
listNetwork
88
============
9-
Get list of networks
9+
10+
Retrieves a list of all networks from the account with pagination support.
11+
Use this to retrieve and manage networks in your application.
12+
13+
See: `Network Integration <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration>`_
1014

1115
**Parameters:**
1216

13-
| **queryObj**: :ref:`Query`
14-
| Network Query
17+
| *Optional* **queryObj**: :ref:`NetworkQuery`
18+
| Query parameters to filter the results.
19+
20+
.. code-block::
21+
:caption: **Default queryObj:**
22+
23+
queryObj = {
24+
"page": 1,
25+
"fields": ["id", "name"],
26+
"filter": {},
27+
"amount": 20,
28+
"orderBy": ["name", "asc"]
29+
}
30+
31+
**Returns:**
32+
33+
| List[:ref:`NetworkInfo`]
34+
35+
.. code-block:: python
36+
37+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management.
38+
from tagoio_sdk import Resources
39+
40+
resources = Resources()
41+
networks = resources.integration.networks.listNetwork({
42+
"page": 1,
43+
"fields": ["id", "name"],
44+
"amount": 20,
45+
"orderBy": ["name", "asc"]
46+
})
47+
print(networks) # [{'id': 'network-id-123', 'name': 'My Network', ...}]
1548
1649
1750
======
1851
info
1952
======
2053

21-
Gets information about the network
54+
Retrieves detailed information about a specific network.
55+
56+
See: `Network Integration <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration>`_
57+
58+
**Parameters:**
59+
60+
| **networkID**: :ref:`GenericID`
61+
| Network ID
62+
63+
| *Optional* **fields**: List[str]
64+
| Fields to retrieve (default: ["id", "name"])
65+
66+
**Returns:**
67+
68+
| :ref:`NetworkInfo`
69+
70+
.. code-block:: python
71+
72+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management.
73+
from tagoio_sdk import Resources
74+
75+
resources = Resources()
76+
network_info = resources.integration.networks.info("network-id-123")
77+
print(network_info) # {'id': '...', 'name': 'My Network', ...}
78+
79+
80+
======
81+
create
82+
======
83+
84+
Creates a new integration network in the account.
85+
86+
See: `Creating a Network Integration <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#create-a-new-integration>`_
87+
88+
**Parameters:**
89+
90+
| **networkObj**: :ref:`NetworkCreateInfo`
91+
| Network information
92+
93+
**Returns:**
94+
95+
| Dict[str, str]
96+
97+
.. code-block:: python
98+
99+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Create" in Access Management.
100+
from tagoio_sdk import Resources
101+
102+
resources = Resources()
103+
new_network = resources.integration.networks.create({
104+
"name": "My Custom Network",
105+
"description": "Custom integration network",
106+
"middleware_endpoint": "https://my-middleware.com/endpoint",
107+
"public": False
108+
})
109+
print(new_network) # {'network': 'network-id-123'}
110+
111+
112+
======
113+
edit
114+
======
115+
116+
Modifies any property of an existing network.
117+
118+
**Parameters:**
119+
120+
| **networkID**: :ref:`GenericID`
121+
| Network ID
122+
123+
| **networkObj**: :ref:`NetworkCreateInfo`
124+
| Network information to update
125+
126+
**Returns:**
127+
128+
| str
129+
130+
.. code-block:: python
131+
132+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Edit" in Access Management.
133+
from tagoio_sdk import Resources
134+
135+
resources = Resources()
136+
result = resources.integration.networks.edit("network-id-123", {
137+
"name": "Updated Network Name",
138+
"description": "Updated description",
139+
"public": True
140+
})
141+
print(result) # Successfully Updated
142+
143+
144+
======
145+
delete
146+
======
147+
148+
Permanently deletes a network from the account.
22149

23150
**Parameters:**
24151

25-
| **networkID**: GenericID: str
26-
| Network identification
152+
| **networkID**: :ref:`GenericID`
153+
| Network ID
154+
155+
**Returns:**
156+
157+
| str
158+
159+
.. code-block:: python
160+
161+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Delete" in Access Management.
162+
from tagoio_sdk import Resources
163+
164+
resources = Resources()
165+
result = resources.integration.networks.delete("network-id-123")
166+
print(result) # Successfully Removed
167+
168+
169+
==========
170+
tokenList
171+
==========
172+
173+
Retrieves a list of all authentication tokens for a network with optional filtering.
174+
175+
See: `Tokens and Getting Devices <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#tokens-and-getting-devices>`_
176+
177+
**Parameters:**
178+
179+
| **networkID**: :ref:`GenericID`
180+
| Network ID
181+
182+
| *Optional* **queryObj**: :ref:`ListTokenQuery`
183+
| Query parameters to filter the results.
184+
185+
.. code-block::
186+
:caption: **Default queryObj:**
187+
188+
queryObj = {
189+
"page": 1,
190+
"fields": ["name", "token", "permission"],
191+
"filter": {},
192+
"amount": 20,
193+
"orderBy": ["created_at", "desc"]
194+
}
195+
196+
**Returns:**
197+
198+
| List[:ref:`NetworkTokenInfo`]
199+
200+
.. code-block:: python
201+
202+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Access" in Access Management.
203+
from tagoio_sdk import Resources
204+
205+
resources = Resources()
206+
tokens = resources.integration.networks.tokenList("network-id-123", {
207+
"page": 1,
208+
"amount": 20,
209+
"fields": ["name", "token", "permission"],
210+
"orderBy": ["created_at", "desc"]
211+
})
212+
print(tokens) # [{'name': 'Default Token', 'token': '...', 'permission': 'full', ...}]
213+
214+
215+
===========
216+
tokenCreate
217+
===========
218+
219+
Generates and retrieves a new authentication token for a network.
220+
221+
See: `Tokens and Getting Devices <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#tokens-and-getting-devices>`_
222+
223+
**Parameters:**
224+
225+
| **networkID**: :ref:`GenericID`
226+
| Network ID
227+
228+
| **tokenParams**: :ref:`IntegrationTokenData`
229+
| Parameters for the new token
230+
231+
**Returns:**
232+
233+
| :ref:`TokenCreateResponse`
234+
235+
.. code-block:: python
236+
237+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Create Token" in Access Management.
238+
from tagoio_sdk import Resources
239+
240+
resources = Resources()
241+
result = resources.integration.networks.tokenCreate("network-id-123", {
242+
"name": "Production Token",
243+
"permission": "write",
244+
"expire_time": "never"
245+
})
246+
print(result) # {'token': 'new-token-value', 'expire_date': None}
247+
248+
249+
===========
250+
tokenDelete
251+
===========
252+
253+
Permanently deletes an authentication token.
254+
255+
See: `Tokens and Getting Devices <https://docs.tago.io/docs/tagoio/integrations/general/creating-a-network-integration#tokens-and-getting-devices>`_
256+
257+
**Parameters:**
258+
259+
| **token**: :ref:`GenericToken`
260+
| Token to delete
261+
262+
**Returns:**
263+
264+
| str
265+
266+
.. code-block:: python
267+
268+
# If receive an error "Authorization Denied", check policy "Integration Network" / "Delete Token" in Access Management.
269+
from tagoio_sdk import Resources
270+
271+
resources = Resources()
272+
result = resources.integration.networks.tokenDelete("token-to-delete")
273+
print(result) # Successfully Removed
274+
27275
28276
.. toctree::
29277

0 commit comments

Comments
 (0)