├── .github └── workflows │ ├── deutschland_generator.yaml │ └── openapi_check.yaml ├── CNAME ├── README.md ├── generator_config.yaml ├── index.html ├── openapi.yaml └── python-client ├── .openapi-generator-ignore ├── .openapi-generator ├── FILES └── VERSION ├── README.md ├── deutschland └── lebensmittelwarnung │ ├── __init__.py │ ├── api │ ├── __init__.py │ └── default_api.py │ ├── api_client.py │ ├── apis │ └── __init__.py │ ├── configuration.py │ ├── exceptions.py │ ├── model │ ├── __init__.py │ ├── list_warnungen_request.py │ ├── request_options.py │ ├── response.py │ ├── response_docs_inner.py │ ├── response_docs_inner_product.py │ ├── response_docs_inner_rapex_information.py │ └── response_docs_inner_safety_information.py │ ├── model_utils.py │ ├── models │ └── __init__.py │ └── rest.py ├── docs ├── DefaultApi.md ├── ListWarnungenRequest.md ├── RequestOptions.md ├── Response.md ├── ResponseDocsInner.md ├── ResponseDocsInnerProduct.md ├── ResponseDocsInnerRapexInformation.md └── ResponseDocsInnerSafetyInformation.md ├── pyproject.toml ├── requirements.txt ├── sphinx-docs ├── Makefile ├── conf.py ├── index.rst ├── make.bat └── source │ ├── lebensmittelwarnung.api.rst │ ├── lebensmittelwarnung.apis.rst │ ├── lebensmittelwarnung.model.rst │ ├── lebensmittelwarnung.models.rst │ ├── lebensmittelwarnung.rst │ └── modules.rst ├── test-requirements.txt ├── test ├── __init__.py ├── test_default_api.py ├── test_list_warnungen_request.py ├── test_request_options.py ├── test_response.py ├── test_response_docs_inner.py ├── test_response_docs_inner_product.py ├── test_response_docs_inner_rapex_information.py └── test_response_docs_inner_safety_information.py └── tox.ini /.github/workflows/deutschland_generator.yaml: -------------------------------------------------------------------------------- 1 | on: [push] 2 | jobs: 3 | deutschland_generation: 4 | name: "Deutschland Generation" 5 | runs-on: ubuntu-latest 6 | strategy: 7 | fail-fast: false 8 | matrix: 9 | python-version: ['3.7.8' ] 10 | steps: 11 | - uses: actions/checkout@v2 12 | 13 | # Create default .spectral.yaml file used for linting if its not existing already 14 | - name: "Create spectral file if it not exists" 15 | continue-on-error: true 16 | run: | 17 | set -C; echo "extends: spectral:oas" > .spectral.yaml 18 | # Runs a single command using the runners shell 19 | - name: "Lint file" 20 | uses: stoplightio/spectral-action@v0.8.2 21 | with: 22 | file_glob: "openapi.yaml" 23 | 24 | - name: "Generate deutschland code" 25 | uses: wirthual/deutschland-generator-action@latest 26 | with: 27 | openapi-file: ${{ github.workspace }}/openapi.yaml 28 | commit-to-git: true 29 | upload-to-pypi: true 30 | upload-to-testpypi: false 31 | pypi-token: ${{ secrets.PYPI_PRODUCTION }} 32 | testpypi-token: ${{ secrets.PYPI_TEST }} 33 | python-version: ${{ matrix.python-version }} 34 | -------------------------------------------------------------------------------- /.github/workflows/openapi_check.yaml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | jobs: 3 | openapi_check: 4 | name: "OpenAPI check" 5 | runs-on: ubuntu-latest 6 | steps: 7 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 8 | - uses: actions/checkout@v2 9 | 10 | # Create default .spectral.yaml file used for linting if its not existing already 11 | - name: "Create spectral file if it not exists" 12 | continue-on-error: true 13 | run: | 14 | set -C; echo "extends: spectral:oas" > .spectral.yaml 15 | 16 | # Run Spectral 17 | - uses: stoplightio/spectral-action@v0.8.2 18 | with: 19 | file_glob: openapi.yaml 20 | spectral_ruleset: .spectral.yaml 21 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung.api.bund.dev -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lebensmittelwarnung API 2 | 3 | Das Bayerische Staatsministerium für Umwelt und Verbraucherschutz ermöglicht über die hier dokumentierte API die Information von Verbraucher\*innen zu Lebensmittel- und Produktwarnungen. 4 | 5 | 6 | ## Anfragen 7 | 8 | **URL:** https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api/warnings/merged 9 | 10 | Anfragen sind als POST-request zu formulieren. Dabei ist folgendes zu beachten: 11 | - "Authorization" muss als header, query parameter oder cookie mit folgendem Inhalt gesendet werden: "baystmuv-vi-1.0 os=ios, key=9d9e8972-ff15-4943-8fea-117b5a973c61"; 12 | - als ASCII-data ist ein JSON-Objekt mit den Elementen "food" (ein Objekt mit den Eigenschaften "rows", "sort", "start" und "fq") und "products" (ebenfalls ein Objekt mit den Eigenschaften "rows", "sort", "start" und "fq") zu senden. 13 | 14 | 15 | **Eigenschaft:** *rows* 16 | 17 | Anzahl zu ladender Einträge (z.B. 500). 18 | 19 | 20 | **Eigenschaft:** *sort* 21 | 22 | Vorgaben zur Sortierung zu ladender Einträge (z.B. publishedDate desc, title asc) 23 | 24 | 25 | **Eigenschaft:** *start* 26 | 27 | Start-Index der zu ladenden Einträge (z.B. 11). 28 | 29 | 30 | **Eigenschaft:** *fq* 31 | 32 | Array zur Eingrenzung zu ladender Einträge (z.B. ["publishedDate > 1630067654000"]). 33 | 34 | 35 | ### Beispiel: 36 | 37 | ```bash 38 | warnings=$(curl -X 'POST' \ 39 | 'https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api/warnings/merged' \ 40 | -H 'accept: application/json' \ 41 | -H 'Authorization: baystmuv-vi-1.0 os=ios, key=9d9e8972-ff15-4943-8fea-117b5a973c61' \ 42 | -H 'Content-Type: application/json' \ 43 | -d '{ 44 | "food": { 45 | "rows": 500, 46 | "sort": "publishedDate desc, title asc", 47 | "start": 11, 48 | "fq": [ 49 | "publishedDate > 1630067654000" 50 | ] 51 | }, 52 | "products": { 53 | "rows": 500, 54 | "sort": "publishedDate desc, title asc", 55 | "start": 11, 56 | "fq": [ 57 | "publishedDate > 1630067654000" 58 | ] 59 | } 60 | }') 61 | ``` 62 | -------------------------------------------------------------------------------- /generator_config.yaml: -------------------------------------------------------------------------------- 1 | templateDir: ./deutschland_templates 2 | additionalProperties: 3 | packageName: "lebensmittelwarnung" 4 | infoName: "BundesAPI" 5 | infoEmail: "kontakt@bund.dev" 6 | packageVersion: 0.1.0 7 | packageUrl: "https://github.com/bundesAPI/lebensmittelwarnung-api" 8 | namespace: "deutschland" 9 | docLanguage: "de" 10 | gitHost: "github.com" 11 | gitUserId: "bundesAPI" 12 | gitRepoId: "lebensmittelwarnung-api" 13 | files: 14 | pyproject.mustache: 15 | destinationFilename: pyproject.toml 16 | templateType: SupportingFiles 17 | requirements.txt: {} 18 | create_doc.mustache: 19 | destinationFilename: create_doc.py 20 | templateType: SupportingFiles 21 | rename_generated_code.mustache: 22 | destinationFilename: rename_generated_code.py 23 | templateType: SupportingFiles 24 | README.mustache: 25 | destinationFilename: README.md 26 | templateType: SupportingFiles 27 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | BVL - Lebensmittel und Produktwarnungen - OpenAPI Documentation 9 | 10 | 11 |
12 | 13 | 14 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /openapi.yaml: -------------------------------------------------------------------------------- 1 | openapi: "3.0.0" 2 | info: 3 | version: 1.0.0 4 | title: Lebensmittelwarnungen API 5 | description: Liste aller Lebensmittel und Produktwarnungen 6 | servers: 7 | - url: https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api/ 8 | 9 | 10 | paths: 11 | /warnings/merged: 12 | post: 13 | operationId: list-warnungen 14 | summary: Liste aller Lebensmittel und Produktwarnungen 15 | description: Gibt eine Liste aller Lebensmittel und Produktwarnungen zurück. 16 | security: 17 | - ApiKeyAuth: [] 18 | requestBody: 19 | content: 20 | application/json: 21 | schema: 22 | type: object 23 | properties: 24 | food: 25 | $ref: "#/components/schemas/RequestOptions" 26 | products: 27 | $ref: "#/components/schemas/RequestOptions" 28 | responses: 29 | "200": 30 | description: Success 31 | content: 32 | application/json: 33 | schema: 34 | $ref: "#/components/schemas/Response" 35 | 36 | 37 | 38 | components: 39 | securitySchemes: 40 | ApiKeyAuth: 41 | type: apiKey 42 | in: header # can be "header", "query" or "cookie" 43 | name: Authorization # name of the header, query parameter or cookie 44 | description: "**Authorization**: \"baystmuv-vi-1.0 os=ios, key=9d9e8972-ff15-4943-8fea-117b5a973c61\"" 45 | schemas: 46 | 47 | RequestOptions: 48 | type: object 49 | properties: 50 | rows: 51 | description: Anzahl zu ladender Einträge 52 | type: integer 53 | example: 500 54 | sort: 55 | type: string 56 | example: "publishedDate desc, title asc" 57 | start: 58 | type: integer 59 | example: 11 60 | description: Start-Index der zu ladenden Einträge 61 | fq: 62 | type: array 63 | items: 64 | type: string 65 | example: ["publishedDate > 1630067654000"] 66 | 67 | Response: 68 | type: object 69 | properties: 70 | docs: 71 | type: array 72 | items: 73 | type: object 74 | properties: 75 | _type: 76 | type: string 77 | example: .ProductWarning 78 | archived: 79 | type: boolean 80 | id: 81 | type: integer 82 | format: int32 83 | example: 4605 84 | link: 85 | type: string 86 | example: https://www.baua.de/SiteGlobals/Layout/DataViews/Datarecord_DBTool_Produktsicherheit.html?idDatarecord=1535276 87 | publishedDate: 88 | type: integer 89 | format: int64 90 | example: 1630015200000 91 | title: 92 | type: string 93 | example: Aiways Personenkraftwagen (Aiways Automobile Europe GmbH) 94 | product: 95 | type: object 96 | properties: 97 | _type: 98 | type: string 99 | example: .ProductWarning$Product 100 | designation: 101 | type: string 102 | example: Personenkraftwagen 103 | imageUrls: 104 | type: array 105 | items: 106 | type: string 107 | example: https://www.baua.de/media/images_produktsicherheit/Kfz.png 108 | manufacturer: 109 | type: string 110 | example: Aiways Automobile Europe GmbH 111 | affectedProducts: 112 | type: string 113 | example: "Herstellungsdaten: 31.12.2020 bis 31.01.2021 Rückruf-Code: Nicht bekannt" 114 | brandName: 115 | type: string 116 | example: Aiways 117 | category: 118 | type: string 119 | example: Kraftfahrzeuge -teile und -zubehör 120 | countryOfOrigin: 121 | type: string 122 | example: China 123 | model: 124 | type: string 125 | example: "e13*2007/46*2315*00 - 02 Typ MAS861-WVTA Verkaufsbezeichnung: U5" 126 | shortDescription: 127 | type: string 128 | example: Personenkraftwagen 129 | rapexInformation: 130 | type: object 131 | properties: 132 | alertNumber: 133 | type: string 134 | example: A12/01231/21 135 | message: 136 | type: string 137 | example: "
Freiwillige Maßnahme: Rückruf des Produktes vom Endverbraucher

