Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISSUE - Test and Enhance Py SDK #42

Merged
merged 31 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04, macos-10.15, macos-11]
python-version: [3.7, 3.9]
os: [windows-2022, ubuntu-22.04, macos-11]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Official documentation for the SDK is hosted at [here](https://github.com/mainfl
```sh
pip install lazydocs requests
python3 setup.py install
lazydocs --src-base-url="https://github.com/mainflux/sdk-py/blob/main/" --overview-file="README.md" lib
lazydocs --src-base-url="https://github.com/mainflux/sdk-py/blob/main/" --overview-file="README.md" mainflux
```

Please note that lazydocs requires Python version 3.5 or higher.
Expand Down
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
- [`channels`](./channels.md#module-channels)
- [`errors`](./errors.md#module-errors)
- [`groups`](./groups.md#module-groups)
- [`keys`](./keys.md#module-keys)
- [`messages`](./messages.md#module-messages)
- [`response`](./response.md#module-response)
- [`sdk`](./sdk.md#module-sdk)
Expand All @@ -23,7 +22,6 @@
- [`certs.Certs`](./certs.md#class-certs)
- [`channels.Channels`](./channels.md#class-channels)
- [`groups.Groups`](./groups.md#class-groups)
- [`keys.Keys`](./keys.md#class-keys)
- [`messages.Messages`](./messages.md#class-messages)
- [`response.Error`](./response.md#class-error)
- [`response.Response`](./response.md#class-response)
Expand Down
14 changes: 7 additions & 7 deletions docs/boostrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Adds new config to the list of config owned by user identified using the provide

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L130"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L135"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `bootstrap`

Expand All @@ -59,7 +59,7 @@ Retrieves a configuration with given external ID and external key.

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L114"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `remove`

Expand All @@ -71,7 +71,7 @@ Removes a Config. In case of successful removal the service will ensure that the

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L72"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L73"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `update`

Expand All @@ -83,7 +83,7 @@ Update is performed by replacing the current resource data with values provided

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L93"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L96"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `update_certs`

Expand All @@ -101,19 +101,19 @@ Update is performed by replacing the current certificate data with values provid

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L56"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L57"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `view`

```python
view(config_id: str, token: str)
view(thing_id: str, token: str)
```

Retrieves a configuration with given config id

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L36"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/boostrap.py#L35"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `whitelist`

Expand Down
24 changes: 18 additions & 6 deletions docs/certs.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ __init__(url: str)
### <kbd>method</kbd> `issue`

```python
issue(thing_id: str, key_bits: int, key_type: str, valid: str, token: str)
issue(thing_id: str, valid: str, token: str)
```


Expand All @@ -49,7 +49,7 @@ issue(thing_id: str, key_bits: int, key_type: str, valid: str, token: str)

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/certs.py#L55"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/certs.py#L67"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `revoke`

Expand All @@ -63,15 +63,27 @@ revoke(thing_id: str, token: str)

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/certs.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/certs.py#L51"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `view`
### <kbd>method</kbd> `view_by_serial`

```python
view(thing_id: str, token: str)
view_by_serial(cert_id: str, token: str)
```

Generates an access token when provided with proper credentials.
Retrieves a certificate for a given cert ID.

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/certs.py#L35"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `view_by_thing`

```python
view_by_thing(thing_id: str, token: str)
```

Retrieves a list of certificates' serial IDs for a given thing ID.



Expand Down
18 changes: 9 additions & 9 deletions docs/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Creates channel entity in the database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L34"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L33"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `create_bulk`

Expand All @@ -59,19 +59,19 @@ Creates multiple channels in a bulk

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L123"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L115"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `delete`
### <kbd>method</kbd> `disable`

```python
delete(channel_id: str, token: str)
disable(channel_id: str, token: str)
```

Deletes a channel entity from database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L51"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L50"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `get`

Expand All @@ -83,7 +83,7 @@ Gets a channel entity for a logged-in user

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L67"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L66"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `get_all`

Expand All @@ -95,7 +95,7 @@ Gets all channels from database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L85"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L83"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `get_by_thing`

Expand All @@ -107,7 +107,7 @@ Gets all channels to which a specific thing is connected to

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L137"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L129"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `identify_thing`

Expand All @@ -119,7 +119,7 @@ Validates thing's key and returns it's ID if key is valid

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L108"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/channels.py#L100"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `update`

Expand Down
2 changes: 1 addition & 1 deletion docs/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- **channels**
- **messages**
- **groups**
- **boostrap**
- **bootstrap**
- **certs**

---
Expand Down
40 changes: 14 additions & 26 deletions docs/groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L8"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L9"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `Groups`




<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L11"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L12"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `__init__`

Expand All @@ -35,12 +35,12 @@ __init__(url: str)

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L148"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L152"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `assign`

```python
assign(group_id: str, members_ids, member_type: str, token: str)
assign(group_id: str, members_ids: str, member_type: dict, token: str)
```

Assign
Expand All @@ -59,7 +59,7 @@ Gets children for a specific group from database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L14"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L15"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `create`

Expand All @@ -71,15 +71,15 @@ Creates group entity in the database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L182"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L184"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `delete`
### <kbd>method</kbd> `disable`

```python
delete(group_id: str, token: str)
disable(group_id: str, user_token: str)
```

Deletes a group entity from database
Disables a group entity from database

---

Expand Down Expand Up @@ -107,7 +107,7 @@ Gets all groups from database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L118"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `members`

Expand All @@ -119,7 +119,7 @@ Get list of members ID's from group

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L133"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L135"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `memberships`

Expand All @@ -143,31 +143,19 @@ Gets parents for a specific group from database

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L196"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `share_groups`

```python
share_groups(token: str, user_group_id: str, thing_group_id: str)
```

Adds access rights on thing groups to the user group

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L165"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L168"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `unassign`

```python
unassign(group_id: str, token: str, members_ids)
```

Assign
Unassign

---

<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L102"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="https://github.com/mainflux/sdk-py/blob/main/mainflux/groups.py#L101"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `update`

Expand Down
Loading
Loading