Skip to content

Commit

Permalink
#666 groups api stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed May 23, 2023
1 parent c981042 commit 8986960
Show file tree
Hide file tree
Showing 12 changed files with 673 additions and 8 deletions.
80 changes: 80 additions & 0 deletions applications/accounts-api/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,64 @@ paths:
type: string
in: path
required: true
'/groups/{groupname}/':
get:
tags:
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
description: Get a user's public information
operationId: getGroup
put:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
tags:
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: The user as just saved
security:
-
bearerAuth: []
operationId: updateGroup
parameters:
-
name: groupname
schema:
type: string
in: path
required: true
'/groups/{groupname}/users':
get:
tags:
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
description: Get a user's public information
operationId: getGroupUsers
parameters:
-
name: groupname
schema:
type: string
in: path
required: true
components:
schemas:
Valid:
Expand Down Expand Up @@ -166,6 +224,28 @@ 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
securitySchemes:
bearerAuth:
scheme: bearer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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


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]]
"""
return 'do some magic!'


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]]
"""
return 'do some magic!'


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,6 @@
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from accounts_api.models.group import Group
from accounts_api.models.user import User
from accounts_api.models.valid import Valid
180 changes: 180 additions & 0 deletions applications/accounts-api/backend/accounts_api/models/group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
# 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 import util


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

def __init__(self, quotas=None, name=None, description=None, links=None, keywords=None): # noqa: E501
"""Group - a model defined in OpenAPI
:param quotas: The quotas of this Group. # noqa: E501
:type quotas: Dict[str, object]
:param name: The name of this Group. # noqa: E501
:type name: str
:param description: The description of this Group. # noqa: E501
:type description: object
:param links: The links of this Group. # noqa: E501
:type links: Dict[str, object]
:param keywords: The keywords of this Group. # noqa: E501
:type keywords: List[str]
"""
self.openapi_types = {
'quotas': Dict[str, object],
'name': str,
'description': object,
'links': Dict[str, object],
'keywords': List[str]
}

self.attribute_map = {
'quotas': 'quotas',
'name': 'name',
'description': 'description',
'links': 'links',
'keywords': 'keywords'
}

self._quotas = quotas
self._name = name
self._description = description
self._links = links
self._keywords = keywords

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

@property
def quotas(self):
"""Gets the quotas of this Group.
# noqa: E501
:return: The quotas of this Group.
:rtype: Dict[str, object]
"""
return self._quotas

@quotas.setter
def quotas(self, quotas):
"""Sets the quotas of this Group.
# noqa: E501
:param quotas: The quotas of this Group.
:type quotas: Dict[str, object]
"""

self._quotas = quotas

@property
def name(self):
"""Gets the name of this Group.
# noqa: E501
:return: The name of this Group.
:rtype: str
"""
return self._name

@name.setter
def name(self, name):
"""Sets the name of this Group.
# noqa: E501
:param name: The name of this Group.
:type name: str
"""
if name is None:
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501

self._name = name

@property
def description(self):
"""Gets the description of this Group.
# noqa: E501
:return: The description of this Group.
:rtype: object
"""
return self._description

@description.setter
def description(self, description):
"""Sets the description of this Group.
# noqa: E501
:param description: The description of this Group.
:type description: object
"""

self._description = description

@property
def links(self):
"""Gets the links of this Group.
# noqa: E501
:return: The links of this Group.
:rtype: Dict[str, object]
"""
return self._links

@links.setter
def links(self, links):
"""Sets the links of this Group.
# noqa: E501
:param links: The links of this Group.
:type links: Dict[str, object]
"""

self._links = links

@property
def keywords(self):
"""Gets the keywords of this Group.
# noqa: E501
:return: The keywords of this Group.
:rtype: List[str]
"""
return self._keywords

@keywords.setter
def keywords(self, keywords):
"""Sets the keywords of this Group.
# noqa: E501
:param keywords: The keywords of this Group.
:type keywords: List[str]
"""

self._keywords = keywords
Loading

0 comments on commit 8986960

Please sign in to comment.