def citizens_post(body): # noqa: E501 """Create a new citizen A new citizen will be created in the database and assigned a unique id. The `name` and `phone_number` are required to make use of the subsidy service. The `phone_number` must be unique per citizen. # noqa: E501 :param body: citizen to add :type body: dict | bytes :rtype: Citizen """ if connexion.request.is_json: body = Citizen.from_dict(connexion.request.get_json()) # noqa: E501 response = service.citizens.create(body.to_dict()) return Citizen.from_dict(response)
def citizens_post(body): # noqa: E501 """Create a new citizen # noqa: E501 :param body: citizen to add :type body: dict | bytes :rtype: Citizen """ if connexion.request.is_json: body = Citizen.from_dict(connexion.request.get_json()) # noqa: E501 response = service.citizens.create(body.to_dict()) return Citizen.from_dict(response)
def citizens_id_put(id, body): # noqa: E501 """Re-upload a citizen's information # noqa: E501 :param id: :type id: str :param body: citizen details :type body: dict | bytes :rtype: Citizen """ if connexion.request.is_json: body = Citizen.from_dict(connexion.request.get_json()) # noqa: E501 response = service.citizens.replace(id, body.to_dict()) return Citizen.from_dict(response)
def citizens_id_patch(id, body): # noqa: E501 """Edit a citizen's information # noqa: E501 :param id: :type id: str :param body: citizen properties to be updated :type body: dict | bytes :rtype: Citizen """ if connexion.request.is_json: body = Citizen.from_dict(connexion.request.get_json()) # noqa: E501 response = service.citizens.update(id, body.to_dict()) return Citizen.from_dict(response)
def citizens_id_get(id): # noqa: E501 """Returns a specific citizen Get the information for a single citizen Currently no additional information is available compared to the list view. # noqa: E501 :param id: :type id: str :rtype: Citizen """ response = service.citizens.read(id) return Citizen.from_dict(response)
def citizens_id_get(id): # noqa: E501 """Returns a specific citizen # noqa: E501 :param id: :type id: str :rtype: Citizen """ response = service.citizens.read(id) return Citizen.from_dict(response)