Durch falsches Schweißen der Querlenker kann es zu einem Verlust der Kontrolle über das Fahrzeug kommen. Dadurch erhöht sich das Unfall- und Verletzungsrisiko für die Insassen des Fahrzeugs. Das Produkt entspricht nicht den Vorschriften der Verordnung über die Genehmigung und Marktüberwachung von Kraftfahrzeugen und Kraftfahrzeuganhängern sowie von Systemen Bauteilen und selbstständigen technischen Einheiten für diese Fahrzeuge.
" 138 | safetyInformation: 139 | type: object 140 | properties: 141 | ordinance: 142 | type: string 143 | example: Straßenverkehrs-Zulassungs-Ordnung (StVZO) 144 | numFound: 145 | type: integer 146 | format: int32 147 | example: 287 148 | 149 | externalDocs: 150 | description: "Weiterführende Dokumentation" 151 | url: "https://github.com/bundesAPI/lebensmittelwarnung-api/blob/main/README.md" 152 | -------------------------------------------------------------------------------- /python-client/.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /python-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | .gitignore 2 | .gitlab-ci.yml 3 | .openapi-generator-ignore 4 | .travis.yml 5 | README.md 6 | create_doc.py 7 | docs/DefaultApi.md 8 | docs/ListWarnungenRequest.md 9 | docs/RequestOptions.md 10 | docs/Response.md 11 | docs/ResponseDocsInner.md 12 | docs/ResponseDocsInnerProduct.md 13 | docs/ResponseDocsInnerRapexInformation.md 14 | docs/ResponseDocsInnerSafetyInformation.md 15 | git_push.sh 16 | lebensmittelwarnung/__init__.py 17 | lebensmittelwarnung/api/__init__.py 18 | lebensmittelwarnung/api/default_api.py 19 | lebensmittelwarnung/api_client.py 20 | lebensmittelwarnung/apis/__init__.py 21 | lebensmittelwarnung/configuration.py 22 | lebensmittelwarnung/exceptions.py 23 | lebensmittelwarnung/model/__init__.py 24 | lebensmittelwarnung/model/list_warnungen_request.py 25 | lebensmittelwarnung/model/request_options.py 26 | lebensmittelwarnung/model/response.py 27 | lebensmittelwarnung/model/response_docs_inner.py 28 | lebensmittelwarnung/model/response_docs_inner_product.py 29 | lebensmittelwarnung/model/response_docs_inner_rapex_information.py 30 | lebensmittelwarnung/model/response_docs_inner_safety_information.py 31 | lebensmittelwarnung/model_utils.py 32 | lebensmittelwarnung/models/__init__.py 33 | lebensmittelwarnung/rest.py 34 | pyproject.toml 35 | rename_generated_code.py 36 | requirements.txt 37 | requirements.txt 38 | setup.cfg 39 | setup.py 40 | test-requirements.txt 41 | test/__init__.py 42 | test/test_default_api.py 43 | test/test_list_warnungen_request.py 44 | test/test_request_options.py 45 | test/test_response.py 46 | test/test_response_docs_inner.py 47 | test/test_response_docs_inner_product.py 48 | test/test_response_docs_inner_rapex_information.py 49 | test/test_response_docs_inner_safety_information.py 50 | tox.ini 51 | -------------------------------------------------------------------------------- /python-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 6.1.0-SNAPSHOT -------------------------------------------------------------------------------- /python-client/README.md: -------------------------------------------------------------------------------- 1 | # lebensmittelwarnung 2 | Liste aller Lebensmittel und Produktwarnungen 3 | 4 | This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: 5 | 6 | - API version: 1.0.0 7 | - Package version: 0.1.0 8 | - Build package: org.openapitools.codegen.languages.PythonClientCodegen 9 | 10 | ## Requirements. 11 | 12 | Python >= 3.6 13 | 14 | ## Installation & Usage 15 | ### pip install 16 | 17 | ```sh 18 | pip install deutschland[lebensmittelwarnung] 19 | ``` 20 | 21 | ### poetry install 22 | 23 | ```sh 24 | poetry add deutschland -E lebensmittelwarnung 25 | ``` 26 | 27 | ### Setuptools 28 | 29 | Install via [Setuptools](http://pypi.python.org/pypi/setuptools). 30 | 31 | ```sh 32 | python setup.py install --user 33 | ``` 34 | (or `sudo python setup.py install` to install the package for all users) 35 | 36 | ## Usage 37 | 38 | Import the package: 39 | ```python 40 | from deutschland import lebensmittelwarnung 41 | ``` 42 | 43 | ## Getting Started 44 | 45 | Please follow the [installation procedure](#installation--usage) and then run the following: 46 | 47 | ```python 48 | 49 | import time 50 | from deutschland import lebensmittelwarnung 51 | from pprint import pprint 52 | from deutschland.lebensmittelwarnung.api import default_api 53 | from deutschland.lebensmittelwarnung.model.list_warnungen_request import ListWarnungenRequest 54 | from deutschland.lebensmittelwarnung.model.response import Response 55 | # Defining the host is optional and defaults to https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api 56 | # See configuration.py for a list of all supported configuration parameters. 57 | configuration = lebensmittelwarnung.Configuration( 58 | host = "https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api" 59 | ) 60 | 61 | # The client must configure the authentication and authorization parameters 62 | # in accordance with the API server security policy. 63 | # Examples for each auth method are provided below, use the example that 64 | # satisfies your auth use case. 65 | 66 | # Configure API key authorization: ApiKeyAuth 67 | configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' 68 | 69 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 70 | # configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' 71 | 72 | 73 | # Enter a context with an instance of the API client 74 | with lebensmittelwarnung.ApiClient(configuration) as api_client: 75 | # Create an instance of the API class 76 | api_instance = default_api.DefaultApi(api_client) 77 | list_warnungen_request = ListWarnungenRequest( 78 | food=RequestOptions( 79 | rows=500, 80 | sort="publishedDate desc, title asc", 81 | start=11, 82 | fq=["publishedDate > 1630067654000"], 83 | ), 84 | products=RequestOptions( 85 | rows=500, 86 | sort="publishedDate desc, title asc", 87 | start=11, 88 | fq=["publishedDate > 1630067654000"], 89 | ), 90 | ) # ListWarnungenRequest | (optional) 91 | 92 | try: 93 | # Liste aller Lebensmittel und Produktwarnungen 94 | api_response = api_instance.list_warnungen(list_warnungen_request=list_warnungen_request) 95 | pprint(api_response) 96 | except lebensmittelwarnung.ApiException as e: 97 | print("Exception when calling DefaultApi->list_warnungen: %s\n" % e) 98 | ``` 99 | 100 | ## Documentation for API Endpoints 101 | 102 | All URIs are relative to *https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api* 103 | 104 | Class | Method | HTTP request | Description 105 | ------------ | ------------- | ------------- | ------------- 106 | *DefaultApi* | [**list_warnungen**](docs/DefaultApi.md#list_warnungen) | **POST** /warnings/merged | Liste aller Lebensmittel und Produktwarnungen 107 | 108 | 109 | ## Documentation For Models 110 | 111 | - [ListWarnungenRequest](docs/ListWarnungenRequest.md) 112 | - [RequestOptions](docs/RequestOptions.md) 113 | - [Response](docs/Response.md) 114 | - [ResponseDocsInner](docs/ResponseDocsInner.md) 115 | - [ResponseDocsInnerProduct](docs/ResponseDocsInnerProduct.md) 116 | - [ResponseDocsInnerRapexInformation](docs/ResponseDocsInnerRapexInformation.md) 117 | - [ResponseDocsInnerSafetyInformation](docs/ResponseDocsInnerSafetyInformation.md) 118 | 119 | 120 | ## Documentation For Authorization 121 | 122 | 123 | ## ApiKeyAuth 124 | 125 | - **Type**: API key 126 | - **API key parameter name**: Authorization 127 | - **Location**: HTTP header 128 | 129 | 130 | ## Author 131 | 132 | kontakt@bund.dev 133 | 134 | 135 | ## Notes for Large OpenAPI documents 136 | If the OpenAPI document is large, imports in lebensmittelwarnung.apis and lebensmittelwarnung.models may fail with a 137 | RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: 138 | 139 | Solution 1: 140 | Use specific imports for apis and models like: 141 | - `from deutschland.lebensmittelwarnung.api.default_api import DefaultApi` 142 | - `from deutschland.lebensmittelwarnung.model.pet import Pet` 143 | 144 | Solution 2: 145 | Before importing the package, adjust the maximum recursion limit as shown below: 146 | ``` 147 | import sys 148 | sys.setrecursionlimit(1500) 149 | from deutschland import lebensmittelwarnung 150 | from deutschland.lebensmittelwarnung.apis import * 151 | from deutschland.lebensmittelwarnung.models import * 152 | ``` 153 | 154 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | """ 4 | Lebensmittelwarnungen API 5 | 6 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 7 | 8 | The version of the OpenAPI document: 1.0.0 9 | Contact: kontakt@bund.dev 10 | Generated by: https://openapi-generator.tech 11 | """ 12 | 13 | 14 | __version__ = "0.1.0" 15 | 16 | # import ApiClient 17 | from deutschland.lebensmittelwarnung.api_client import ApiClient 18 | 19 | # import Configuration 20 | from deutschland.lebensmittelwarnung.configuration import Configuration 21 | 22 | # import exceptions 23 | from deutschland.lebensmittelwarnung.exceptions import ( 24 | ApiAttributeError, 25 | ApiException, 26 | ApiKeyError, 27 | ApiTypeError, 28 | ApiValueError, 29 | OpenApiException, 30 | ) 31 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/api/__init__.py: -------------------------------------------------------------------------------- 1 | # do not import all apis into this module because that uses a lot of memory and stack frames 2 | # if you need the ability to import all apis from one package, import them with 3 | # from deutschland.lebensmittelwarnung.apis import DefaultApi 4 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/api/default_api.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.api_client import ApiClient 16 | from deutschland.lebensmittelwarnung.api_client import Endpoint as _Endpoint 17 | from deutschland.lebensmittelwarnung.model.list_warnungen_request import ( 18 | ListWarnungenRequest, 19 | ) 20 | from deutschland.lebensmittelwarnung.model.response import Response 21 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 22 | check_allowed_values, 23 | check_validations, 24 | date, 25 | datetime, 26 | file_type, 27 | none_type, 28 | validate_and_convert_types, 29 | ) 30 | 31 | 32 | class DefaultApi(object): 33 | """NOTE: This class is auto generated by OpenAPI Generator 34 | Ref: https://openapi-generator.tech 35 | 36 | Do not edit the class manually. 37 | """ 38 | 39 | def __init__(self, api_client=None): 40 | if api_client is None: 41 | api_client = ApiClient() 42 | self.api_client = api_client 43 | self.list_warnungen_endpoint = _Endpoint( 44 | settings={ 45 | "response_type": (Response,), 46 | "auth": ["ApiKeyAuth"], 47 | "endpoint_path": "/warnings/merged", 48 | "operation_id": "list_warnungen", 49 | "http_method": "POST", 50 | "servers": None, 51 | }, 52 | params_map={ 53 | "all": [ 54 | "list_warnungen_request", 55 | ], 56 | "required": [], 57 | "nullable": [], 58 | "enum": [], 59 | "validation": [], 60 | }, 61 | root_map={ 62 | "validations": {}, 63 | "allowed_values": {}, 64 | "openapi_types": { 65 | "list_warnungen_request": (ListWarnungenRequest,), 66 | }, 67 | "attribute_map": {}, 68 | "location_map": { 69 | "list_warnungen_request": "body", 70 | }, 71 | "collection_format_map": {}, 72 | }, 73 | headers_map={ 74 | "accept": ["application/json"], 75 | "content_type": ["application/json"], 76 | }, 77 | api_client=api_client, 78 | ) 79 | 80 | def list_warnungen(self, **kwargs): 81 | """Liste aller Lebensmittel und Produktwarnungen # noqa: E501 82 | 83 | Gibt eine Liste aller Lebensmittel und Produktwarnungen zurück. # noqa: E501 84 | This method makes a synchronous HTTP request by default. To make an 85 | asynchronous HTTP request, please pass async_req=True 86 | 87 | >>> thread = api.list_warnungen(async_req=True) 88 | >>> result = thread.get() 89 | 90 | 91 | Keyword Args: 92 | list_warnungen_request (ListWarnungenRequest): [optional] 93 | _return_http_data_only (bool): response data without head status 94 | code and headers. Default is True. 95 | _preload_content (bool): if False, the urllib3.HTTPResponse object 96 | will be returned without reading/decoding response data. 97 | Default is True. 98 | _request_timeout (int/float/tuple): timeout setting for this request. If 99 | one number provided, it will be total request timeout. It can also 100 | be a pair (tuple) of (connection, read) timeouts. 101 | Default is None. 102 | _check_input_type (bool): specifies if type checking 103 | should be done one the data sent to the server. 104 | Default is True. 105 | _check_return_type (bool): specifies if type checking 106 | should be done one the data received from the server. 107 | Default is True. 108 | _spec_property_naming (bool): True if the variable names in the input data 109 | are serialized names, as specified in the OpenAPI document. 110 | False if the variable names in the input data 111 | are pythonic names, e.g. snake case (default) 112 | _content_type (str/None): force body content-type. 113 | Default is None and content-type will be predicted by allowed 114 | content-types and body. 115 | _host_index (int/None): specifies the index of the server 116 | that we want to use. 117 | Default is read from the configuration. 118 | _request_auths (list): set to override the auth_settings for an a single 119 | request; this effectively ignores the authentication 120 | in the spec for a single request. 121 | Default is None 122 | async_req (bool): execute request asynchronously 123 | 124 | Returns: 125 | Response 126 | If the method is called asynchronously, returns the request 127 | thread. 128 | """ 129 | kwargs["async_req"] = kwargs.get("async_req", False) 130 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) 131 | kwargs["_preload_content"] = kwargs.get("_preload_content", True) 132 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) 133 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) 134 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) 135 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False) 136 | kwargs["_content_type"] = kwargs.get("_content_type") 137 | kwargs["_host_index"] = kwargs.get("_host_index") 138 | kwargs["_request_auths"] = kwargs.get("_request_auths", None) 139 | return self.list_warnungen_endpoint.call_with_http_info(**kwargs) 140 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/apis/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | # Import all APIs into this package. 4 | # If you have many APIs here with many many models used in each API this may 5 | # raise a `RecursionError`. 6 | # In order to avoid this, import only the API that you directly need like: 7 | # 8 | # from deutschland.lebensmittelwarnung.api.default_api import DefaultApi 9 | # 10 | # or import this package, but before doing it, use: 11 | # 12 | # import sys 13 | # sys.setrecursionlimit(n) 14 | 15 | # Import APIs into API package: 16 | from deutschland.lebensmittelwarnung.api.default_api import DefaultApi 17 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/configuration.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import copy 13 | import logging 14 | import multiprocessing 15 | import sys 16 | from http import client as http_client 17 | 18 | import urllib3 19 | from deutschland.lebensmittelwarnung.exceptions import ApiValueError 20 | 21 | JSON_SCHEMA_VALIDATION_KEYWORDS = { 22 | "multipleOf", 23 | "maximum", 24 | "exclusiveMaximum", 25 | "minimum", 26 | "exclusiveMinimum", 27 | "maxLength", 28 | "minLength", 29 | "pattern", 30 | "maxItems", 31 | "minItems", 32 | } 33 | 34 | 35 | class Configuration(object): 36 | """NOTE: This class is auto generated by OpenAPI Generator 37 | 38 | Ref: https://openapi-generator.tech 39 | Do not edit the class manually. 40 | 41 | :param host: Base url 42 | :param api_key: Dict to store API key(s). 43 | Each entry in the dict specifies an API key. 44 | The dict key is the name of the security scheme in the OAS specification. 45 | The dict value is the API key secret. 46 | :param api_key_prefix: Dict to store API prefix (e.g. Bearer) 47 | The dict key is the name of the security scheme in the OAS specification. 48 | The dict value is an API key prefix when generating the auth data. 49 | :param username: Username for HTTP basic authentication 50 | :param password: Password for HTTP basic authentication 51 | :param discard_unknown_keys: Boolean value indicating whether to discard 52 | unknown properties. A server may send a response that includes additional 53 | properties that are not known by the client in the following scenarios: 54 | 1. The OpenAPI document is incomplete, i.e. it does not match the server 55 | implementation. 56 | 2. The client was generated using an older version of the OpenAPI document 57 | and the server has been upgraded since then. 58 | If a schema in the OpenAPI document defines the additionalProperties attribute, 59 | then all undeclared properties received by the server are injected into the 60 | additional properties map. In that case, there are undeclared properties, and 61 | nothing to discard. 62 | :param disabled_client_side_validations (string): Comma-separated list of 63 | JSON schema validation keywords to disable JSON schema structural validation 64 | rules. The following keywords may be specified: multipleOf, maximum, 65 | exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, 66 | maxItems, minItems. 67 | By default, the validation is performed for data generated locally by the client 68 | and data received from the server, independent of any validation performed by 69 | the server side. If the input data does not satisfy the JSON schema validation 70 | rules specified in the OpenAPI document, an exception is raised. 71 | If disabled_client_side_validations is set, structural validation is 72 | disabled. This can be useful to troubleshoot data validation problem, such as 73 | when the OpenAPI document validation rules do not match the actual API data 74 | received by the server. 75 | :param server_index: Index to servers configuration. 76 | :param server_variables: Mapping with string values to replace variables in 77 | templated server configuration. The validation of enums is performed for 78 | variables with defined enum values before. 79 | :param server_operation_index: Mapping from operation ID to an index to server 80 | configuration. 81 | :param server_operation_variables: Mapping from operation ID to a mapping with 82 | string values to replace variables in templated server configuration. 83 | The validation of enums is performed for variables with defined enum values before. 84 | :param ssl_ca_cert: str - the path to a file of concatenated CA certificates 85 | in PEM format 86 | 87 | :Example: 88 | 89 | API Key Authentication Example. 90 | Given the following security scheme in the OpenAPI specification: 91 | components: 92 | securitySchemes: 93 | cookieAuth: # name for the security scheme 94 | type: apiKey 95 | in: cookie 96 | name: JSESSIONID # cookie name 97 | 98 | You can programmatically set the cookie: 99 | 100 | conf = lebensmittelwarnung.Configuration( 101 | api_key={'cookieAuth': 'abc123'} 102 | api_key_prefix={'cookieAuth': 'JSESSIONID'} 103 | ) 104 | 105 | The following cookie will be added to the HTTP request: 106 | Cookie: JSESSIONID abc123 107 | """ 108 | 109 | _default = None 110 | 111 | def __init__( 112 | self, 113 | host=None, 114 | api_key=None, 115 | api_key_prefix=None, 116 | access_token=None, 117 | username=None, 118 | password=None, 119 | discard_unknown_keys=False, 120 | disabled_client_side_validations="", 121 | server_index=None, 122 | server_variables=None, 123 | server_operation_index=None, 124 | server_operation_variables=None, 125 | ssl_ca_cert=None, 126 | ): 127 | """Constructor""" 128 | self._base_path = ( 129 | "https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api" 130 | if host is None 131 | else host 132 | ) 133 | """Default Base url 134 | """ 135 | self.server_index = 0 if server_index is None and host is None else server_index 136 | self.server_operation_index = server_operation_index or {} 137 | """Default server index 138 | """ 139 | self.server_variables = server_variables or {} 140 | self.server_operation_variables = server_operation_variables or {} 141 | """Default server variables 142 | """ 143 | self.temp_folder_path = None 144 | """Temp file folder for downloading files 145 | """ 146 | # Authentication Settings 147 | self.access_token = access_token 148 | self.api_key = {} 149 | if api_key: 150 | self.api_key = api_key 151 | """dict to store API key(s) 152 | """ 153 | self.api_key_prefix = {} 154 | if api_key_prefix: 155 | self.api_key_prefix = api_key_prefix 156 | """dict to store API prefix (e.g. Bearer) 157 | """ 158 | self.refresh_api_key_hook = None 159 | """function hook to refresh API key if expired 160 | """ 161 | self.username = username 162 | """Username for HTTP basic authentication 163 | """ 164 | self.password = password 165 | """Password for HTTP basic authentication 166 | """ 167 | self.discard_unknown_keys = discard_unknown_keys 168 | self.disabled_client_side_validations = disabled_client_side_validations 169 | self.logger = {} 170 | """Logging Settings 171 | """ 172 | self.logger["package_logger"] = logging.getLogger("lebensmittelwarnung") 173 | self.logger["urllib3_logger"] = logging.getLogger("urllib3") 174 | self.logger_format = "%(asctime)s %(levelname)s %(message)s" 175 | """Log format 176 | """ 177 | self.logger_stream_handler = None 178 | """Log stream handler 179 | """ 180 | self.logger_file_handler = None 181 | """Log file handler 182 | """ 183 | self.logger_file = None 184 | """Debug file location 185 | """ 186 | self.debug = False 187 | """Debug switch 188 | """ 189 | 190 | self.verify_ssl = True 191 | """SSL/TLS verification 192 | Set this to false to skip verifying SSL certificate when calling API 193 | from https server. 194 | """ 195 | self.ssl_ca_cert = ssl_ca_cert 196 | """Set this to customize the certificate file to verify the peer. 197 | """ 198 | self.cert_file = None 199 | """client certificate file 200 | """ 201 | self.key_file = None 202 | """client key file 203 | """ 204 | self.assert_hostname = None 205 | """Set this to True/False to enable/disable SSL hostname verification. 206 | """ 207 | 208 | self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 209 | """urllib3 connection pool's maximum number of connections saved 210 | per pool. urllib3 uses 1 connection as default value, but this is 211 | not the best value when you are making a lot of possibly parallel 212 | requests to the same host, which is often the case here. 213 | cpu_count * 5 is used as default value to increase performance. 214 | """ 215 | 216 | self.proxy = None 217 | """Proxy URL 218 | """ 219 | self.no_proxy = None 220 | """bypass proxy for host in the no_proxy list. 221 | """ 222 | self.proxy_headers = None 223 | """Proxy headers 224 | """ 225 | self.safe_chars_for_path_param = "" 226 | """Safe chars for path_param 227 | """ 228 | self.retries = None 229 | """Adding retries to override urllib3 default value 3 230 | """ 231 | # Enable client side validation 232 | self.client_side_validation = True 233 | 234 | # Options to pass down to the underlying urllib3 socket 235 | self.socket_options = None 236 | 237 | def __deepcopy__(self, memo): 238 | cls = self.__class__ 239 | result = cls.__new__(cls) 240 | memo[id(self)] = result 241 | for k, v in self.__dict__.items(): 242 | if k not in ("logger", "logger_file_handler"): 243 | setattr(result, k, copy.deepcopy(v, memo)) 244 | # shallow copy of loggers 245 | result.logger = copy.copy(self.logger) 246 | # use setters to configure loggers 247 | result.logger_file = self.logger_file 248 | result.debug = self.debug 249 | return result 250 | 251 | def __setattr__(self, name, value): 252 | object.__setattr__(self, name, value) 253 | if name == "disabled_client_side_validations": 254 | s = set(filter(None, value.split(","))) 255 | for v in s: 256 | if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: 257 | raise ApiValueError("Invalid keyword: '{0}''".format(v)) 258 | self._disabled_client_side_validations = s 259 | 260 | @classmethod 261 | def set_default(cls, default): 262 | """Set default instance of configuration. 263 | 264 | It stores default configuration, which can be 265 | returned by get_default_copy method. 266 | 267 | :param default: object of Configuration 268 | """ 269 | cls._default = copy.deepcopy(default) 270 | 271 | @classmethod 272 | def get_default_copy(cls): 273 | """Return new instance of configuration. 274 | 275 | This method returns newly created, based on default constructor, 276 | object of Configuration class or returns a copy of default 277 | configuration passed by the set_default method. 278 | 279 | :return: The configuration object. 280 | """ 281 | if cls._default is not None: 282 | return copy.deepcopy(cls._default) 283 | return Configuration() 284 | 285 | @property 286 | def logger_file(self): 287 | """The logger file. 288 | 289 | If the logger_file is None, then add stream handler and remove file 290 | handler. Otherwise, add file handler and remove stream handler. 291 | 292 | :param value: The logger_file path. 293 | :type: str 294 | """ 295 | return self.__logger_file 296 | 297 | @logger_file.setter 298 | def logger_file(self, value): 299 | """The logger file. 300 | 301 | If the logger_file is None, then add stream handler and remove file 302 | handler. Otherwise, add file handler and remove stream handler. 303 | 304 | :param value: The logger_file path. 305 | :type: str 306 | """ 307 | self.__logger_file = value 308 | if self.__logger_file: 309 | # If set logging file, 310 | # then add file handler and remove stream handler. 311 | self.logger_file_handler = logging.FileHandler(self.__logger_file) 312 | self.logger_file_handler.setFormatter(self.logger_formatter) 313 | for _, logger in self.logger.items(): 314 | logger.addHandler(self.logger_file_handler) 315 | 316 | @property 317 | def debug(self): 318 | """Debug status 319 | 320 | :param value: The debug status, True or False. 321 | :type: bool 322 | """ 323 | return self.__debug 324 | 325 | @debug.setter 326 | def debug(self, value): 327 | """Debug status 328 | 329 | :param value: The debug status, True or False. 330 | :type: bool 331 | """ 332 | self.__debug = value 333 | if self.__debug: 334 | # if debug status is True, turn on debug logging 335 | for _, logger in self.logger.items(): 336 | logger.setLevel(logging.DEBUG) 337 | # turn on http_client debug 338 | http_client.HTTPConnection.debuglevel = 1 339 | else: 340 | # if debug status is False, turn off debug logging, 341 | # setting log level to default `logging.WARNING` 342 | for _, logger in self.logger.items(): 343 | logger.setLevel(logging.WARNING) 344 | # turn off http_client debug 345 | http_client.HTTPConnection.debuglevel = 0 346 | 347 | @property 348 | def logger_format(self): 349 | """The logger format. 350 | 351 | The logger_formatter will be updated when sets logger_format. 352 | 353 | :param value: The format string. 354 | :type: str 355 | """ 356 | return self.__logger_format 357 | 358 | @logger_format.setter 359 | def logger_format(self, value): 360 | """The logger format. 361 | 362 | The logger_formatter will be updated when sets logger_format. 363 | 364 | :param value: The format string. 365 | :type: str 366 | """ 367 | self.__logger_format = value 368 | self.logger_formatter = logging.Formatter(self.__logger_format) 369 | 370 | def get_api_key_with_prefix(self, identifier, alias=None): 371 | """Gets API key (with prefix if set). 372 | 373 | :param identifier: The identifier of apiKey. 374 | :param alias: The alternative identifier of apiKey. 375 | :return: The token for api key authentication. 376 | """ 377 | if self.refresh_api_key_hook is not None: 378 | self.refresh_api_key_hook(self) 379 | key = self.api_key.get( 380 | identifier, self.api_key.get(alias) if alias is not None else None 381 | ) 382 | if key: 383 | prefix = self.api_key_prefix.get(identifier) 384 | if prefix: 385 | return "%s %s" % (prefix, key) 386 | else: 387 | return key 388 | 389 | def get_basic_auth_token(self): 390 | """Gets HTTP basic authentication header (string). 391 | 392 | :return: The token for basic HTTP authentication. 393 | """ 394 | username = "" 395 | if self.username is not None: 396 | username = self.username 397 | password = "" 398 | if self.password is not None: 399 | password = self.password 400 | return urllib3.util.make_headers(basic_auth=username + ":" + password).get( 401 | "authorization" 402 | ) 403 | 404 | def auth_settings(self): 405 | """Gets Auth Settings dict for api client. 406 | 407 | :return: The Auth Settings information dict. 408 | """ 409 | auth = {} 410 | if "ApiKeyAuth" in self.api_key: 411 | auth["ApiKeyAuth"] = { 412 | "type": "api_key", 413 | "in": "header", 414 | "key": "Authorization", 415 | "value": self.get_api_key_with_prefix( 416 | "ApiKeyAuth", 417 | ), 418 | } 419 | return auth 420 | 421 | def to_debug_report(self): 422 | """Gets the essential information for debugging. 423 | 424 | :return: The report for debugging. 425 | """ 426 | return ( 427 | "Python SDK Debug Report:\n" 428 | "OS: {env}\n" 429 | "Python Version: {pyversion}\n" 430 | "Version of the API: 1.0.0\n" 431 | "SDK Package Version: 0.1.0".format(env=sys.platform, pyversion=sys.version) 432 | ) 433 | 434 | def get_host_settings(self): 435 | """Gets an array of host settings 436 | 437 | :return: An array of host settings 438 | """ 439 | return [ 440 | { 441 | "url": "https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api", 442 | "description": "No description provided", 443 | } 444 | ] 445 | 446 | def get_host_from_settings(self, index, variables=None, servers=None): 447 | """Gets host URL based on the index and variables 448 | :param index: array index of the host settings 449 | :param variables: hash of variable and the corresponding value 450 | :param servers: an array of host settings or None 451 | :return: URL based on host settings 452 | """ 453 | if index is None: 454 | return self._base_path 455 | 456 | variables = {} if variables is None else variables 457 | servers = self.get_host_settings() if servers is None else servers 458 | 459 | try: 460 | server = servers[index] 461 | except IndexError: 462 | raise ValueError( 463 | "Invalid index {0} when selecting the host settings. " 464 | "Must be less than {1}".format(index, len(servers)) 465 | ) 466 | 467 | url = server["url"] 468 | 469 | # go through variables and replace placeholders 470 | for variable_name, variable in server.get("variables", {}).items(): 471 | used_value = variables.get(variable_name, variable["default_value"]) 472 | 473 | if "enum_values" in variable and used_value not in variable["enum_values"]: 474 | raise ValueError( 475 | "The variable `{0}` in the host URL has invalid value " 476 | "{1}. Must be {2}.".format( 477 | variable_name, variables[variable_name], variable["enum_values"] 478 | ) 479 | ) 480 | 481 | url = url.replace("{" + variable_name + "}", used_value) 482 | 483 | return url 484 | 485 | @property 486 | def host(self): 487 | """Return generated host.""" 488 | return self.get_host_from_settings( 489 | self.server_index, variables=self.server_variables 490 | ) 491 | 492 | @host.setter 493 | def host(self, value): 494 | """Fix base path.""" 495 | self._base_path = value 496 | self.server_index = None 497 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/exceptions.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | class OpenApiException(Exception): 13 | """The base exception class for all OpenAPIExceptions""" 14 | 15 | 16 | class ApiTypeError(OpenApiException, TypeError): 17 | def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): 18 | """Raises an exception for TypeErrors 19 | 20 | Args: 21 | msg (str): the exception message 22 | 23 | Keyword Args: 24 | path_to_item (list): a list of keys an indices to get to the 25 | current_item 26 | None if unset 27 | valid_classes (tuple): the primitive classes that current item 28 | should be an instance of 29 | None if unset 30 | key_type (bool): False if our value is a value in a dict 31 | True if it is a key in a dict 32 | False if our item is an item in a list 33 | None if unset 34 | """ 35 | self.path_to_item = path_to_item 36 | self.valid_classes = valid_classes 37 | self.key_type = key_type 38 | full_msg = msg 39 | if path_to_item: 40 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 41 | super(ApiTypeError, self).__init__(full_msg) 42 | 43 | 44 | class ApiValueError(OpenApiException, ValueError): 45 | def __init__(self, msg, path_to_item=None): 46 | """ 47 | Args: 48 | msg (str): the exception message 49 | 50 | Keyword Args: 51 | path_to_item (list) the path to the exception in the 52 | received_data dict. None if unset 53 | """ 54 | 55 | self.path_to_item = path_to_item 56 | full_msg = msg 57 | if path_to_item: 58 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 59 | super(ApiValueError, self).__init__(full_msg) 60 | 61 | 62 | class ApiAttributeError(OpenApiException, AttributeError): 63 | def __init__(self, msg, path_to_item=None): 64 | """ 65 | Raised when an attribute reference or assignment fails. 66 | 67 | Args: 68 | msg (str): the exception message 69 | 70 | Keyword Args: 71 | path_to_item (None/list) the path to the exception in the 72 | received_data dict 73 | """ 74 | self.path_to_item = path_to_item 75 | full_msg = msg 76 | if path_to_item: 77 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 78 | super(ApiAttributeError, self).__init__(full_msg) 79 | 80 | 81 | class ApiKeyError(OpenApiException, KeyError): 82 | def __init__(self, msg, path_to_item=None): 83 | """ 84 | Args: 85 | msg (str): the exception message 86 | 87 | Keyword Args: 88 | path_to_item (None/list) the path to the exception in the 89 | received_data dict 90 | """ 91 | self.path_to_item = path_to_item 92 | full_msg = msg 93 | if path_to_item: 94 | full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) 95 | super(ApiKeyError, self).__init__(full_msg) 96 | 97 | 98 | class ApiException(OpenApiException): 99 | def __init__(self, status=None, reason=None, http_resp=None): 100 | if http_resp: 101 | self.status = http_resp.status 102 | self.reason = http_resp.reason 103 | self.body = http_resp.data 104 | self.headers = http_resp.getheaders() 105 | else: 106 | self.status = status 107 | self.reason = reason 108 | self.body = None 109 | self.headers = None 110 | 111 | def __str__(self): 112 | """Custom error messages for exception""" 113 | error_message = "Status Code: {0}\n" "Reason: {1}\n".format( 114 | self.status, self.reason 115 | ) 116 | if self.headers: 117 | error_message += "HTTP response headers: {0}\n".format(self.headers) 118 | 119 | if self.body: 120 | error_message += "HTTP response body: {0}\n".format(self.body) 121 | 122 | return error_message 123 | 124 | 125 | class NotFoundException(ApiException): 126 | def __init__(self, status=None, reason=None, http_resp=None): 127 | super(NotFoundException, self).__init__(status, reason, http_resp) 128 | 129 | 130 | class UnauthorizedException(ApiException): 131 | def __init__(self, status=None, reason=None, http_resp=None): 132 | super(UnauthorizedException, self).__init__(status, reason, http_resp) 133 | 134 | 135 | class ForbiddenException(ApiException): 136 | def __init__(self, status=None, reason=None, http_resp=None): 137 | super(ForbiddenException, self).__init__(status, reason, http_resp) 138 | 139 | 140 | class ServiceException(ApiException): 141 | def __init__(self, status=None, reason=None, http_resp=None): 142 | super(ServiceException, self).__init__(status, reason, http_resp) 143 | 144 | 145 | def render_path(path_to_item): 146 | """Returns a string representation of a path""" 147 | result = "" 148 | for pth in path_to_item: 149 | if isinstance(pth, int): 150 | result += "[{0}]".format(pth) 151 | else: 152 | result += "['{0}']".format(pth) 153 | return result 154 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/__init__.py: -------------------------------------------------------------------------------- 1 | # we can not import model classes here because that would create a circular 2 | # reference which would not work in python2 3 | # do not import all models into this module because that uses a lot of memory and stack frames 4 | # if you need the ability to import all models from one package, import them with 5 | # from deutschland.lebensmittelwarnung.models import ModelA, ModelB 6 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/list_warnungen_request.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | def lazy_import(): 34 | from deutschland.lebensmittelwarnung.model.request_options import RequestOptions 35 | 36 | globals()["RequestOptions"] = RequestOptions 37 | 38 | 39 | class ListWarnungenRequest(ModelNormal): 40 | """NOTE: This class is auto generated by OpenAPI Generator. 41 | Ref: https://openapi-generator.tech 42 | 43 | Do not edit the class manually. 44 | 45 | Attributes: 46 | allowed_values (dict): The key is the tuple path to the attribute 47 | and the for var_name this is (var_name,). The value is a dict 48 | with a capitalized key describing the allowed value and an allowed 49 | value. These dicts store the allowed enum values. 50 | attribute_map (dict): The key is attribute name 51 | and the value is json key in definition. 52 | discriminator_value_class_map (dict): A dict to go from the discriminator 53 | variable value to the discriminator class name. 54 | validations (dict): The key is the tuple path to the attribute 55 | and the for var_name this is (var_name,). The value is a dict 56 | that stores validations for max_length, min_length, max_items, 57 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 58 | inclusive_minimum, and regex. 59 | additional_properties_type (tuple): A tuple of classes accepted 60 | as additional properties values. 61 | """ 62 | 63 | allowed_values = {} 64 | 65 | validations = {} 66 | 67 | @cached_property 68 | def additional_properties_type(): 69 | """ 70 | This must be a method because a model may have properties that are 71 | of type self, this must run after the class is loaded 72 | """ 73 | lazy_import() 74 | return ( 75 | bool, 76 | date, 77 | datetime, 78 | dict, 79 | float, 80 | int, 81 | list, 82 | str, 83 | none_type, 84 | ) # noqa: E501 85 | 86 | _nullable = False 87 | 88 | @cached_property 89 | def openapi_types(): 90 | """ 91 | This must be a method because a model may have properties that are 92 | of type self, this must run after the class is loaded 93 | 94 | Returns 95 | openapi_types (dict): The key is attribute name 96 | and the value is attribute type. 97 | """ 98 | lazy_import() 99 | return { 100 | "food": (RequestOptions,), # noqa: E501 101 | "products": (RequestOptions,), # noqa: E501 102 | } 103 | 104 | @cached_property 105 | def discriminator(): 106 | return None 107 | 108 | attribute_map = { 109 | "food": "food", # noqa: E501 110 | "products": "products", # noqa: E501 111 | } 112 | 113 | read_only_vars = {} 114 | 115 | _composed_schemas = {} 116 | 117 | @classmethod 118 | @convert_js_args_to_python_args 119 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 120 | """ListWarnungenRequest - a model defined in OpenAPI 121 | 122 | Keyword Args: 123 | _check_type (bool): if True, values for parameters in openapi_types 124 | will be type checked and a TypeError will be 125 | raised if the wrong type is input. 126 | Defaults to True 127 | _path_to_item (tuple/list): This is a list of keys or values to 128 | drill down to the model in received_data 129 | when deserializing a response 130 | _spec_property_naming (bool): True if the variable names in the input data 131 | are serialized names, as specified in the OpenAPI document. 132 | False if the variable names in the input data 133 | are pythonic names, e.g. snake case (default) 134 | _configuration (Configuration): the instance to use when 135 | deserializing a file_type parameter. 136 | If passed, type conversion is attempted 137 | If omitted no type conversion is done. 138 | _visited_composed_classes (tuple): This stores a tuple of 139 | classes that we have traveled through so that 140 | if we see that class again we will not use its 141 | discriminator again. 142 | When traveling through a discriminator, the 143 | composed schema that is 144 | is traveled through is added to this set. 145 | For example if Animal has a discriminator 146 | petType and we pass in "Dog", and the class Dog 147 | allOf includes Animal, we move through Animal 148 | once using the discriminator, and pick Dog. 149 | Then in Dog, we will make an instance of the 150 | Animal class but this time we won't travel 151 | through its discriminator because we passed in 152 | _visited_composed_classes = (Animal,) 153 | food (RequestOptions): [optional] # noqa: E501 154 | products (RequestOptions): [optional] # noqa: E501 155 | """ 156 | 157 | _check_type = kwargs.pop("_check_type", True) 158 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 159 | _path_to_item = kwargs.pop("_path_to_item", ()) 160 | _configuration = kwargs.pop("_configuration", None) 161 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 162 | 163 | self = super(OpenApiModel, cls).__new__(cls) 164 | 165 | if args: 166 | for arg in args: 167 | if isinstance(arg, dict): 168 | kwargs.update(arg) 169 | else: 170 | raise ApiTypeError( 171 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 172 | % ( 173 | args, 174 | self.__class__.__name__, 175 | ), 176 | path_to_item=_path_to_item, 177 | valid_classes=(self.__class__,), 178 | ) 179 | 180 | self._data_store = {} 181 | self._check_type = _check_type 182 | self._spec_property_naming = _spec_property_naming 183 | self._path_to_item = _path_to_item 184 | self._configuration = _configuration 185 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 186 | 187 | for var_name, var_value in kwargs.items(): 188 | if ( 189 | var_name not in self.attribute_map 190 | and self._configuration is not None 191 | and self._configuration.discard_unknown_keys 192 | and self.additional_properties_type is None 193 | ): 194 | # discard variable. 195 | continue 196 | setattr(self, var_name, var_value) 197 | return self 198 | 199 | required_properties = set( 200 | [ 201 | "_data_store", 202 | "_check_type", 203 | "_spec_property_naming", 204 | "_path_to_item", 205 | "_configuration", 206 | "_visited_composed_classes", 207 | ] 208 | ) 209 | 210 | @convert_js_args_to_python_args 211 | def __init__(self, *args, **kwargs): # noqa: E501 212 | """ListWarnungenRequest - a model defined in OpenAPI 213 | 214 | Keyword Args: 215 | _check_type (bool): if True, values for parameters in openapi_types 216 | will be type checked and a TypeError will be 217 | raised if the wrong type is input. 218 | Defaults to True 219 | _path_to_item (tuple/list): This is a list of keys or values to 220 | drill down to the model in received_data 221 | when deserializing a response 222 | _spec_property_naming (bool): True if the variable names in the input data 223 | are serialized names, as specified in the OpenAPI document. 224 | False if the variable names in the input data 225 | are pythonic names, e.g. snake case (default) 226 | _configuration (Configuration): the instance to use when 227 | deserializing a file_type parameter. 228 | If passed, type conversion is attempted 229 | If omitted no type conversion is done. 230 | _visited_composed_classes (tuple): This stores a tuple of 231 | classes that we have traveled through so that 232 | if we see that class again we will not use its 233 | discriminator again. 234 | When traveling through a discriminator, the 235 | composed schema that is 236 | is traveled through is added to this set. 237 | For example if Animal has a discriminator 238 | petType and we pass in "Dog", and the class Dog 239 | allOf includes Animal, we move through Animal 240 | once using the discriminator, and pick Dog. 241 | Then in Dog, we will make an instance of the 242 | Animal class but this time we won't travel 243 | through its discriminator because we passed in 244 | _visited_composed_classes = (Animal,) 245 | food (RequestOptions): [optional] # noqa: E501 246 | products (RequestOptions): [optional] # noqa: E501 247 | """ 248 | 249 | _check_type = kwargs.pop("_check_type", True) 250 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 251 | _path_to_item = kwargs.pop("_path_to_item", ()) 252 | _configuration = kwargs.pop("_configuration", None) 253 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 254 | 255 | if args: 256 | for arg in args: 257 | if isinstance(arg, dict): 258 | kwargs.update(arg) 259 | else: 260 | raise ApiTypeError( 261 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 262 | % ( 263 | args, 264 | self.__class__.__name__, 265 | ), 266 | path_to_item=_path_to_item, 267 | valid_classes=(self.__class__,), 268 | ) 269 | 270 | self._data_store = {} 271 | self._check_type = _check_type 272 | self._spec_property_naming = _spec_property_naming 273 | self._path_to_item = _path_to_item 274 | self._configuration = _configuration 275 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 276 | 277 | for var_name, var_value in kwargs.items(): 278 | if ( 279 | var_name not in self.attribute_map 280 | and self._configuration is not None 281 | and self._configuration.discard_unknown_keys 282 | and self.additional_properties_type is None 283 | ): 284 | # discard variable. 285 | continue 286 | setattr(self, var_name, var_value) 287 | if var_name in self.read_only_vars: 288 | raise ApiAttributeError( 289 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 290 | f"class with read only attributes." 291 | ) 292 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/request_options.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | class RequestOptions(ModelNormal): 34 | """NOTE: This class is auto generated by OpenAPI Generator. 35 | Ref: https://openapi-generator.tech 36 | 37 | Do not edit the class manually. 38 | 39 | Attributes: 40 | allowed_values (dict): The key is the tuple path to the attribute 41 | and the for var_name this is (var_name,). The value is a dict 42 | with a capitalized key describing the allowed value and an allowed 43 | value. These dicts store the allowed enum values. 44 | attribute_map (dict): The key is attribute name 45 | and the value is json key in definition. 46 | discriminator_value_class_map (dict): A dict to go from the discriminator 47 | variable value to the discriminator class name. 48 | validations (dict): The key is the tuple path to the attribute 49 | and the for var_name this is (var_name,). The value is a dict 50 | that stores validations for max_length, min_length, max_items, 51 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 52 | inclusive_minimum, and regex. 53 | additional_properties_type (tuple): A tuple of classes accepted 54 | as additional properties values. 55 | """ 56 | 57 | allowed_values = {} 58 | 59 | validations = {} 60 | 61 | @cached_property 62 | def additional_properties_type(): 63 | """ 64 | This must be a method because a model may have properties that are 65 | of type self, this must run after the class is loaded 66 | """ 67 | return ( 68 | bool, 69 | date, 70 | datetime, 71 | dict, 72 | float, 73 | int, 74 | list, 75 | str, 76 | none_type, 77 | ) # noqa: E501 78 | 79 | _nullable = False 80 | 81 | @cached_property 82 | def openapi_types(): 83 | """ 84 | This must be a method because a model may have properties that are 85 | of type self, this must run after the class is loaded 86 | 87 | Returns 88 | openapi_types (dict): The key is attribute name 89 | and the value is attribute type. 90 | """ 91 | return { 92 | "rows": (int,), # noqa: E501 93 | "sort": (str,), # noqa: E501 94 | "start": (int,), # noqa: E501 95 | "fq": ([str],), # noqa: E501 96 | } 97 | 98 | @cached_property 99 | def discriminator(): 100 | return None 101 | 102 | attribute_map = { 103 | "rows": "rows", # noqa: E501 104 | "sort": "sort", # noqa: E501 105 | "start": "start", # noqa: E501 106 | "fq": "fq", # noqa: E501 107 | } 108 | 109 | read_only_vars = {} 110 | 111 | _composed_schemas = {} 112 | 113 | @classmethod 114 | @convert_js_args_to_python_args 115 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 116 | """RequestOptions - a model defined in OpenAPI 117 | 118 | Keyword Args: 119 | _check_type (bool): if True, values for parameters in openapi_types 120 | will be type checked and a TypeError will be 121 | raised if the wrong type is input. 122 | Defaults to True 123 | _path_to_item (tuple/list): This is a list of keys or values to 124 | drill down to the model in received_data 125 | when deserializing a response 126 | _spec_property_naming (bool): True if the variable names in the input data 127 | are serialized names, as specified in the OpenAPI document. 128 | False if the variable names in the input data 129 | are pythonic names, e.g. snake case (default) 130 | _configuration (Configuration): the instance to use when 131 | deserializing a file_type parameter. 132 | If passed, type conversion is attempted 133 | If omitted no type conversion is done. 134 | _visited_composed_classes (tuple): This stores a tuple of 135 | classes that we have traveled through so that 136 | if we see that class again we will not use its 137 | discriminator again. 138 | When traveling through a discriminator, the 139 | composed schema that is 140 | is traveled through is added to this set. 141 | For example if Animal has a discriminator 142 | petType and we pass in "Dog", and the class Dog 143 | allOf includes Animal, we move through Animal 144 | once using the discriminator, and pick Dog. 145 | Then in Dog, we will make an instance of the 146 | Animal class but this time we won't travel 147 | through its discriminator because we passed in 148 | _visited_composed_classes = (Animal,) 149 | rows (int): Anzahl zu ladender Einträge. [optional] # noqa: E501 150 | sort (str): [optional] # noqa: E501 151 | start (int): Start-Index der zu ladenden Einträge. [optional] # noqa: E501 152 | fq ([str]): [optional] # noqa: E501 153 | """ 154 | 155 | _check_type = kwargs.pop("_check_type", True) 156 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 157 | _path_to_item = kwargs.pop("_path_to_item", ()) 158 | _configuration = kwargs.pop("_configuration", None) 159 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 160 | 161 | self = super(OpenApiModel, cls).__new__(cls) 162 | 163 | if args: 164 | for arg in args: 165 | if isinstance(arg, dict): 166 | kwargs.update(arg) 167 | else: 168 | raise ApiTypeError( 169 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 170 | % ( 171 | args, 172 | self.__class__.__name__, 173 | ), 174 | path_to_item=_path_to_item, 175 | valid_classes=(self.__class__,), 176 | ) 177 | 178 | self._data_store = {} 179 | self._check_type = _check_type 180 | self._spec_property_naming = _spec_property_naming 181 | self._path_to_item = _path_to_item 182 | self._configuration = _configuration 183 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 184 | 185 | for var_name, var_value in kwargs.items(): 186 | if ( 187 | var_name not in self.attribute_map 188 | and self._configuration is not None 189 | and self._configuration.discard_unknown_keys 190 | and self.additional_properties_type is None 191 | ): 192 | # discard variable. 193 | continue 194 | setattr(self, var_name, var_value) 195 | return self 196 | 197 | required_properties = set( 198 | [ 199 | "_data_store", 200 | "_check_type", 201 | "_spec_property_naming", 202 | "_path_to_item", 203 | "_configuration", 204 | "_visited_composed_classes", 205 | ] 206 | ) 207 | 208 | @convert_js_args_to_python_args 209 | def __init__(self, *args, **kwargs): # noqa: E501 210 | """RequestOptions - a model defined in OpenAPI 211 | 212 | Keyword Args: 213 | _check_type (bool): if True, values for parameters in openapi_types 214 | will be type checked and a TypeError will be 215 | raised if the wrong type is input. 216 | Defaults to True 217 | _path_to_item (tuple/list): This is a list of keys or values to 218 | drill down to the model in received_data 219 | when deserializing a response 220 | _spec_property_naming (bool): True if the variable names in the input data 221 | are serialized names, as specified in the OpenAPI document. 222 | False if the variable names in the input data 223 | are pythonic names, e.g. snake case (default) 224 | _configuration (Configuration): the instance to use when 225 | deserializing a file_type parameter. 226 | If passed, type conversion is attempted 227 | If omitted no type conversion is done. 228 | _visited_composed_classes (tuple): This stores a tuple of 229 | classes that we have traveled through so that 230 | if we see that class again we will not use its 231 | discriminator again. 232 | When traveling through a discriminator, the 233 | composed schema that is 234 | is traveled through is added to this set. 235 | For example if Animal has a discriminator 236 | petType and we pass in "Dog", and the class Dog 237 | allOf includes Animal, we move through Animal 238 | once using the discriminator, and pick Dog. 239 | Then in Dog, we will make an instance of the 240 | Animal class but this time we won't travel 241 | through its discriminator because we passed in 242 | _visited_composed_classes = (Animal,) 243 | rows (int): Anzahl zu ladender Einträge. [optional] # noqa: E501 244 | sort (str): [optional] # noqa: E501 245 | start (int): Start-Index der zu ladenden Einträge. [optional] # noqa: E501 246 | fq ([str]): [optional] # noqa: E501 247 | """ 248 | 249 | _check_type = kwargs.pop("_check_type", True) 250 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 251 | _path_to_item = kwargs.pop("_path_to_item", ()) 252 | _configuration = kwargs.pop("_configuration", None) 253 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 254 | 255 | if args: 256 | for arg in args: 257 | if isinstance(arg, dict): 258 | kwargs.update(arg) 259 | else: 260 | raise ApiTypeError( 261 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 262 | % ( 263 | args, 264 | self.__class__.__name__, 265 | ), 266 | path_to_item=_path_to_item, 267 | valid_classes=(self.__class__,), 268 | ) 269 | 270 | self._data_store = {} 271 | self._check_type = _check_type 272 | self._spec_property_naming = _spec_property_naming 273 | self._path_to_item = _path_to_item 274 | self._configuration = _configuration 275 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 276 | 277 | for var_name, var_value in kwargs.items(): 278 | if ( 279 | var_name not in self.attribute_map 280 | and self._configuration is not None 281 | and self._configuration.discard_unknown_keys 282 | and self.additional_properties_type is None 283 | ): 284 | # discard variable. 285 | continue 286 | setattr(self, var_name, var_value) 287 | if var_name in self.read_only_vars: 288 | raise ApiAttributeError( 289 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 290 | f"class with read only attributes." 291 | ) 292 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/response.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | def lazy_import(): 34 | from deutschland.lebensmittelwarnung.model.response_docs_inner import ( 35 | ResponseDocsInner, 36 | ) 37 | 38 | globals()["ResponseDocsInner"] = ResponseDocsInner 39 | 40 | 41 | class Response(ModelNormal): 42 | """NOTE: This class is auto generated by OpenAPI Generator. 43 | Ref: https://openapi-generator.tech 44 | 45 | Do not edit the class manually. 46 | 47 | Attributes: 48 | allowed_values (dict): The key is the tuple path to the attribute 49 | and the for var_name this is (var_name,). The value is a dict 50 | with a capitalized key describing the allowed value and an allowed 51 | value. These dicts store the allowed enum values. 52 | attribute_map (dict): The key is attribute name 53 | and the value is json key in definition. 54 | discriminator_value_class_map (dict): A dict to go from the discriminator 55 | variable value to the discriminator class name. 56 | validations (dict): The key is the tuple path to the attribute 57 | and the for var_name this is (var_name,). The value is a dict 58 | that stores validations for max_length, min_length, max_items, 59 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 60 | inclusive_minimum, and regex. 61 | additional_properties_type (tuple): A tuple of classes accepted 62 | as additional properties values. 63 | """ 64 | 65 | allowed_values = {} 66 | 67 | validations = {} 68 | 69 | @cached_property 70 | def additional_properties_type(): 71 | """ 72 | This must be a method because a model may have properties that are 73 | of type self, this must run after the class is loaded 74 | """ 75 | lazy_import() 76 | return ( 77 | bool, 78 | date, 79 | datetime, 80 | dict, 81 | float, 82 | int, 83 | list, 84 | str, 85 | none_type, 86 | ) # noqa: E501 87 | 88 | _nullable = False 89 | 90 | @cached_property 91 | def openapi_types(): 92 | """ 93 | This must be a method because a model may have properties that are 94 | of type self, this must run after the class is loaded 95 | 96 | Returns 97 | openapi_types (dict): The key is attribute name 98 | and the value is attribute type. 99 | """ 100 | lazy_import() 101 | return { 102 | "docs": ([ResponseDocsInner],), # noqa: E501 103 | "num_found": (int,), # noqa: E501 104 | } 105 | 106 | @cached_property 107 | def discriminator(): 108 | return None 109 | 110 | attribute_map = { 111 | "docs": "docs", # noqa: E501 112 | "num_found": "numFound", # noqa: E501 113 | } 114 | 115 | read_only_vars = {} 116 | 117 | _composed_schemas = {} 118 | 119 | @classmethod 120 | @convert_js_args_to_python_args 121 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 122 | """Response - a model defined in OpenAPI 123 | 124 | Keyword Args: 125 | _check_type (bool): if True, values for parameters in openapi_types 126 | will be type checked and a TypeError will be 127 | raised if the wrong type is input. 128 | Defaults to True 129 | _path_to_item (tuple/list): This is a list of keys or values to 130 | drill down to the model in received_data 131 | when deserializing a response 132 | _spec_property_naming (bool): True if the variable names in the input data 133 | are serialized names, as specified in the OpenAPI document. 134 | False if the variable names in the input data 135 | are pythonic names, e.g. snake case (default) 136 | _configuration (Configuration): the instance to use when 137 | deserializing a file_type parameter. 138 | If passed, type conversion is attempted 139 | If omitted no type conversion is done. 140 | _visited_composed_classes (tuple): This stores a tuple of 141 | classes that we have traveled through so that 142 | if we see that class again we will not use its 143 | discriminator again. 144 | When traveling through a discriminator, the 145 | composed schema that is 146 | is traveled through is added to this set. 147 | For example if Animal has a discriminator 148 | petType and we pass in "Dog", and the class Dog 149 | allOf includes Animal, we move through Animal 150 | once using the discriminator, and pick Dog. 151 | Then in Dog, we will make an instance of the 152 | Animal class but this time we won't travel 153 | through its discriminator because we passed in 154 | _visited_composed_classes = (Animal,) 155 | docs ([ResponseDocsInner]): [optional] # noqa: E501 156 | num_found (int): [optional] # noqa: E501 157 | """ 158 | 159 | _check_type = kwargs.pop("_check_type", True) 160 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 161 | _path_to_item = kwargs.pop("_path_to_item", ()) 162 | _configuration = kwargs.pop("_configuration", None) 163 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 164 | 165 | self = super(OpenApiModel, cls).__new__(cls) 166 | 167 | if args: 168 | for arg in args: 169 | if isinstance(arg, dict): 170 | kwargs.update(arg) 171 | else: 172 | raise ApiTypeError( 173 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 174 | % ( 175 | args, 176 | self.__class__.__name__, 177 | ), 178 | path_to_item=_path_to_item, 179 | valid_classes=(self.__class__,), 180 | ) 181 | 182 | self._data_store = {} 183 | self._check_type = _check_type 184 | self._spec_property_naming = _spec_property_naming 185 | self._path_to_item = _path_to_item 186 | self._configuration = _configuration 187 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 188 | 189 | for var_name, var_value in kwargs.items(): 190 | if ( 191 | var_name not in self.attribute_map 192 | and self._configuration is not None 193 | and self._configuration.discard_unknown_keys 194 | and self.additional_properties_type is None 195 | ): 196 | # discard variable. 197 | continue 198 | setattr(self, var_name, var_value) 199 | return self 200 | 201 | required_properties = set( 202 | [ 203 | "_data_store", 204 | "_check_type", 205 | "_spec_property_naming", 206 | "_path_to_item", 207 | "_configuration", 208 | "_visited_composed_classes", 209 | ] 210 | ) 211 | 212 | @convert_js_args_to_python_args 213 | def __init__(self, *args, **kwargs): # noqa: E501 214 | """Response - a model defined in OpenAPI 215 | 216 | Keyword Args: 217 | _check_type (bool): if True, values for parameters in openapi_types 218 | will be type checked and a TypeError will be 219 | raised if the wrong type is input. 220 | Defaults to True 221 | _path_to_item (tuple/list): This is a list of keys or values to 222 | drill down to the model in received_data 223 | when deserializing a response 224 | _spec_property_naming (bool): True if the variable names in the input data 225 | are serialized names, as specified in the OpenAPI document. 226 | False if the variable names in the input data 227 | are pythonic names, e.g. snake case (default) 228 | _configuration (Configuration): the instance to use when 229 | deserializing a file_type parameter. 230 | If passed, type conversion is attempted 231 | If omitted no type conversion is done. 232 | _visited_composed_classes (tuple): This stores a tuple of 233 | classes that we have traveled through so that 234 | if we see that class again we will not use its 235 | discriminator again. 236 | When traveling through a discriminator, the 237 | composed schema that is 238 | is traveled through is added to this set. 239 | For example if Animal has a discriminator 240 | petType and we pass in "Dog", and the class Dog 241 | allOf includes Animal, we move through Animal 242 | once using the discriminator, and pick Dog. 243 | Then in Dog, we will make an instance of the 244 | Animal class but this time we won't travel 245 | through its discriminator because we passed in 246 | _visited_composed_classes = (Animal,) 247 | docs ([ResponseDocsInner]): [optional] # noqa: E501 248 | num_found (int): [optional] # noqa: E501 249 | """ 250 | 251 | _check_type = kwargs.pop("_check_type", True) 252 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 253 | _path_to_item = kwargs.pop("_path_to_item", ()) 254 | _configuration = kwargs.pop("_configuration", None) 255 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 256 | 257 | if args: 258 | for arg in args: 259 | if isinstance(arg, dict): 260 | kwargs.update(arg) 261 | else: 262 | raise ApiTypeError( 263 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 264 | % ( 265 | args, 266 | self.__class__.__name__, 267 | ), 268 | path_to_item=_path_to_item, 269 | valid_classes=(self.__class__,), 270 | ) 271 | 272 | self._data_store = {} 273 | self._check_type = _check_type 274 | self._spec_property_naming = _spec_property_naming 275 | self._path_to_item = _path_to_item 276 | self._configuration = _configuration 277 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 278 | 279 | for var_name, var_value in kwargs.items(): 280 | if ( 281 | var_name not in self.attribute_map 282 | and self._configuration is not None 283 | and self._configuration.discard_unknown_keys 284 | and self.additional_properties_type is None 285 | ): 286 | # discard variable. 287 | continue 288 | setattr(self, var_name, var_value) 289 | if var_name in self.read_only_vars: 290 | raise ApiAttributeError( 291 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 292 | f"class with read only attributes." 293 | ) 294 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/response_docs_inner.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | def lazy_import(): 34 | from deutschland.lebensmittelwarnung.model.response_docs_inner_product import ( 35 | ResponseDocsInnerProduct, 36 | ) 37 | from deutschland.lebensmittelwarnung.model.response_docs_inner_rapex_information import ( 38 | ResponseDocsInnerRapexInformation, 39 | ) 40 | from deutschland.lebensmittelwarnung.model.response_docs_inner_safety_information import ( 41 | ResponseDocsInnerSafetyInformation, 42 | ) 43 | 44 | globals()["ResponseDocsInnerProduct"] = ResponseDocsInnerProduct 45 | globals()["ResponseDocsInnerRapexInformation"] = ResponseDocsInnerRapexInformation 46 | globals()["ResponseDocsInnerSafetyInformation"] = ResponseDocsInnerSafetyInformation 47 | 48 | 49 | class ResponseDocsInner(ModelNormal): 50 | """NOTE: This class is auto generated by OpenAPI Generator. 51 | Ref: https://openapi-generator.tech 52 | 53 | Do not edit the class manually. 54 | 55 | Attributes: 56 | allowed_values (dict): The key is the tuple path to the attribute 57 | and the for var_name this is (var_name,). The value is a dict 58 | with a capitalized key describing the allowed value and an allowed 59 | value. These dicts store the allowed enum values. 60 | attribute_map (dict): The key is attribute name 61 | and the value is json key in definition. 62 | discriminator_value_class_map (dict): A dict to go from the discriminator 63 | variable value to the discriminator class name. 64 | validations (dict): The key is the tuple path to the attribute 65 | and the for var_name this is (var_name,). The value is a dict 66 | that stores validations for max_length, min_length, max_items, 67 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 68 | inclusive_minimum, and regex. 69 | additional_properties_type (tuple): A tuple of classes accepted 70 | as additional properties values. 71 | """ 72 | 73 | allowed_values = {} 74 | 75 | validations = {} 76 | 77 | @cached_property 78 | def additional_properties_type(): 79 | """ 80 | This must be a method because a model may have properties that are 81 | of type self, this must run after the class is loaded 82 | """ 83 | lazy_import() 84 | return ( 85 | bool, 86 | date, 87 | datetime, 88 | dict, 89 | float, 90 | int, 91 | list, 92 | str, 93 | none_type, 94 | ) # noqa: E501 95 | 96 | _nullable = False 97 | 98 | @cached_property 99 | def openapi_types(): 100 | """ 101 | This must be a method because a model may have properties that are 102 | of type self, this must run after the class is loaded 103 | 104 | Returns 105 | openapi_types (dict): The key is attribute name 106 | and the value is attribute type. 107 | """ 108 | lazy_import() 109 | return { 110 | "type": (str,), # noqa: E501 111 | "archived": (bool,), # noqa: E501 112 | "id": (int,), # noqa: E501 113 | "link": (str,), # noqa: E501 114 | "published_date": (int,), # noqa: E501 115 | "title": (str,), # noqa: E501 116 | "product": (ResponseDocsInnerProduct,), # noqa: E501 117 | "rapex_information": (ResponseDocsInnerRapexInformation,), # noqa: E501 118 | "safety_information": (ResponseDocsInnerSafetyInformation,), # noqa: E501 119 | } 120 | 121 | @cached_property 122 | def discriminator(): 123 | return None 124 | 125 | attribute_map = { 126 | "type": "_type", # noqa: E501 127 | "archived": "archived", # noqa: E501 128 | "id": "id", # noqa: E501 129 | "link": "link", # noqa: E501 130 | "published_date": "publishedDate", # noqa: E501 131 | "title": "title", # noqa: E501 132 | "product": "product", # noqa: E501 133 | "rapex_information": "rapexInformation", # noqa: E501 134 | "safety_information": "safetyInformation", # noqa: E501 135 | } 136 | 137 | read_only_vars = {} 138 | 139 | _composed_schemas = {} 140 | 141 | @classmethod 142 | @convert_js_args_to_python_args 143 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 144 | """ResponseDocsInner - a model defined in OpenAPI 145 | 146 | Keyword Args: 147 | _check_type (bool): if True, values for parameters in openapi_types 148 | will be type checked and a TypeError will be 149 | raised if the wrong type is input. 150 | Defaults to True 151 | _path_to_item (tuple/list): This is a list of keys or values to 152 | drill down to the model in received_data 153 | when deserializing a response 154 | _spec_property_naming (bool): True if the variable names in the input data 155 | are serialized names, as specified in the OpenAPI document. 156 | False if the variable names in the input data 157 | are pythonic names, e.g. snake case (default) 158 | _configuration (Configuration): the instance to use when 159 | deserializing a file_type parameter. 160 | If passed, type conversion is attempted 161 | If omitted no type conversion is done. 162 | _visited_composed_classes (tuple): This stores a tuple of 163 | classes that we have traveled through so that 164 | if we see that class again we will not use its 165 | discriminator again. 166 | When traveling through a discriminator, the 167 | composed schema that is 168 | is traveled through is added to this set. 169 | For example if Animal has a discriminator 170 | petType and we pass in "Dog", and the class Dog 171 | allOf includes Animal, we move through Animal 172 | once using the discriminator, and pick Dog. 173 | Then in Dog, we will make an instance of the 174 | Animal class but this time we won't travel 175 | through its discriminator because we passed in 176 | _visited_composed_classes = (Animal,) 177 | type (str): [optional] # noqa: E501 178 | archived (bool): [optional] # noqa: E501 179 | id (int): [optional] # noqa: E501 180 | link (str): [optional] # noqa: E501 181 | published_date (int): [optional] # noqa: E501 182 | title (str): [optional] # noqa: E501 183 | product (ResponseDocsInnerProduct): [optional] # noqa: E501 184 | rapex_information (ResponseDocsInnerRapexInformation): [optional] # noqa: E501 185 | safety_information (ResponseDocsInnerSafetyInformation): [optional] # noqa: E501 186 | """ 187 | 188 | _check_type = kwargs.pop("_check_type", True) 189 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 190 | _path_to_item = kwargs.pop("_path_to_item", ()) 191 | _configuration = kwargs.pop("_configuration", None) 192 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 193 | 194 | self = super(OpenApiModel, cls).__new__(cls) 195 | 196 | if args: 197 | for arg in args: 198 | if isinstance(arg, dict): 199 | kwargs.update(arg) 200 | else: 201 | raise ApiTypeError( 202 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 203 | % ( 204 | args, 205 | self.__class__.__name__, 206 | ), 207 | path_to_item=_path_to_item, 208 | valid_classes=(self.__class__,), 209 | ) 210 | 211 | self._data_store = {} 212 | self._check_type = _check_type 213 | self._spec_property_naming = _spec_property_naming 214 | self._path_to_item = _path_to_item 215 | self._configuration = _configuration 216 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 217 | 218 | for var_name, var_value in kwargs.items(): 219 | if ( 220 | var_name not in self.attribute_map 221 | and self._configuration is not None 222 | and self._configuration.discard_unknown_keys 223 | and self.additional_properties_type is None 224 | ): 225 | # discard variable. 226 | continue 227 | setattr(self, var_name, var_value) 228 | return self 229 | 230 | required_properties = set( 231 | [ 232 | "_data_store", 233 | "_check_type", 234 | "_spec_property_naming", 235 | "_path_to_item", 236 | "_configuration", 237 | "_visited_composed_classes", 238 | ] 239 | ) 240 | 241 | @convert_js_args_to_python_args 242 | def __init__(self, *args, **kwargs): # noqa: E501 243 | """ResponseDocsInner - a model defined in OpenAPI 244 | 245 | Keyword Args: 246 | _check_type (bool): if True, values for parameters in openapi_types 247 | will be type checked and a TypeError will be 248 | raised if the wrong type is input. 249 | Defaults to True 250 | _path_to_item (tuple/list): This is a list of keys or values to 251 | drill down to the model in received_data 252 | when deserializing a response 253 | _spec_property_naming (bool): True if the variable names in the input data 254 | are serialized names, as specified in the OpenAPI document. 255 | False if the variable names in the input data 256 | are pythonic names, e.g. snake case (default) 257 | _configuration (Configuration): the instance to use when 258 | deserializing a file_type parameter. 259 | If passed, type conversion is attempted 260 | If omitted no type conversion is done. 261 | _visited_composed_classes (tuple): This stores a tuple of 262 | classes that we have traveled through so that 263 | if we see that class again we will not use its 264 | discriminator again. 265 | When traveling through a discriminator, the 266 | composed schema that is 267 | is traveled through is added to this set. 268 | For example if Animal has a discriminator 269 | petType and we pass in "Dog", and the class Dog 270 | allOf includes Animal, we move through Animal 271 | once using the discriminator, and pick Dog. 272 | Then in Dog, we will make an instance of the 273 | Animal class but this time we won't travel 274 | through its discriminator because we passed in 275 | _visited_composed_classes = (Animal,) 276 | type (str): [optional] # noqa: E501 277 | archived (bool): [optional] # noqa: E501 278 | id (int): [optional] # noqa: E501 279 | link (str): [optional] # noqa: E501 280 | published_date (int): [optional] # noqa: E501 281 | title (str): [optional] # noqa: E501 282 | product (ResponseDocsInnerProduct): [optional] # noqa: E501 283 | rapex_information (ResponseDocsInnerRapexInformation): [optional] # noqa: E501 284 | safety_information (ResponseDocsInnerSafetyInformation): [optional] # noqa: E501 285 | """ 286 | 287 | _check_type = kwargs.pop("_check_type", True) 288 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 289 | _path_to_item = kwargs.pop("_path_to_item", ()) 290 | _configuration = kwargs.pop("_configuration", None) 291 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 292 | 293 | if args: 294 | for arg in args: 295 | if isinstance(arg, dict): 296 | kwargs.update(arg) 297 | else: 298 | raise ApiTypeError( 299 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 300 | % ( 301 | args, 302 | self.__class__.__name__, 303 | ), 304 | path_to_item=_path_to_item, 305 | valid_classes=(self.__class__,), 306 | ) 307 | 308 | self._data_store = {} 309 | self._check_type = _check_type 310 | self._spec_property_naming = _spec_property_naming 311 | self._path_to_item = _path_to_item 312 | self._configuration = _configuration 313 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 314 | 315 | for var_name, var_value in kwargs.items(): 316 | if ( 317 | var_name not in self.attribute_map 318 | and self._configuration is not None 319 | and self._configuration.discard_unknown_keys 320 | and self.additional_properties_type is None 321 | ): 322 | # discard variable. 323 | continue 324 | setattr(self, var_name, var_value) 325 | if var_name in self.read_only_vars: 326 | raise ApiAttributeError( 327 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 328 | f"class with read only attributes." 329 | ) 330 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/response_docs_inner_product.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | class ResponseDocsInnerProduct(ModelNormal): 34 | """NOTE: This class is auto generated by OpenAPI Generator. 35 | Ref: https://openapi-generator.tech 36 | 37 | Do not edit the class manually. 38 | 39 | Attributes: 40 | allowed_values (dict): The key is the tuple path to the attribute 41 | and the for var_name this is (var_name,). The value is a dict 42 | with a capitalized key describing the allowed value and an allowed 43 | value. These dicts store the allowed enum values. 44 | attribute_map (dict): The key is attribute name 45 | and the value is json key in definition. 46 | discriminator_value_class_map (dict): A dict to go from the discriminator 47 | variable value to the discriminator class name. 48 | validations (dict): The key is the tuple path to the attribute 49 | and the for var_name this is (var_name,). The value is a dict 50 | that stores validations for max_length, min_length, max_items, 51 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 52 | inclusive_minimum, and regex. 53 | additional_properties_type (tuple): A tuple of classes accepted 54 | as additional properties values. 55 | """ 56 | 57 | allowed_values = {} 58 | 59 | validations = {} 60 | 61 | @cached_property 62 | def additional_properties_type(): 63 | """ 64 | This must be a method because a model may have properties that are 65 | of type self, this must run after the class is loaded 66 | """ 67 | return ( 68 | bool, 69 | date, 70 | datetime, 71 | dict, 72 | float, 73 | int, 74 | list, 75 | str, 76 | none_type, 77 | ) # noqa: E501 78 | 79 | _nullable = False 80 | 81 | @cached_property 82 | def openapi_types(): 83 | """ 84 | This must be a method because a model may have properties that are 85 | of type self, this must run after the class is loaded 86 | 87 | Returns 88 | openapi_types (dict): The key is attribute name 89 | and the value is attribute type. 90 | """ 91 | return { 92 | "type": (str,), # noqa: E501 93 | "designation": (str,), # noqa: E501 94 | "image_urls": ([str],), # noqa: E501 95 | "manufacturer": (str,), # noqa: E501 96 | "affected_products": (str,), # noqa: E501 97 | "brand_name": (str,), # noqa: E501 98 | "category": (str,), # noqa: E501 99 | "country_of_origin": (str,), # noqa: E501 100 | "model": (str,), # noqa: E501 101 | "short_description": (str,), # noqa: E501 102 | } 103 | 104 | @cached_property 105 | def discriminator(): 106 | return None 107 | 108 | attribute_map = { 109 | "type": "_type", # noqa: E501 110 | "designation": "designation", # noqa: E501 111 | "image_urls": "imageUrls", # noqa: E501 112 | "manufacturer": "manufacturer", # noqa: E501 113 | "affected_products": "affectedProducts", # noqa: E501 114 | "brand_name": "brandName", # noqa: E501 115 | "category": "category", # noqa: E501 116 | "country_of_origin": "countryOfOrigin", # noqa: E501 117 | "model": "model", # noqa: E501 118 | "short_description": "shortDescription", # noqa: E501 119 | } 120 | 121 | read_only_vars = {} 122 | 123 | _composed_schemas = {} 124 | 125 | @classmethod 126 | @convert_js_args_to_python_args 127 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 128 | """ResponseDocsInnerProduct - a model defined in OpenAPI 129 | 130 | Keyword Args: 131 | _check_type (bool): if True, values for parameters in openapi_types 132 | will be type checked and a TypeError will be 133 | raised if the wrong type is input. 134 | Defaults to True 135 | _path_to_item (tuple/list): This is a list of keys or values to 136 | drill down to the model in received_data 137 | when deserializing a response 138 | _spec_property_naming (bool): True if the variable names in the input data 139 | are serialized names, as specified in the OpenAPI document. 140 | False if the variable names in the input data 141 | are pythonic names, e.g. snake case (default) 142 | _configuration (Configuration): the instance to use when 143 | deserializing a file_type parameter. 144 | If passed, type conversion is attempted 145 | If omitted no type conversion is done. 146 | _visited_composed_classes (tuple): This stores a tuple of 147 | classes that we have traveled through so that 148 | if we see that class again we will not use its 149 | discriminator again. 150 | When traveling through a discriminator, the 151 | composed schema that is 152 | is traveled through is added to this set. 153 | For example if Animal has a discriminator 154 | petType and we pass in "Dog", and the class Dog 155 | allOf includes Animal, we move through Animal 156 | once using the discriminator, and pick Dog. 157 | Then in Dog, we will make an instance of the 158 | Animal class but this time we won't travel 159 | through its discriminator because we passed in 160 | _visited_composed_classes = (Animal,) 161 | type (str): [optional] # noqa: E501 162 | designation (str): [optional] # noqa: E501 163 | image_urls ([str]): [optional] # noqa: E501 164 | manufacturer (str): [optional] # noqa: E501 165 | affected_products (str): [optional] # noqa: E501 166 | brand_name (str): [optional] # noqa: E501 167 | category (str): [optional] # noqa: E501 168 | country_of_origin (str): [optional] # noqa: E501 169 | model (str): [optional] # noqa: E501 170 | short_description (str): [optional] # noqa: E501 171 | """ 172 | 173 | _check_type = kwargs.pop("_check_type", True) 174 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 175 | _path_to_item = kwargs.pop("_path_to_item", ()) 176 | _configuration = kwargs.pop("_configuration", None) 177 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 178 | 179 | self = super(OpenApiModel, cls).__new__(cls) 180 | 181 | if args: 182 | for arg in args: 183 | if isinstance(arg, dict): 184 | kwargs.update(arg) 185 | else: 186 | raise ApiTypeError( 187 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 188 | % ( 189 | args, 190 | self.__class__.__name__, 191 | ), 192 | path_to_item=_path_to_item, 193 | valid_classes=(self.__class__,), 194 | ) 195 | 196 | self._data_store = {} 197 | self._check_type = _check_type 198 | self._spec_property_naming = _spec_property_naming 199 | self._path_to_item = _path_to_item 200 | self._configuration = _configuration 201 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 202 | 203 | for var_name, var_value in kwargs.items(): 204 | if ( 205 | var_name not in self.attribute_map 206 | and self._configuration is not None 207 | and self._configuration.discard_unknown_keys 208 | and self.additional_properties_type is None 209 | ): 210 | # discard variable. 211 | continue 212 | setattr(self, var_name, var_value) 213 | return self 214 | 215 | required_properties = set( 216 | [ 217 | "_data_store", 218 | "_check_type", 219 | "_spec_property_naming", 220 | "_path_to_item", 221 | "_configuration", 222 | "_visited_composed_classes", 223 | ] 224 | ) 225 | 226 | @convert_js_args_to_python_args 227 | def __init__(self, *args, **kwargs): # noqa: E501 228 | """ResponseDocsInnerProduct - a model defined in OpenAPI 229 | 230 | Keyword Args: 231 | _check_type (bool): if True, values for parameters in openapi_types 232 | will be type checked and a TypeError will be 233 | raised if the wrong type is input. 234 | Defaults to True 235 | _path_to_item (tuple/list): This is a list of keys or values to 236 | drill down to the model in received_data 237 | when deserializing a response 238 | _spec_property_naming (bool): True if the variable names in the input data 239 | are serialized names, as specified in the OpenAPI document. 240 | False if the variable names in the input data 241 | are pythonic names, e.g. snake case (default) 242 | _configuration (Configuration): the instance to use when 243 | deserializing a file_type parameter. 244 | If passed, type conversion is attempted 245 | If omitted no type conversion is done. 246 | _visited_composed_classes (tuple): This stores a tuple of 247 | classes that we have traveled through so that 248 | if we see that class again we will not use its 249 | discriminator again. 250 | When traveling through a discriminator, the 251 | composed schema that is 252 | is traveled through is added to this set. 253 | For example if Animal has a discriminator 254 | petType and we pass in "Dog", and the class Dog 255 | allOf includes Animal, we move through Animal 256 | once using the discriminator, and pick Dog. 257 | Then in Dog, we will make an instance of the 258 | Animal class but this time we won't travel 259 | through its discriminator because we passed in 260 | _visited_composed_classes = (Animal,) 261 | type (str): [optional] # noqa: E501 262 | designation (str): [optional] # noqa: E501 263 | image_urls ([str]): [optional] # noqa: E501 264 | manufacturer (str): [optional] # noqa: E501 265 | affected_products (str): [optional] # noqa: E501 266 | brand_name (str): [optional] # noqa: E501 267 | category (str): [optional] # noqa: E501 268 | country_of_origin (str): [optional] # noqa: E501 269 | model (str): [optional] # noqa: E501 270 | short_description (str): [optional] # noqa: E501 271 | """ 272 | 273 | _check_type = kwargs.pop("_check_type", True) 274 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 275 | _path_to_item = kwargs.pop("_path_to_item", ()) 276 | _configuration = kwargs.pop("_configuration", None) 277 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 278 | 279 | if args: 280 | for arg in args: 281 | if isinstance(arg, dict): 282 | kwargs.update(arg) 283 | else: 284 | raise ApiTypeError( 285 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 286 | % ( 287 | args, 288 | self.__class__.__name__, 289 | ), 290 | path_to_item=_path_to_item, 291 | valid_classes=(self.__class__,), 292 | ) 293 | 294 | self._data_store = {} 295 | self._check_type = _check_type 296 | self._spec_property_naming = _spec_property_naming 297 | self._path_to_item = _path_to_item 298 | self._configuration = _configuration 299 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 300 | 301 | for var_name, var_value in kwargs.items(): 302 | if ( 303 | var_name not in self.attribute_map 304 | and self._configuration is not None 305 | and self._configuration.discard_unknown_keys 306 | and self.additional_properties_type is None 307 | ): 308 | # discard variable. 309 | continue 310 | setattr(self, var_name, var_value) 311 | if var_name in self.read_only_vars: 312 | raise ApiAttributeError( 313 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 314 | f"class with read only attributes." 315 | ) 316 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/response_docs_inner_rapex_information.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | class ResponseDocsInnerRapexInformation(ModelNormal): 34 | """NOTE: This class is auto generated by OpenAPI Generator. 35 | Ref: https://openapi-generator.tech 36 | 37 | Do not edit the class manually. 38 | 39 | Attributes: 40 | allowed_values (dict): The key is the tuple path to the attribute 41 | and the for var_name this is (var_name,). The value is a dict 42 | with a capitalized key describing the allowed value and an allowed 43 | value. These dicts store the allowed enum values. 44 | attribute_map (dict): The key is attribute name 45 | and the value is json key in definition. 46 | discriminator_value_class_map (dict): A dict to go from the discriminator 47 | variable value to the discriminator class name. 48 | validations (dict): The key is the tuple path to the attribute 49 | and the for var_name this is (var_name,). The value is a dict 50 | that stores validations for max_length, min_length, max_items, 51 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 52 | inclusive_minimum, and regex. 53 | additional_properties_type (tuple): A tuple of classes accepted 54 | as additional properties values. 55 | """ 56 | 57 | allowed_values = {} 58 | 59 | validations = {} 60 | 61 | @cached_property 62 | def additional_properties_type(): 63 | """ 64 | This must be a method because a model may have properties that are 65 | of type self, this must run after the class is loaded 66 | """ 67 | return ( 68 | bool, 69 | date, 70 | datetime, 71 | dict, 72 | float, 73 | int, 74 | list, 75 | str, 76 | none_type, 77 | ) # noqa: E501 78 | 79 | _nullable = False 80 | 81 | @cached_property 82 | def openapi_types(): 83 | """ 84 | This must be a method because a model may have properties that are 85 | of type self, this must run after the class is loaded 86 | 87 | Returns 88 | openapi_types (dict): The key is attribute name 89 | and the value is attribute type. 90 | """ 91 | return { 92 | "alert_number": (str,), # noqa: E501 93 | "message": (str,), # noqa: E501 94 | } 95 | 96 | @cached_property 97 | def discriminator(): 98 | return None 99 | 100 | attribute_map = { 101 | "alert_number": "alertNumber", # noqa: E501 102 | "message": "message", # noqa: E501 103 | } 104 | 105 | read_only_vars = {} 106 | 107 | _composed_schemas = {} 108 | 109 | @classmethod 110 | @convert_js_args_to_python_args 111 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 112 | """ResponseDocsInnerRapexInformation - a model defined in OpenAPI 113 | 114 | Keyword Args: 115 | _check_type (bool): if True, values for parameters in openapi_types 116 | will be type checked and a TypeError will be 117 | raised if the wrong type is input. 118 | Defaults to True 119 | _path_to_item (tuple/list): This is a list of keys or values to 120 | drill down to the model in received_data 121 | when deserializing a response 122 | _spec_property_naming (bool): True if the variable names in the input data 123 | are serialized names, as specified in the OpenAPI document. 124 | False if the variable names in the input data 125 | are pythonic names, e.g. snake case (default) 126 | _configuration (Configuration): the instance to use when 127 | deserializing a file_type parameter. 128 | If passed, type conversion is attempted 129 | If omitted no type conversion is done. 130 | _visited_composed_classes (tuple): This stores a tuple of 131 | classes that we have traveled through so that 132 | if we see that class again we will not use its 133 | discriminator again. 134 | When traveling through a discriminator, the 135 | composed schema that is 136 | is traveled through is added to this set. 137 | For example if Animal has a discriminator 138 | petType and we pass in "Dog", and the class Dog 139 | allOf includes Animal, we move through Animal 140 | once using the discriminator, and pick Dog. 141 | Then in Dog, we will make an instance of the 142 | Animal class but this time we won't travel 143 | through its discriminator because we passed in 144 | _visited_composed_classes = (Animal,) 145 | alert_number (str): [optional] # noqa: E501 146 | message (str): [optional] # noqa: E501 147 | """ 148 | 149 | _check_type = kwargs.pop("_check_type", True) 150 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 151 | _path_to_item = kwargs.pop("_path_to_item", ()) 152 | _configuration = kwargs.pop("_configuration", None) 153 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 154 | 155 | self = super(OpenApiModel, cls).__new__(cls) 156 | 157 | if args: 158 | for arg in args: 159 | if isinstance(arg, dict): 160 | kwargs.update(arg) 161 | else: 162 | raise ApiTypeError( 163 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 164 | % ( 165 | args, 166 | self.__class__.__name__, 167 | ), 168 | path_to_item=_path_to_item, 169 | valid_classes=(self.__class__,), 170 | ) 171 | 172 | self._data_store = {} 173 | self._check_type = _check_type 174 | self._spec_property_naming = _spec_property_naming 175 | self._path_to_item = _path_to_item 176 | self._configuration = _configuration 177 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 178 | 179 | for var_name, var_value in kwargs.items(): 180 | if ( 181 | var_name not in self.attribute_map 182 | and self._configuration is not None 183 | and self._configuration.discard_unknown_keys 184 | and self.additional_properties_type is None 185 | ): 186 | # discard variable. 187 | continue 188 | setattr(self, var_name, var_value) 189 | return self 190 | 191 | required_properties = set( 192 | [ 193 | "_data_store", 194 | "_check_type", 195 | "_spec_property_naming", 196 | "_path_to_item", 197 | "_configuration", 198 | "_visited_composed_classes", 199 | ] 200 | ) 201 | 202 | @convert_js_args_to_python_args 203 | def __init__(self, *args, **kwargs): # noqa: E501 204 | """ResponseDocsInnerRapexInformation - a model defined in OpenAPI 205 | 206 | Keyword Args: 207 | _check_type (bool): if True, values for parameters in openapi_types 208 | will be type checked and a TypeError will be 209 | raised if the wrong type is input. 210 | Defaults to True 211 | _path_to_item (tuple/list): This is a list of keys or values to 212 | drill down to the model in received_data 213 | when deserializing a response 214 | _spec_property_naming (bool): True if the variable names in the input data 215 | are serialized names, as specified in the OpenAPI document. 216 | False if the variable names in the input data 217 | are pythonic names, e.g. snake case (default) 218 | _configuration (Configuration): the instance to use when 219 | deserializing a file_type parameter. 220 | If passed, type conversion is attempted 221 | If omitted no type conversion is done. 222 | _visited_composed_classes (tuple): This stores a tuple of 223 | classes that we have traveled through so that 224 | if we see that class again we will not use its 225 | discriminator again. 226 | When traveling through a discriminator, the 227 | composed schema that is 228 | is traveled through is added to this set. 229 | For example if Animal has a discriminator 230 | petType and we pass in "Dog", and the class Dog 231 | allOf includes Animal, we move through Animal 232 | once using the discriminator, and pick Dog. 233 | Then in Dog, we will make an instance of the 234 | Animal class but this time we won't travel 235 | through its discriminator because we passed in 236 | _visited_composed_classes = (Animal,) 237 | alert_number (str): [optional] # noqa: E501 238 | message (str): [optional] # noqa: E501 239 | """ 240 | 241 | _check_type = kwargs.pop("_check_type", True) 242 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 243 | _path_to_item = kwargs.pop("_path_to_item", ()) 244 | _configuration = kwargs.pop("_configuration", None) 245 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 246 | 247 | if args: 248 | for arg in args: 249 | if isinstance(arg, dict): 250 | kwargs.update(arg) 251 | else: 252 | raise ApiTypeError( 253 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 254 | % ( 255 | args, 256 | self.__class__.__name__, 257 | ), 258 | path_to_item=_path_to_item, 259 | valid_classes=(self.__class__,), 260 | ) 261 | 262 | self._data_store = {} 263 | self._check_type = _check_type 264 | self._spec_property_naming = _spec_property_naming 265 | self._path_to_item = _path_to_item 266 | self._configuration = _configuration 267 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 268 | 269 | for var_name, var_value in kwargs.items(): 270 | if ( 271 | var_name not in self.attribute_map 272 | and self._configuration is not None 273 | and self._configuration.discard_unknown_keys 274 | and self.additional_properties_type is None 275 | ): 276 | # discard variable. 277 | continue 278 | setattr(self, var_name, var_value) 279 | if var_name in self.read_only_vars: 280 | raise ApiAttributeError( 281 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 282 | f"class with read only attributes." 283 | ) 284 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/model/response_docs_inner_safety_information.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import re # noqa: F401 13 | import sys # noqa: F401 14 | 15 | from deutschland.lebensmittelwarnung.exceptions import ApiAttributeError 16 | from deutschland.lebensmittelwarnung.model_utils import ( # noqa: F401 17 | ApiTypeError, 18 | ModelComposed, 19 | ModelNormal, 20 | ModelSimple, 21 | OpenApiModel, 22 | cached_property, 23 | change_keys_js_to_python, 24 | convert_js_args_to_python_args, 25 | date, 26 | datetime, 27 | file_type, 28 | none_type, 29 | validate_get_composed_info, 30 | ) 31 | 32 | 33 | class ResponseDocsInnerSafetyInformation(ModelNormal): 34 | """NOTE: This class is auto generated by OpenAPI Generator. 35 | Ref: https://openapi-generator.tech 36 | 37 | Do not edit the class manually. 38 | 39 | Attributes: 40 | allowed_values (dict): The key is the tuple path to the attribute 41 | and the for var_name this is (var_name,). The value is a dict 42 | with a capitalized key describing the allowed value and an allowed 43 | value. These dicts store the allowed enum values. 44 | attribute_map (dict): The key is attribute name 45 | and the value is json key in definition. 46 | discriminator_value_class_map (dict): A dict to go from the discriminator 47 | variable value to the discriminator class name. 48 | validations (dict): The key is the tuple path to the attribute 49 | and the for var_name this is (var_name,). The value is a dict 50 | that stores validations for max_length, min_length, max_items, 51 | min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, 52 | inclusive_minimum, and regex. 53 | additional_properties_type (tuple): A tuple of classes accepted 54 | as additional properties values. 55 | """ 56 | 57 | allowed_values = {} 58 | 59 | validations = {} 60 | 61 | @cached_property 62 | def additional_properties_type(): 63 | """ 64 | This must be a method because a model may have properties that are 65 | of type self, this must run after the class is loaded 66 | """ 67 | return ( 68 | bool, 69 | date, 70 | datetime, 71 | dict, 72 | float, 73 | int, 74 | list, 75 | str, 76 | none_type, 77 | ) # noqa: E501 78 | 79 | _nullable = False 80 | 81 | @cached_property 82 | def openapi_types(): 83 | """ 84 | This must be a method because a model may have properties that are 85 | of type self, this must run after the class is loaded 86 | 87 | Returns 88 | openapi_types (dict): The key is attribute name 89 | and the value is attribute type. 90 | """ 91 | return { 92 | "ordinance": (str,), # noqa: E501 93 | } 94 | 95 | @cached_property 96 | def discriminator(): 97 | return None 98 | 99 | attribute_map = { 100 | "ordinance": "ordinance", # noqa: E501 101 | } 102 | 103 | read_only_vars = {} 104 | 105 | _composed_schemas = {} 106 | 107 | @classmethod 108 | @convert_js_args_to_python_args 109 | def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 110 | """ResponseDocsInnerSafetyInformation - a model defined in OpenAPI 111 | 112 | Keyword Args: 113 | _check_type (bool): if True, values for parameters in openapi_types 114 | will be type checked and a TypeError will be 115 | raised if the wrong type is input. 116 | Defaults to True 117 | _path_to_item (tuple/list): This is a list of keys or values to 118 | drill down to the model in received_data 119 | when deserializing a response 120 | _spec_property_naming (bool): True if the variable names in the input data 121 | are serialized names, as specified in the OpenAPI document. 122 | False if the variable names in the input data 123 | are pythonic names, e.g. snake case (default) 124 | _configuration (Configuration): the instance to use when 125 | deserializing a file_type parameter. 126 | If passed, type conversion is attempted 127 | If omitted no type conversion is done. 128 | _visited_composed_classes (tuple): This stores a tuple of 129 | classes that we have traveled through so that 130 | if we see that class again we will not use its 131 | discriminator again. 132 | When traveling through a discriminator, the 133 | composed schema that is 134 | is traveled through is added to this set. 135 | For example if Animal has a discriminator 136 | petType and we pass in "Dog", and the class Dog 137 | allOf includes Animal, we move through Animal 138 | once using the discriminator, and pick Dog. 139 | Then in Dog, we will make an instance of the 140 | Animal class but this time we won't travel 141 | through its discriminator because we passed in 142 | _visited_composed_classes = (Animal,) 143 | ordinance (str): [optional] # noqa: E501 144 | """ 145 | 146 | _check_type = kwargs.pop("_check_type", True) 147 | _spec_property_naming = kwargs.pop("_spec_property_naming", True) 148 | _path_to_item = kwargs.pop("_path_to_item", ()) 149 | _configuration = kwargs.pop("_configuration", None) 150 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 151 | 152 | self = super(OpenApiModel, cls).__new__(cls) 153 | 154 | if args: 155 | for arg in args: 156 | if isinstance(arg, dict): 157 | kwargs.update(arg) 158 | else: 159 | raise ApiTypeError( 160 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 161 | % ( 162 | args, 163 | self.__class__.__name__, 164 | ), 165 | path_to_item=_path_to_item, 166 | valid_classes=(self.__class__,), 167 | ) 168 | 169 | self._data_store = {} 170 | self._check_type = _check_type 171 | self._spec_property_naming = _spec_property_naming 172 | self._path_to_item = _path_to_item 173 | self._configuration = _configuration 174 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 175 | 176 | for var_name, var_value in kwargs.items(): 177 | if ( 178 | var_name not in self.attribute_map 179 | and self._configuration is not None 180 | and self._configuration.discard_unknown_keys 181 | and self.additional_properties_type is None 182 | ): 183 | # discard variable. 184 | continue 185 | setattr(self, var_name, var_value) 186 | return self 187 | 188 | required_properties = set( 189 | [ 190 | "_data_store", 191 | "_check_type", 192 | "_spec_property_naming", 193 | "_path_to_item", 194 | "_configuration", 195 | "_visited_composed_classes", 196 | ] 197 | ) 198 | 199 | @convert_js_args_to_python_args 200 | def __init__(self, *args, **kwargs): # noqa: E501 201 | """ResponseDocsInnerSafetyInformation - a model defined in OpenAPI 202 | 203 | Keyword Args: 204 | _check_type (bool): if True, values for parameters in openapi_types 205 | will be type checked and a TypeError will be 206 | raised if the wrong type is input. 207 | Defaults to True 208 | _path_to_item (tuple/list): This is a list of keys or values to 209 | drill down to the model in received_data 210 | when deserializing a response 211 | _spec_property_naming (bool): True if the variable names in the input data 212 | are serialized names, as specified in the OpenAPI document. 213 | False if the variable names in the input data 214 | are pythonic names, e.g. snake case (default) 215 | _configuration (Configuration): the instance to use when 216 | deserializing a file_type parameter. 217 | If passed, type conversion is attempted 218 | If omitted no type conversion is done. 219 | _visited_composed_classes (tuple): This stores a tuple of 220 | classes that we have traveled through so that 221 | if we see that class again we will not use its 222 | discriminator again. 223 | When traveling through a discriminator, the 224 | composed schema that is 225 | is traveled through is added to this set. 226 | For example if Animal has a discriminator 227 | petType and we pass in "Dog", and the class Dog 228 | allOf includes Animal, we move through Animal 229 | once using the discriminator, and pick Dog. 230 | Then in Dog, we will make an instance of the 231 | Animal class but this time we won't travel 232 | through its discriminator because we passed in 233 | _visited_composed_classes = (Animal,) 234 | ordinance (str): [optional] # noqa: E501 235 | """ 236 | 237 | _check_type = kwargs.pop("_check_type", True) 238 | _spec_property_naming = kwargs.pop("_spec_property_naming", False) 239 | _path_to_item = kwargs.pop("_path_to_item", ()) 240 | _configuration = kwargs.pop("_configuration", None) 241 | _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) 242 | 243 | if args: 244 | for arg in args: 245 | if isinstance(arg, dict): 246 | kwargs.update(arg) 247 | else: 248 | raise ApiTypeError( 249 | "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." 250 | % ( 251 | args, 252 | self.__class__.__name__, 253 | ), 254 | path_to_item=_path_to_item, 255 | valid_classes=(self.__class__,), 256 | ) 257 | 258 | self._data_store = {} 259 | self._check_type = _check_type 260 | self._spec_property_naming = _spec_property_naming 261 | self._path_to_item = _path_to_item 262 | self._configuration = _configuration 263 | self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 264 | 265 | for var_name, var_value in kwargs.items(): 266 | if ( 267 | var_name not in self.attribute_map 268 | and self._configuration is not None 269 | and self._configuration.discard_unknown_keys 270 | and self.additional_properties_type is None 271 | ): 272 | # discard variable. 273 | continue 274 | setattr(self, var_name, var_value) 275 | if var_name in self.read_only_vars: 276 | raise ApiAttributeError( 277 | f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " 278 | f"class with read only attributes." 279 | ) 280 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/models/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | 3 | # import all models into this package 4 | # if you have many models here with many references from one model to another this may 5 | # raise a RecursionError 6 | # to avoid this, import only the models that you directly need like: 7 | # from from deutschland.lebensmittelwarnung.model.pet import Pet 8 | # or import this package, but before doing it, use: 9 | # import sys 10 | # sys.setrecursionlimit(n) 11 | 12 | from deutschland.lebensmittelwarnung.model.list_warnungen_request import ( 13 | ListWarnungenRequest, 14 | ) 15 | from deutschland.lebensmittelwarnung.model.request_options import RequestOptions 16 | from deutschland.lebensmittelwarnung.model.response import Response 17 | from deutschland.lebensmittelwarnung.model.response_docs_inner import ResponseDocsInner 18 | from deutschland.lebensmittelwarnung.model.response_docs_inner_product import ( 19 | ResponseDocsInnerProduct, 20 | ) 21 | from deutschland.lebensmittelwarnung.model.response_docs_inner_rapex_information import ( 22 | ResponseDocsInnerRapexInformation, 23 | ) 24 | from deutschland.lebensmittelwarnung.model.response_docs_inner_safety_information import ( 25 | ResponseDocsInnerSafetyInformation, 26 | ) 27 | -------------------------------------------------------------------------------- /python-client/deutschland/lebensmittelwarnung/rest.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import io 13 | import ipaddress 14 | import json 15 | import logging 16 | import re 17 | import ssl 18 | from urllib.parse import urlencode, urlparse 19 | from urllib.request import proxy_bypass_environment 20 | 21 | import urllib3 22 | from deutschland.lebensmittelwarnung.exceptions import ( 23 | ApiException, 24 | ApiValueError, 25 | ForbiddenException, 26 | NotFoundException, 27 | ServiceException, 28 | UnauthorizedException, 29 | ) 30 | 31 | logger = logging.getLogger(__name__) 32 | 33 | 34 | class RESTResponse(io.IOBase): 35 | def __init__(self, resp): 36 | self.urllib3_response = resp 37 | self.status = resp.status 38 | self.reason = resp.reason 39 | self.data = resp.data 40 | 41 | def getheaders(self): 42 | """Returns a dictionary of the response headers.""" 43 | return self.urllib3_response.getheaders() 44 | 45 | def getheader(self, name, default=None): 46 | """Returns a given response header.""" 47 | return self.urllib3_response.getheader(name, default) 48 | 49 | 50 | class RESTClientObject(object): 51 | def __init__(self, configuration, pools_size=4, maxsize=None): 52 | # urllib3.PoolManager will pass all kw parameters to connectionpool 53 | # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 54 | # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 55 | # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 56 | # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 57 | 58 | # cert_reqs 59 | if configuration.verify_ssl: 60 | cert_reqs = ssl.CERT_REQUIRED 61 | else: 62 | cert_reqs = ssl.CERT_NONE 63 | 64 | addition_pool_args = {} 65 | if configuration.assert_hostname is not None: 66 | addition_pool_args[ 67 | "assert_hostname" 68 | ] = configuration.assert_hostname # noqa: E501 69 | 70 | if configuration.retries is not None: 71 | addition_pool_args["retries"] = configuration.retries 72 | 73 | if configuration.socket_options is not None: 74 | addition_pool_args["socket_options"] = configuration.socket_options 75 | 76 | if maxsize is None: 77 | if configuration.connection_pool_maxsize is not None: 78 | maxsize = configuration.connection_pool_maxsize 79 | else: 80 | maxsize = 4 81 | 82 | # https pool manager 83 | if configuration.proxy and not should_bypass_proxies( 84 | configuration.host, no_proxy=configuration.no_proxy or "" 85 | ): 86 | self.pool_manager = urllib3.ProxyManager( 87 | num_pools=pools_size, 88 | maxsize=maxsize, 89 | cert_reqs=cert_reqs, 90 | ca_certs=configuration.ssl_ca_cert, 91 | cert_file=configuration.cert_file, 92 | key_file=configuration.key_file, 93 | proxy_url=configuration.proxy, 94 | proxy_headers=configuration.proxy_headers, 95 | **addition_pool_args 96 | ) 97 | else: 98 | self.pool_manager = urllib3.PoolManager( 99 | num_pools=pools_size, 100 | maxsize=maxsize, 101 | cert_reqs=cert_reqs, 102 | ca_certs=configuration.ssl_ca_cert, 103 | cert_file=configuration.cert_file, 104 | key_file=configuration.key_file, 105 | **addition_pool_args 106 | ) 107 | 108 | def request( 109 | self, 110 | method, 111 | url, 112 | query_params=None, 113 | headers=None, 114 | body=None, 115 | post_params=None, 116 | _preload_content=True, 117 | _request_timeout=None, 118 | ): 119 | """Perform requests. 120 | 121 | :param method: http request method 122 | :param url: http request url 123 | :param query_params: query parameters in the url 124 | :param headers: http request headers 125 | :param body: request json body, for `application/json` 126 | :param post_params: request post parameters, 127 | `application/x-www-form-urlencoded` 128 | and `multipart/form-data` 129 | :param _preload_content: if False, the urllib3.HTTPResponse object will 130 | be returned without reading/decoding response 131 | data. Default is True. 132 | :param _request_timeout: timeout setting for this request. If one 133 | number provided, it will be total request 134 | timeout. It can also be a pair (tuple) of 135 | (connection, read) timeouts. 136 | """ 137 | method = method.upper() 138 | assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] 139 | 140 | if post_params and body: 141 | raise ApiValueError( 142 | "body parameter cannot be used with post_params parameter." 143 | ) 144 | 145 | post_params = post_params or {} 146 | headers = headers or {} 147 | 148 | timeout = None 149 | if _request_timeout: 150 | if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 151 | timeout = urllib3.Timeout(total=_request_timeout) 152 | elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: 153 | timeout = urllib3.Timeout( 154 | connect=_request_timeout[0], read=_request_timeout[1] 155 | ) 156 | 157 | try: 158 | # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` 159 | if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: 160 | # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests 161 | if (method != "DELETE") and ("Content-Type" not in headers): 162 | headers["Content-Type"] = "application/json" 163 | if query_params: 164 | url += "?" + urlencode(query_params) 165 | if ("Content-Type" not in headers) or ( 166 | re.search("json", headers["Content-Type"], re.IGNORECASE) 167 | ): 168 | request_body = None 169 | if body is not None: 170 | request_body = json.dumps(body) 171 | r = self.pool_manager.request( 172 | method, 173 | url, 174 | body=request_body, 175 | preload_content=_preload_content, 176 | timeout=timeout, 177 | headers=headers, 178 | ) 179 | elif ( 180 | headers["Content-Type"] == "application/x-www-form-urlencoded" 181 | ): # noqa: E501 182 | r = self.pool_manager.request( 183 | method, 184 | url, 185 | fields=post_params, 186 | encode_multipart=False, 187 | preload_content=_preload_content, 188 | timeout=timeout, 189 | headers=headers, 190 | ) 191 | elif headers["Content-Type"] == "multipart/form-data": 192 | # must del headers['Content-Type'], or the correct 193 | # Content-Type which generated by urllib3 will be 194 | # overwritten. 195 | del headers["Content-Type"] 196 | r = self.pool_manager.request( 197 | method, 198 | url, 199 | fields=post_params, 200 | encode_multipart=True, 201 | preload_content=_preload_content, 202 | timeout=timeout, 203 | headers=headers, 204 | ) 205 | # Pass a `string` parameter directly in the body to support 206 | # other content types than Json when `body` argument is 207 | # provided in serialized form 208 | elif isinstance(body, str) or isinstance(body, bytes): 209 | request_body = body 210 | r = self.pool_manager.request( 211 | method, 212 | url, 213 | body=request_body, 214 | preload_content=_preload_content, 215 | timeout=timeout, 216 | headers=headers, 217 | ) 218 | else: 219 | # Cannot generate the request from given parameters 220 | msg = """Cannot prepare a request message for provided 221 | arguments. Please check that your arguments match 222 | declared content type.""" 223 | raise ApiException(status=0, reason=msg) 224 | # For `GET`, `HEAD` 225 | else: 226 | r = self.pool_manager.request( 227 | method, 228 | url, 229 | fields=query_params, 230 | preload_content=_preload_content, 231 | timeout=timeout, 232 | headers=headers, 233 | ) 234 | except urllib3.exceptions.SSLError as e: 235 | msg = "{0}\n{1}".format(type(e).__name__, str(e)) 236 | raise ApiException(status=0, reason=msg) 237 | 238 | if _preload_content: 239 | r = RESTResponse(r) 240 | 241 | # log response body 242 | logger.debug("response body: %s", r.data) 243 | 244 | if not 200 <= r.status <= 299: 245 | if r.status == 401: 246 | raise UnauthorizedException(http_resp=r) 247 | 248 | if r.status == 403: 249 | raise ForbiddenException(http_resp=r) 250 | 251 | if r.status == 404: 252 | raise NotFoundException(http_resp=r) 253 | 254 | if 500 <= r.status <= 599: 255 | raise ServiceException(http_resp=r) 256 | 257 | raise ApiException(http_resp=r) 258 | 259 | return r 260 | 261 | def GET( 262 | self, 263 | url, 264 | headers=None, 265 | query_params=None, 266 | _preload_content=True, 267 | _request_timeout=None, 268 | ): 269 | return self.request( 270 | "GET", 271 | url, 272 | headers=headers, 273 | _preload_content=_preload_content, 274 | _request_timeout=_request_timeout, 275 | query_params=query_params, 276 | ) 277 | 278 | def HEAD( 279 | self, 280 | url, 281 | headers=None, 282 | query_params=None, 283 | _preload_content=True, 284 | _request_timeout=None, 285 | ): 286 | return self.request( 287 | "HEAD", 288 | url, 289 | headers=headers, 290 | _preload_content=_preload_content, 291 | _request_timeout=_request_timeout, 292 | query_params=query_params, 293 | ) 294 | 295 | def OPTIONS( 296 | self, 297 | url, 298 | headers=None, 299 | query_params=None, 300 | post_params=None, 301 | body=None, 302 | _preload_content=True, 303 | _request_timeout=None, 304 | ): 305 | return self.request( 306 | "OPTIONS", 307 | url, 308 | headers=headers, 309 | query_params=query_params, 310 | post_params=post_params, 311 | _preload_content=_preload_content, 312 | _request_timeout=_request_timeout, 313 | body=body, 314 | ) 315 | 316 | def DELETE( 317 | self, 318 | url, 319 | headers=None, 320 | query_params=None, 321 | body=None, 322 | _preload_content=True, 323 | _request_timeout=None, 324 | ): 325 | return self.request( 326 | "DELETE", 327 | url, 328 | headers=headers, 329 | query_params=query_params, 330 | _preload_content=_preload_content, 331 | _request_timeout=_request_timeout, 332 | body=body, 333 | ) 334 | 335 | def POST( 336 | self, 337 | url, 338 | headers=None, 339 | query_params=None, 340 | post_params=None, 341 | body=None, 342 | _preload_content=True, 343 | _request_timeout=None, 344 | ): 345 | return self.request( 346 | "POST", 347 | url, 348 | headers=headers, 349 | query_params=query_params, 350 | post_params=post_params, 351 | _preload_content=_preload_content, 352 | _request_timeout=_request_timeout, 353 | body=body, 354 | ) 355 | 356 | def PUT( 357 | self, 358 | url, 359 | headers=None, 360 | query_params=None, 361 | post_params=None, 362 | body=None, 363 | _preload_content=True, 364 | _request_timeout=None, 365 | ): 366 | return self.request( 367 | "PUT", 368 | url, 369 | headers=headers, 370 | query_params=query_params, 371 | post_params=post_params, 372 | _preload_content=_preload_content, 373 | _request_timeout=_request_timeout, 374 | body=body, 375 | ) 376 | 377 | def PATCH( 378 | self, 379 | url, 380 | headers=None, 381 | query_params=None, 382 | post_params=None, 383 | body=None, 384 | _preload_content=True, 385 | _request_timeout=None, 386 | ): 387 | return self.request( 388 | "PATCH", 389 | url, 390 | headers=headers, 391 | query_params=query_params, 392 | post_params=post_params, 393 | _preload_content=_preload_content, 394 | _request_timeout=_request_timeout, 395 | body=body, 396 | ) 397 | 398 | 399 | # end of class RESTClientObject 400 | 401 | 402 | def is_ipv4(target): 403 | """Test if IPv4 address or not""" 404 | try: 405 | chk = ipaddress.IPv4Address(target) 406 | return True 407 | except ipaddress.AddressValueError: 408 | return False 409 | 410 | 411 | def in_ipv4net(target, net): 412 | """Test if target belongs to given IPv4 network""" 413 | try: 414 | nw = ipaddress.IPv4Network(net) 415 | ip = ipaddress.IPv4Address(target) 416 | if ip in nw: 417 | return True 418 | return False 419 | except ipaddress.AddressValueError: 420 | return False 421 | except ipaddress.NetmaskValueError: 422 | return False 423 | 424 | 425 | def should_bypass_proxies(url, no_proxy=None): 426 | """Yet another requests.should_bypass_proxies 427 | Test if proxies should not be used for a particular url. 428 | """ 429 | 430 | parsed = urlparse(url) 431 | 432 | # special cases 433 | if parsed.hostname in [None, ""]: 434 | return True 435 | 436 | # special cases 437 | if no_proxy in [None, ""]: 438 | return False 439 | if no_proxy == "*": 440 | return True 441 | 442 | no_proxy = no_proxy.lower().replace(" ", "") 443 | entries = (host for host in no_proxy.split(",") if host) 444 | 445 | if is_ipv4(parsed.hostname): 446 | for item in entries: 447 | if in_ipv4net(parsed.hostname, item): 448 | return True 449 | return proxy_bypass_environment(parsed.hostname, {"no": no_proxy}) 450 | -------------------------------------------------------------------------------- /python-client/docs/DefaultApi.md: -------------------------------------------------------------------------------- 1 | # lebensmittelwarnung.DefaultApi 2 | 3 | All URIs are relative to *https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**list_warnungen**](DefaultApi.md#list_warnungen) | **POST** /warnings/merged | Liste aller Lebensmittel und Produktwarnungen 8 | 9 | 10 | # **list_warnungen** 11 | > Response list_warnungen() 12 | 13 | Liste aller Lebensmittel und Produktwarnungen 14 | 15 | Gibt eine Liste aller Lebensmittel und Produktwarnungen zurück. 16 | 17 | ### Example 18 | 19 | * Api Key Authentication (ApiKeyAuth): 20 | 21 | ```python 22 | import time 23 | from deutschland import lebensmittelwarnung 24 | from deutschland.lebensmittelwarnung.api import default_api 25 | from deutschland.lebensmittelwarnung.model.list_warnungen_request import ListWarnungenRequest 26 | from deutschland.lebensmittelwarnung.model.response import Response 27 | from pprint import pprint 28 | # Defining the host is optional and defaults to https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api 29 | # See configuration.py for a list of all supported configuration parameters. 30 | configuration = lebensmittelwarnung.Configuration( 31 | host = "https://megov.bayern.de/verbraucherschutz/baystmuv-verbraucherinfo/rest/api" 32 | ) 33 | 34 | # The client must configure the authentication and authorization parameters 35 | # in accordance with the API server security policy. 36 | # Examples for each auth method are provided below, use the example that 37 | # satisfies your auth use case. 38 | 39 | # Configure API key authorization: ApiKeyAuth 40 | configuration.api_key['ApiKeyAuth'] = 'YOUR_API_KEY' 41 | 42 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 43 | # configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer' 44 | 45 | # Enter a context with an instance of the API client 46 | with lebensmittelwarnung.ApiClient(configuration) as api_client: 47 | # Create an instance of the API class 48 | api_instance = default_api.DefaultApi(api_client) 49 | list_warnungen_request = ListWarnungenRequest( 50 | food=RequestOptions( 51 | rows=500, 52 | sort="publishedDate desc, title asc", 53 | start=11, 54 | fq=["publishedDate > 1630067654000"], 55 | ), 56 | products=RequestOptions( 57 | rows=500, 58 | sort="publishedDate desc, title asc", 59 | start=11, 60 | fq=["publishedDate > 1630067654000"], 61 | ), 62 | ) # ListWarnungenRequest | (optional) 63 | 64 | # example passing only required values which don't have defaults set 65 | # and optional values 66 | try: 67 | # Liste aller Lebensmittel und Produktwarnungen 68 | api_response = api_instance.list_warnungen(list_warnungen_request=list_warnungen_request) 69 | pprint(api_response) 70 | except lebensmittelwarnung.ApiException as e: 71 | print("Exception when calling DefaultApi->list_warnungen: %s\n" % e) 72 | ``` 73 | 74 | 75 | ### Parameters 76 | 77 | Name | Type | Description | Notes 78 | ------------- | ------------- | ------------- | ------------- 79 | **list_warnungen_request** | [**ListWarnungenRequest**](ListWarnungenRequest.md)| | [optional] 80 | 81 | ### Return type 82 | 83 | [**Response**](Response.md) 84 | 85 | ### Authorization 86 | 87 | [ApiKeyAuth](../README.md#ApiKeyAuth) 88 | 89 | ### HTTP request headers 90 | 91 | - **Content-Type**: application/json 92 | - **Accept**: application/json 93 | 94 | 95 | ### HTTP response details 96 | 97 | | Status code | Description | Response headers | 98 | |-------------|-------------|------------------| 99 | **200** | Success | - | 100 | 101 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) 102 | 103 | -------------------------------------------------------------------------------- /python-client/docs/ListWarnungenRequest.md: -------------------------------------------------------------------------------- 1 | # ListWarnungenRequest 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **food** | [**RequestOptions**](RequestOptions.md) | | [optional] 8 | **products** | [**RequestOptions**](RequestOptions.md) | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /python-client/docs/RequestOptions.md: -------------------------------------------------------------------------------- 1 | # RequestOptions 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **rows** | **int** | Anzahl zu ladender Einträge | [optional] 8 | **sort** | **str** | | [optional] 9 | **start** | **int** | Start-Index der zu ladenden Einträge | [optional] 10 | **fq** | **[str]** | | [optional] 11 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 12 | 13 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 14 | 15 | 16 | -------------------------------------------------------------------------------- /python-client/docs/Response.md: -------------------------------------------------------------------------------- 1 | # Response 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **docs** | [**[ResponseDocsInner]**](ResponseDocsInner.md) | | [optional] 8 | **num_found** | **int** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /python-client/docs/ResponseDocsInner.md: -------------------------------------------------------------------------------- 1 | # ResponseDocsInner 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **type** | **str** | | [optional] 8 | **archived** | **bool** | | [optional] 9 | **id** | **int** | | [optional] 10 | **link** | **str** | | [optional] 11 | **published_date** | **int** | | [optional] 12 | **title** | **str** | | [optional] 13 | **product** | [**ResponseDocsInnerProduct**](ResponseDocsInnerProduct.md) | | [optional] 14 | **rapex_information** | [**ResponseDocsInnerRapexInformation**](ResponseDocsInnerRapexInformation.md) | | [optional] 15 | **safety_information** | [**ResponseDocsInnerSafetyInformation**](ResponseDocsInnerSafetyInformation.md) | | [optional] 16 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 17 | 18 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 19 | 20 | 21 | -------------------------------------------------------------------------------- /python-client/docs/ResponseDocsInnerProduct.md: -------------------------------------------------------------------------------- 1 | # ResponseDocsInnerProduct 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **type** | **str** | | [optional] 8 | **designation** | **str** | | [optional] 9 | **image_urls** | **[str]** | | [optional] 10 | **manufacturer** | **str** | | [optional] 11 | **affected_products** | **str** | | [optional] 12 | **brand_name** | **str** | | [optional] 13 | **category** | **str** | | [optional] 14 | **country_of_origin** | **str** | | [optional] 15 | **model** | **str** | | [optional] 16 | **short_description** | **str** | | [optional] 17 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 18 | 19 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 20 | 21 | 22 | -------------------------------------------------------------------------------- /python-client/docs/ResponseDocsInnerRapexInformation.md: -------------------------------------------------------------------------------- 1 | # ResponseDocsInnerRapexInformation 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **alert_number** | **str** | | [optional] 8 | **message** | **str** | | [optional] 9 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 10 | 11 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 12 | 13 | 14 | -------------------------------------------------------------------------------- /python-client/docs/ResponseDocsInnerSafetyInformation.md: -------------------------------------------------------------------------------- 1 | # ResponseDocsInnerSafetyInformation 2 | 3 | 4 | ## Properties 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **ordinance** | **str** | | [optional] 8 | **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] 9 | 10 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 11 | 12 | 13 | -------------------------------------------------------------------------------- /python-client/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool] 2 | [tool.poetry] 3 | name = "de-lebensmittelwarnung" 4 | version = "0.1.0" 5 | description = "Lebensmittelwarnungen API" 6 | keywords = ["OpenAPI", "OpenAPI-Generator", "lebensmittelwarnung", "App", "API"] 7 | homepage = "https://github.com/bundesAPI/lebensmittelwarnung-api" 8 | authors = ["BundesAPI "] 9 | packages = [ 10 | { include = "deutschland"} 11 | ] 12 | license = "Apache-2.0" 13 | readme = "README.md" 14 | 15 | [tool.poetry.dependencies] 16 | python = ">=3.6" 17 | python-dateutil = "*" 18 | urllib3 = ">=1.25.3" 19 | 20 | [tool.poetry.urls] 21 | "Bug Tracker" = "https://github.com/bundesAPI/lebensmittelwarnung-api/issues" 22 | 23 | [tool.poetry.dev-dependencies] 24 | black = "^21.7b0" 25 | pytest = "^6.2.4" 26 | 27 | 28 | [build-system] 29 | requires = ["poetry-core>=1.0.0"] 30 | build-backend = "poetry.core.masonry.api" 31 | 32 | -------------------------------------------------------------------------------- /python-client/requirements.txt: -------------------------------------------------------------------------------- 1 | python_dateutil >= 2.5.3 2 | setuptools >= 59.0.0 3 | urllib3 >= 1.25.3 4 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/conf.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | sys.path.insert(0, os.path.abspath("../")) 5 | # Configuration file for the Sphinx documentation builder. 6 | # 7 | # This file only contains a selection of the most common options. For a full 8 | # list see the documentation: 9 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 10 | 11 | # -- Path setup -------------------------------------------------------------- 12 | 13 | # If extensions (or modules to document with autodoc) are in another directory, 14 | # add these directories to sys.path here. If the directory is relative to the 15 | # documentation root, use os.path.abspath to make it absolute, like shown here. 16 | # 17 | # import os 18 | # import sys 19 | # sys.path.insert(0, os.path.abspath('.')) 20 | 21 | 22 | # -- Project information ----------------------------------------------------- 23 | 24 | project = "lebensmittelwarnung-api" 25 | copyright = "2022, BundesAPI" 26 | author = "BundesAPI" 27 | 28 | # The short X.Y version 29 | version = "0.1.0" 30 | 31 | # The full version, including alpha/beta/rc tags 32 | release = "0.1.0" 33 | 34 | 35 | # -- General configuration --------------------------------------------------- 36 | 37 | # Add any Sphinx extension module names here, as strings. They can be 38 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 39 | # ones. 40 | extensions = [ 41 | "m2r2", 42 | "sphinx.ext.autodoc", 43 | "sphinx.ext.napoleon", 44 | "sphinx.ext.autosummary", 45 | ] 46 | 47 | # Add any paths that contain templates here, relative to this directory. 48 | templates_path = ["_templates"] 49 | 50 | # The language for content autogenerated by Sphinx. Refer to documentation 51 | # for a list of supported languages. 52 | # 53 | # This is also used if you do content translation via gettext catalogs. 54 | # Usually you set "language" from the command line for these cases. 55 | language = "de" 56 | 57 | # List of patterns, relative to source directory, that match files and 58 | # directories to ignore when looking for source files. 59 | # This pattern also affects html_static_path and html_extra_path. 60 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] 61 | 62 | 63 | # -- Options for HTML output ------------------------------------------------- 64 | 65 | # The theme to use for HTML and HTML Help pages. See the documentation for 66 | # a list of builtin themes. 67 | # 68 | html_theme = "alabaster" 69 | 70 | # Add any paths that contain custom static files (such as style sheets) here, 71 | # relative to this directory. They are copied after the builtin static files, 72 | # so a file named "default.css" will overwrite the builtin "default.css". 73 | html_static_path = ["_static"] 74 | 75 | 76 | # -- Extension configuration ------------------------------------------------- 77 | source_extensions = [".rst", ".md"] 78 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/index.rst: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung-api Documentation 2 | ===================================== 3 | 4 | .. toctree:: 5 | :glob: 6 | 7 | source/* 8 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=. 11 | set BUILDDIR=_build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/source/lebensmittelwarnung.api.rst: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung.api package 2 | =============================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | lebensmittelwarnung.api.default\_api module 8 | ------------------------------------------- 9 | 10 | .. automodule:: lebensmittelwarnung.api.default_api 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | Module contents 16 | --------------- 17 | 18 | .. automodule:: lebensmittelwarnung.api 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/source/lebensmittelwarnung.apis.rst: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung.apis package 2 | ================================ 3 | 4 | Module contents 5 | --------------- 6 | 7 | .. automodule:: lebensmittelwarnung.apis 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/source/lebensmittelwarnung.model.rst: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung.model package 2 | ================================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | lebensmittelwarnung.model.list\_warnungen\_request module 8 | --------------------------------------------------------- 9 | 10 | .. automodule:: lebensmittelwarnung.model.list_warnungen_request 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | lebensmittelwarnung.model.request\_options module 16 | ------------------------------------------------- 17 | 18 | .. automodule:: lebensmittelwarnung.model.request_options 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | lebensmittelwarnung.model.response module 24 | ----------------------------------------- 25 | 26 | .. automodule:: lebensmittelwarnung.model.response 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | lebensmittelwarnung.model.response\_docs\_inner module 32 | ------------------------------------------------------ 33 | 34 | .. automodule:: lebensmittelwarnung.model.response_docs_inner 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | lebensmittelwarnung.model.response\_docs\_inner\_product module 40 | --------------------------------------------------------------- 41 | 42 | .. automodule:: lebensmittelwarnung.model.response_docs_inner_product 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | lebensmittelwarnung.model.response\_docs\_inner\_rapex\_information module 48 | -------------------------------------------------------------------------- 49 | 50 | .. automodule:: lebensmittelwarnung.model.response_docs_inner_rapex_information 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | lebensmittelwarnung.model.response\_docs\_inner\_safety\_information module 56 | --------------------------------------------------------------------------- 57 | 58 | .. automodule:: lebensmittelwarnung.model.response_docs_inner_safety_information 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | Module contents 64 | --------------- 65 | 66 | .. automodule:: lebensmittelwarnung.model 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/source/lebensmittelwarnung.models.rst: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung.models package 2 | ================================== 3 | 4 | Module contents 5 | --------------- 6 | 7 | .. automodule:: lebensmittelwarnung.models 8 | :members: 9 | :undoc-members: 10 | :show-inheritance: 11 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/source/lebensmittelwarnung.rst: -------------------------------------------------------------------------------- 1 | lebensmittelwarnung package 2 | =========================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | lebensmittelwarnung.api 11 | lebensmittelwarnung.apis 12 | lebensmittelwarnung.model 13 | lebensmittelwarnung.models 14 | 15 | Submodules 16 | ---------- 17 | 18 | lebensmittelwarnung.api\_client module 19 | -------------------------------------- 20 | 21 | .. automodule:: lebensmittelwarnung.api_client 22 | :members: 23 | :undoc-members: 24 | :show-inheritance: 25 | 26 | lebensmittelwarnung.configuration module 27 | ---------------------------------------- 28 | 29 | .. automodule:: lebensmittelwarnung.configuration 30 | :members: 31 | :undoc-members: 32 | :show-inheritance: 33 | 34 | lebensmittelwarnung.exceptions module 35 | ------------------------------------- 36 | 37 | .. automodule:: lebensmittelwarnung.exceptions 38 | :members: 39 | :undoc-members: 40 | :show-inheritance: 41 | 42 | lebensmittelwarnung.model\_utils module 43 | --------------------------------------- 44 | 45 | .. automodule:: lebensmittelwarnung.model_utils 46 | :members: 47 | :undoc-members: 48 | :show-inheritance: 49 | 50 | lebensmittelwarnung.rest module 51 | ------------------------------- 52 | 53 | .. automodule:: lebensmittelwarnung.rest 54 | :members: 55 | :undoc-members: 56 | :show-inheritance: 57 | 58 | Module contents 59 | --------------- 60 | 61 | .. automodule:: lebensmittelwarnung 62 | :members: 63 | :undoc-members: 64 | :show-inheritance: 65 | -------------------------------------------------------------------------------- /python-client/sphinx-docs/source/modules.rst: -------------------------------------------------------------------------------- 1 | deutschland 2 | =========== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | lebensmittelwarnung 8 | -------------------------------------------------------------------------------- /python-client/test-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest-cov>=2.8.1 2 | -------------------------------------------------------------------------------- /python-client/test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bundesAPI/lebensmittelwarnung-api/cc597ac11beae02dc71051a317f542d9b289904c/python-client/test/__init__.py -------------------------------------------------------------------------------- /python-client/test/test_default_api.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import unittest 13 | 14 | from deutschland.lebensmittelwarnung.api.default_api import DefaultApi # noqa: E501 15 | 16 | from deutschland import lebensmittelwarnung 17 | 18 | 19 | class TestDefaultApi(unittest.TestCase): 20 | """DefaultApi unit test stubs""" 21 | 22 | def setUp(self): 23 | self.api = DefaultApi() # noqa: E501 24 | 25 | def tearDown(self): 26 | pass 27 | 28 | def test_list_warnungen(self): 29 | """Test case for list_warnungen 30 | 31 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 32 | """ 33 | pass 34 | 35 | 36 | if __name__ == "__main__": 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /python-client/test/test_list_warnungen_request.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.request_options import RequestOptions 16 | 17 | from deutschland import lebensmittelwarnung 18 | 19 | globals()["RequestOptions"] = RequestOptions 20 | from deutschland.lebensmittelwarnung.model.list_warnungen_request import ( 21 | ListWarnungenRequest, 22 | ) 23 | 24 | 25 | class TestListWarnungenRequest(unittest.TestCase): 26 | """ListWarnungenRequest unit test stubs""" 27 | 28 | def setUp(self): 29 | pass 30 | 31 | def tearDown(self): 32 | pass 33 | 34 | def testListWarnungenRequest(self): 35 | """Test ListWarnungenRequest""" 36 | # FIXME: construct object with mandatory attributes with example values 37 | # model = ListWarnungenRequest() # noqa: E501 38 | pass 39 | 40 | 41 | if __name__ == "__main__": 42 | unittest.main() 43 | -------------------------------------------------------------------------------- /python-client/test/test_request_options.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.request_options import RequestOptions 16 | 17 | from deutschland import lebensmittelwarnung 18 | 19 | 20 | class TestRequestOptions(unittest.TestCase): 21 | """RequestOptions unit test stubs""" 22 | 23 | def setUp(self): 24 | pass 25 | 26 | def tearDown(self): 27 | pass 28 | 29 | def testRequestOptions(self): 30 | """Test RequestOptions""" 31 | # FIXME: construct object with mandatory attributes with example values 32 | # model = RequestOptions() # noqa: E501 33 | pass 34 | 35 | 36 | if __name__ == "__main__": 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /python-client/test/test_response.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.response_docs_inner import ResponseDocsInner 16 | 17 | from deutschland import lebensmittelwarnung 18 | 19 | globals()["ResponseDocsInner"] = ResponseDocsInner 20 | from deutschland.lebensmittelwarnung.model.response import Response 21 | 22 | 23 | class TestResponse(unittest.TestCase): 24 | """Response unit test stubs""" 25 | 26 | def setUp(self): 27 | pass 28 | 29 | def tearDown(self): 30 | pass 31 | 32 | def testResponse(self): 33 | """Test Response""" 34 | # FIXME: construct object with mandatory attributes with example values 35 | # model = Response() # noqa: E501 36 | pass 37 | 38 | 39 | if __name__ == "__main__": 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /python-client/test/test_response_docs_inner.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.response_docs_inner_product import ( 16 | ResponseDocsInnerProduct, 17 | ) 18 | from deutschland.lebensmittelwarnung.model.response_docs_inner_rapex_information import ( 19 | ResponseDocsInnerRapexInformation, 20 | ) 21 | from deutschland.lebensmittelwarnung.model.response_docs_inner_safety_information import ( 22 | ResponseDocsInnerSafetyInformation, 23 | ) 24 | 25 | from deutschland import lebensmittelwarnung 26 | 27 | globals()["ResponseDocsInnerProduct"] = ResponseDocsInnerProduct 28 | globals()["ResponseDocsInnerRapexInformation"] = ResponseDocsInnerRapexInformation 29 | globals()["ResponseDocsInnerSafetyInformation"] = ResponseDocsInnerSafetyInformation 30 | from deutschland.lebensmittelwarnung.model.response_docs_inner import ResponseDocsInner 31 | 32 | 33 | class TestResponseDocsInner(unittest.TestCase): 34 | """ResponseDocsInner unit test stubs""" 35 | 36 | def setUp(self): 37 | pass 38 | 39 | def tearDown(self): 40 | pass 41 | 42 | def testResponseDocsInner(self): 43 | """Test ResponseDocsInner""" 44 | # FIXME: construct object with mandatory attributes with example values 45 | # model = ResponseDocsInner() # noqa: E501 46 | pass 47 | 48 | 49 | if __name__ == "__main__": 50 | unittest.main() 51 | -------------------------------------------------------------------------------- /python-client/test/test_response_docs_inner_product.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.response_docs_inner_product import ( 16 | ResponseDocsInnerProduct, 17 | ) 18 | 19 | from deutschland import lebensmittelwarnung 20 | 21 | 22 | class TestResponseDocsInnerProduct(unittest.TestCase): 23 | """ResponseDocsInnerProduct unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testResponseDocsInnerProduct(self): 32 | """Test ResponseDocsInnerProduct""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = ResponseDocsInnerProduct() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == "__main__": 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /python-client/test/test_response_docs_inner_rapex_information.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.response_docs_inner_rapex_information import ( 16 | ResponseDocsInnerRapexInformation, 17 | ) 18 | 19 | from deutschland import lebensmittelwarnung 20 | 21 | 22 | class TestResponseDocsInnerRapexInformation(unittest.TestCase): 23 | """ResponseDocsInnerRapexInformation unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testResponseDocsInnerRapexInformation(self): 32 | """Test ResponseDocsInnerRapexInformation""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = ResponseDocsInnerRapexInformation() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == "__main__": 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /python-client/test/test_response_docs_inner_safety_information.py: -------------------------------------------------------------------------------- 1 | """ 2 | Lebensmittelwarnungen API 3 | 4 | Liste aller Lebensmittel und Produktwarnungen # noqa: E501 5 | 6 | The version of the OpenAPI document: 1.0.0 7 | Contact: kontakt@bund.dev 8 | Generated by: https://openapi-generator.tech 9 | """ 10 | 11 | 12 | import sys 13 | import unittest 14 | 15 | from deutschland.lebensmittelwarnung.model.response_docs_inner_safety_information import ( 16 | ResponseDocsInnerSafetyInformation, 17 | ) 18 | 19 | from deutschland import lebensmittelwarnung 20 | 21 | 22 | class TestResponseDocsInnerSafetyInformation(unittest.TestCase): 23 | """ResponseDocsInnerSafetyInformation unit test stubs""" 24 | 25 | def setUp(self): 26 | pass 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def testResponseDocsInnerSafetyInformation(self): 32 | """Test ResponseDocsInnerSafetyInformation""" 33 | # FIXME: construct object with mandatory attributes with example values 34 | # model = ResponseDocsInnerSafetyInformation() # noqa: E501 35 | pass 36 | 37 | 38 | if __name__ == "__main__": 39 | unittest.main() 40 | -------------------------------------------------------------------------------- /python-client/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | pytest --cov=lebensmittelwarnung 10 | --------------------------------------------------------------------------------