Skip to content

Commit

Permalink
Merge pull request #780 from OpenSourceBrain/release/0.7.3
Browse files Browse the repository at this point in the history
Release/0.7.3
  • Loading branch information
filippomc authored Jul 31, 2023
2 parents d10c41d + 53381fa commit a2ef3a9
Show file tree
Hide file tree
Showing 250 changed files with 6,423 additions and 8,664 deletions.
135 changes: 116 additions & 19 deletions applications/accounts-api/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,27 @@ paths:
description: Application is not ready yet
operationId: ready
summary: Test if application is ready to take requests
/users:
post:
'/users/{userid}':
get:
tags:
- users
parameters:
-
name: userid
description: user id
schema:
type: string
in: path
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: Get a user's public information
operationId: getUser
put:
requestBody:
content:
application/json:
Expand All @@ -61,27 +80,27 @@ paths:
security:
-
bearerAuth: []
operationId: createUser
'/users/{userid}':
operationId: updateUser
parameters:
-
name: userid
description: user id
schema:
type: string
in: path
required: true
'/groups/{groupname}/':
get:
tags:
- users
parameters:
-
name: userid
description: user id
schema:
type: string
in: path
required: true
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
$ref: '#/components/schemas/Group'
description: Get a user's public information
operationId: getUser
operationId: getGroup
put:
requestBody:
content:
Expand All @@ -90,7 +109,7 @@ paths:
$ref: '#/components/schemas/User'
required: true
tags:
- users
- groups
responses:
'200':
content:
Expand All @@ -101,15 +120,65 @@ paths:
security:
-
bearerAuth: []
operationId: updateUser
operationId: updateGroup
parameters:
-
name: userid
description: user id
name: groupname
schema:
type: string
in: path
required: true
'/groups/{groupname}/users':
get:
tags:
- groups
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
description: Get a user's public information
operationId: getGroupUsers
parameters:
-
name: groupname
schema:
type: string
in: path
required: true
/users:
get:
tags:
- users
parameters:
-
name: query_string
description: query filter
schema:
type: string
in: query
required: false
responses:
'200':
content:
application/json:
schema:
type: object
properties:
users:
type: array
items:
$ref: '#/components/schemas/User'
description: Get list of users
security:
-
bearerAuth: []
operationId: get_users
summary: Get list of users based on query
x-openapi-router-controller: accounts_api.controllers.users_controller
components:
schemas:
Valid:
Expand Down Expand Up @@ -166,6 +235,34 @@ components:
$ref: '#/components/schemas/Profiles'
description: ''
additionalProperties: true
Group:
description: ''
required:
- name
type: object
properties:
quotas:
$ref: '#/components/schemas/Profiles'
description: ''
name:
description: ''
type: string
description:
description: ''
links:
$ref: '#/components/schemas/Profiles'
description: ''
keywords:
description: ''
type: array
items:
type: string
image:
$ref: '#/components/schemas/Url'
description: Image url
email:
description: ''
type: string
securitySchemes:
bearerAuth:
scheme: bearer
Expand Down
5 changes: 3 additions & 2 deletions applications/accounts-api/backend/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
setup.py
*/controllers/*
Dockerfile
src/__main__.py
**/__main__.py
requirements.txt
test-requirements.txt
test-requirements.txt
*/.openapi-generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from accounts_api.models.group import Group # noqa: E501
from accounts_api.models.user import User # noqa: E501
from accounts_api import util

from accounts_api.services import group_service

def get_group(groupname): # noqa: E501
"""get_group
# noqa: E501
:param groupname:
:type groupname: str
:rtype: Union[Group, Tuple[Group, int], Tuple[Group, int, Dict[str, str]]
"""
try:
return group_service.get_group_by_name(groupname)
except group_service.GroupNotFound as e:
return "Group not found", 404



def get_group_users(groupname): # noqa: E501
"""get_group_users
# noqa: E501
:param groupname:
:type groupname: str
:rtype: Union[Group, Tuple[Group, int], Tuple[Group, int, Dict[str, str]]
"""
try:
return group_service.get_group_users(groupname)
except group_service.GroupNotFound as e:
return "Group not found", 404


def update_group(groupname, request_body): # noqa: E501
"""update_group
# noqa: E501
:param groupname:
:type groupname: str
:param request_body:
:type request_body: Dict[str, ]
:rtype: Union[User, Tuple[User, int], Tuple[User, int, Dict[str, str]]
"""
return 'do some magic!'
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from accounts_api.models.get_users200_response import GetUsers200Response
from accounts_api.models.group import Group
from accounts_api.models.user import User
from accounts_api.models.valid import Valid
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# coding: utf-8

from __future__ import absolute_import
from datetime import date, datetime # noqa: F401

from typing import List, Dict # noqa: F401

from accounts_api.models.base_model_ import Model
from accounts_api.models.user import User
from accounts_api import util

from accounts_api.models.user import User # noqa: E501

class GetUsers200Response(Model):
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually.
"""

def __init__(self, users=None): # noqa: E501
"""GetUsers200Response - a model defined in OpenAPI
:param users: The users of this GetUsers200Response. # noqa: E501
:type users: List[User]
"""
self.openapi_types = {
'users': List[User]
}

self.attribute_map = {
'users': 'users'
}

self._users = users

@classmethod
def from_dict(cls, dikt) -> 'GetUsers200Response':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The get_users_200_response of this GetUsers200Response. # noqa: E501
:rtype: GetUsers200Response
"""
return util.deserialize_model(dikt, cls)

@property
def users(self):
"""Gets the users of this GetUsers200Response.
:return: The users of this GetUsers200Response.
:rtype: List[User]
"""
return self._users

@users.setter
def users(self, users):
"""Sets the users of this GetUsers200Response.
:param users: The users of this GetUsers200Response.
:type users: List[User]
"""

self._users = users
Loading

0 comments on commit a2ef3a9

Please sign in to comment.