├── .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
└── bundestag
│ ├── __init__.py
│ ├── api
│ ├── __init__.py
│ └── default_api.py
│ ├── api_client.py
│ ├── apis
│ └── __init__.py
│ ├── configuration.py
│ ├── exceptions.py
│ ├── model
│ └── __init__.py
│ ├── model_utils.py
│ ├── models
│ └── __init__.py
│ └── rest.py
├── docs
└── DefaultApi.md
├── pyproject.toml
├── requirements.txt
├── sphinx-docs
├── Makefile
├── conf.py
├── index.rst
├── make.bat
└── source
│ ├── bundestag.api.rst
│ ├── bundestag.apis.rst
│ ├── bundestag.model.rst
│ ├── bundestag.models.rst
│ ├── bundestag.rst
│ └── modules.rst
├── test-requirements.txt
├── test
├── __init__.py
└── test_default_api.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 |
19 | # Runs a single command using the runners shell
20 | - name: "Lint file"
21 | uses: stoplightio/spectral-action@latest
22 | with:
23 | file_glob: "openapi.yaml"
24 |
25 | - name: "Generate deutschland code"
26 | uses: wirthual/deutschland-generator-action@latest
27 | with:
28 | openapi-file: ${{ github.workspace }}/openapi.yaml
29 | commit-to-git: true
30 | upload-to-pypi: true
31 | upload-to-testpypi: false
32 | pypi-token: ${{ secrets.PYPI_PRODUCTION }}
33 | testpypi-token: ${{ secrets.PYPI_TEST }}
34 | python-version: ${{ matrix.python-version }}
35 |
--------------------------------------------------------------------------------
/.github/workflows/openapi_check.yaml:
--------------------------------------------------------------------------------
1 | on:
2 | push:
3 | paths:
4 | - "openapi*.yaml"
5 | pull_request:
6 | paths:
7 | - "openapi*.yaml"
8 |
9 | jobs:
10 | openapi_check:
11 | name: "OpenAPI check"
12 | runs-on: ubuntu-latest
13 | steps:
14 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
15 | - uses: actions/checkout@v2
16 |
17 | # Create default .spectral.yaml file used for linting if its not existing already
18 | - name: "Create spectral file if it not exists"
19 | continue-on-error: true
20 | run: |
21 | set -C; echo "extends: spectral:oas" > .spectral.yaml
22 |
23 | # Run Spectral
24 | - uses: stoplightio/spectral-action@latest
25 | with:
26 | file_glob: openapi.yaml
27 | spectral_ruleset: .spectral.yaml
28 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | bundestag.api.bund.dev
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Bundestag API
2 |
3 | Bundestag: Live Informationen
4 |
5 |
6 | ## asAppV2NewsarticleXml
7 |
8 | **URL:** https://www.bundestag.de/blueprint/servlet/content/{ARTICLE_ID}/asAppV2NewsarticleXml
9 |
10 | Artikel Details
11 |
12 |
13 |
14 | ## speaker.xml
15 |
16 | **URL:** https://www.bundestag.de/static/appdata/plenum/v2/speaker.xml
17 |
18 | Aktuelle Sprecher*in
19 |
20 |
21 |
22 | ## conferences.xml
23 |
24 | **URL:** https://www.bundestag.de/static/appdata/plenum/v2/conferences.xml
25 |
26 | Sitzungstag übersicht
27 |
28 |
29 |
30 | ## index.xml
31 |
32 | **URL:** https://www.bundestag.de/xml/v2/ausschuesse/index.xml
33 |
34 | Übersicht über die Ausschüsse
35 |
36 |
37 |
38 | ## {AUSSCHUSS_ID}.xml
39 |
40 | **URL:** https://www.bundestag.de/xml/v2/ausschuesse/{AUSSCHUSS_ID}.xml
41 |
42 | Übersicht über die Ausschüsse
43 |
44 |
45 |
46 | ## index.xml
47 |
48 | **URL:** https://www.bundestag.de/xml/v2/mdb/index.xml
49 |
50 | Übersicht über alle MDBS
51 |
52 |
53 |
54 | ## {MDB_ID}.xml
55 |
56 | **URL:** https://www.bundestag.de/xml/v2/mdb/biografien/{MDB_ID}.xml
57 |
58 | Abruf Details eines MDBS
59 |
60 |
61 |
62 | ## feed_vod.xml
63 |
64 | **URL:** http://webtv.bundestag.de/iptv/player/macros/_x_s-144277506/bttv/mobile/feed_vod.xml
65 |
66 | Abruf eines Videos
67 |
68 |
69 | ## Beispiel
70 |
71 | ```bash
72 | result=$(curl -m 60 https://www.bundestag.de/xml/v2/ausschuesse/index.xml)
73 | ```
74 |
--------------------------------------------------------------------------------
/generator_config.yaml:
--------------------------------------------------------------------------------
1 | templateDir: deutschland_templates # For local use: ./local/deutschland_templates
2 | additionalProperties:
3 | packageName: "bundestag"
4 | infoName: "BundesAPI"
5 | infoEmail: "kontakt@bund.dev"
6 | packageVersion: 0.1.0
7 | packageUrl: "https://github.com/bundesAPI/bundestag-api"
8 | namespace: "deutschland"
9 | docLanguage: "de"
10 | gitHost: "github.com"
11 | gitUserId: "bundesAPI"
12 | gitRepoId: "bundestag-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 | Bundestag: Live Informationen - OpenAPI Documentation
8 |
9 |
10 |
11 |
12 |
13 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/openapi.yaml:
--------------------------------------------------------------------------------
1 | openapi: "3.0.0"
2 | info:
3 | description: "Bundestag Informationen API "
4 | version: "1.0.0"
5 | title: "Bundestag: Live Informationen"
6 |
7 | servers:
8 | - url: "https://www.bundestag.de/"
9 |
10 | paths:
11 | /blueprint/servlet/content/{ARTICLE_ID}/asAppV2NewsarticleXml:
12 | get:
13 | summary: Artikel Details
14 | responses:
15 | '200':
16 | description: OK
17 | content:
18 | application/xml:
19 | schema:
20 | type: string
21 | parameters:
22 | - in: path
23 | required: true
24 | name: ARTICLE_ID
25 | schema:
26 | type: integer
27 | description: ID des Nachrichtenbeitrags
28 | example: 849630
29 |
30 | /static/appdata/plenum/v2/speaker.xml:
31 | get:
32 | summary: "Aktuelle Sprecher*in"
33 | responses:
34 | '200':
35 | description: OK
36 | content:
37 | application/xml:
38 | schema:
39 | type: string
40 |
41 | /static/appdata/plenum/v2/conferences.xml:
42 | get:
43 | summary: "Sitzungstag übersicht"
44 | responses:
45 | '200':
46 | description: OK
47 | content:
48 | application/xml:
49 | schema:
50 | type: string
51 |
52 | /xml/v2/ausschuesse/index.xml:
53 | get:
54 | summary: "Übersicht über die Ausschüsse"
55 | responses:
56 | '200':
57 | description: OK
58 | content:
59 | application/xml:
60 | schema:
61 | type: string
62 |
63 | /xml/v2/ausschuesse/{AUSSCHUSS_ID}.xml:
64 | get:
65 | summary: "Übersicht über die Ausschüsse"
66 | responses:
67 | '200':
68 | description: OK
69 | content:
70 | application/xml:
71 | schema:
72 | type: string
73 | parameters:
74 | - in: path
75 | required: true
76 | name: AUSSCHUSS_ID
77 | schema:
78 | type: string
79 | description: ID des Ausschusses
80 | example: "a11"
81 |
82 |
83 | /xml/v2/mdb/index.xml:
84 | get:
85 | summary: "Übersicht über alle MDBS"
86 | responses:
87 | '200':
88 | description: OK
89 | content:
90 | application/xml:
91 | schema:
92 | type: string
93 |
94 | /xml/v2/mdb/biografien/{MDB_ID}.xml:
95 | get:
96 | summary: "Abruf Details eines MDBS"
97 | responses:
98 | '200':
99 | description: OK
100 | content:
101 | application/xml:
102 | schema:
103 | type: string
104 | parameters:
105 | - in: path
106 | required: true
107 | name: MDB_ID
108 | schema:
109 | type: integer
110 | description: ID des MDB
111 | example: 1769
112 |
113 |
114 | /iptv/player/macros/_x_s-144277506/bttv/mobile/feed_vod.xml:
115 | get:
116 | summary: "Abruf eines Videos"
117 | responses:
118 | '200':
119 | description: OK
120 | content:
121 | application/xml:
122 | schema:
123 | type: string
124 | parameters:
125 | - in: query
126 | required: true
127 | name: contentId
128 | schema:
129 | type: integer
130 | description: ID des MDB
131 | example: 7529016
132 | servers:
133 | - url: 'http://webtv.bundestag.de'
134 |
135 | components:
136 | schemas:
137 | Result:
138 | type: string
139 |
--------------------------------------------------------------------------------
/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 | bundestag/__init__.py
7 | bundestag/api/__init__.py
8 | bundestag/api/default_api.py
9 | bundestag/api_client.py
10 | bundestag/apis/__init__.py
11 | bundestag/configuration.py
12 | bundestag/exceptions.py
13 | bundestag/model/__init__.py
14 | bundestag/model_utils.py
15 | bundestag/models/__init__.py
16 | bundestag/rest.py
17 | create_doc.py
18 | docs/DefaultApi.md
19 | git_push.sh
20 | pyproject.toml
21 | rename_generated_code.py
22 | requirements.txt
23 | requirements.txt
24 | setup.cfg
25 | setup.py
26 | test-requirements.txt
27 | test/__init__.py
28 | test/test_default_api.py
29 | tox.ini
30 |
--------------------------------------------------------------------------------
/python-client/.openapi-generator/VERSION:
--------------------------------------------------------------------------------
1 | 6.1.0
--------------------------------------------------------------------------------
/python-client/README.md:
--------------------------------------------------------------------------------
1 | # bundestag
2 | Bundestag Informationen API
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[bundestag]
19 | ```
20 |
21 | ### poetry install
22 |
23 | ```sh
24 | poetry add deutschland -E bundestag
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 bundestag
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 bundestag
51 | from pprint import pprint
52 | from deutschland.bundestag.api import default_api
53 | # Defining the host is optional and defaults to https://www.bundestag.de
54 | # See configuration.py for a list of all supported configuration parameters.
55 | configuration = bundestag.Configuration(
56 | host = "https://www.bundestag.de"
57 | )
58 |
59 |
60 |
61 | # Enter a context with an instance of the API client
62 | with bundestag.ApiClient(configuration) as api_client:
63 | # Create an instance of the API class
64 | api_instance = default_api.DefaultApi(api_client)
65 | article_id = 849630 # int | ID des Nachrichtenbeitrags
66 |
67 | try:
68 | # Artikel Details
69 | api_response = api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(article_id)
70 | pprint(api_response)
71 | except bundestag.ApiException as e:
72 | print("Exception when calling DefaultApi->blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get: %s\n" % e)
73 | ```
74 |
75 | ## Documentation for API Endpoints
76 |
77 | All URIs are relative to *https://www.bundestag.de*
78 |
79 | Class | Method | HTTP request | Description
80 | ------------ | ------------- | ------------- | -------------
81 | *DefaultApi* | [**blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get**](docs/DefaultApi.md#blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get) | **GET** /blueprint/servlet/content/{ARTICLE_ID}/asAppV2NewsarticleXml | Artikel Details
82 | *DefaultApi* | [**iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get**](docs/DefaultApi.md#iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get) | **GET** /iptv/player/macros/_x_s-144277506/bttv/mobile/feed_vod.xml | Abruf eines Videos
83 | *DefaultApi* | [**static_appdata_plenum_v2_conferences_xml_get**](docs/DefaultApi.md#static_appdata_plenum_v2_conferences_xml_get) | **GET** /static/appdata/plenum/v2/conferences.xml | Sitzungstag übersicht
84 | *DefaultApi* | [**static_appdata_plenum_v2_speaker_xml_get**](docs/DefaultApi.md#static_appdata_plenum_v2_speaker_xml_get) | **GET** /static/appdata/plenum/v2/speaker.xml | Aktuelle Sprecher*in
85 | *DefaultApi* | [**xml_v2_ausschuesse_ausschussid_xml_get**](docs/DefaultApi.md#xml_v2_ausschuesse_ausschussid_xml_get) | **GET** /xml/v2/ausschuesse/{AUSSCHUSS_ID}.xml | Übersicht über die Ausschüsse
86 | *DefaultApi* | [**xml_v2_ausschuesse_index_xml_get**](docs/DefaultApi.md#xml_v2_ausschuesse_index_xml_get) | **GET** /xml/v2/ausschuesse/index.xml | Übersicht über die Ausschüsse
87 | *DefaultApi* | [**xml_v2_mdb_biografien_mdbid_xml_get**](docs/DefaultApi.md#xml_v2_mdb_biografien_mdbid_xml_get) | **GET** /xml/v2/mdb/biografien/{MDB_ID}.xml | Abruf Details eines MDBS
88 | *DefaultApi* | [**xml_v2_mdb_index_xml_get**](docs/DefaultApi.md#xml_v2_mdb_index_xml_get) | **GET** /xml/v2/mdb/index.xml | Übersicht über alle MDBS
89 |
90 |
91 | ## Documentation For Models
92 |
93 |
94 |
95 | ## Documentation For Authorization
96 |
97 | All endpoints do not require authorization.
98 |
99 | ## Author
100 |
101 | kontakt@bund.dev
102 |
103 |
104 | ## Notes for Large OpenAPI documents
105 | If the OpenAPI document is large, imports in bundestag.apis and bundestag.models may fail with a
106 | RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
107 |
108 | Solution 1:
109 | Use specific imports for apis and models like:
110 | - `from deutschland.bundestag.api.default_api import DefaultApi`
111 | - `from deutschland.bundestag.model.pet import Pet`
112 |
113 | Solution 2:
114 | Before importing the package, adjust the maximum recursion limit as shown below:
115 | ```
116 | import sys
117 | sys.setrecursionlimit(1500)
118 | from deutschland import bundestag
119 | from deutschland.bundestag.apis import *
120 | from deutschland.bundestag.models import *
121 | ```
122 |
123 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/__init__.py:
--------------------------------------------------------------------------------
1 | # flake8: noqa
2 |
3 | """
4 | Bundestag: Live Informationen
5 |
6 | Bundestag Informationen API # 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.bundestag.api_client import ApiClient
18 |
19 | # import Configuration
20 | from deutschland.bundestag.configuration import Configuration
21 |
22 | # import exceptions
23 | from deutschland.bundestag.exceptions import (
24 | ApiAttributeError,
25 | ApiException,
26 | ApiKeyError,
27 | ApiTypeError,
28 | ApiValueError,
29 | OpenApiException,
30 | )
31 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/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.bundestag.apis import DefaultApi
4 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/api/default_api.py:
--------------------------------------------------------------------------------
1 | """
2 | Bundestag: Live Informationen
3 |
4 | Bundestag Informationen API # 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.bundestag.api_client import ApiClient
16 | from deutschland.bundestag.api_client import Endpoint as _Endpoint
17 | from deutschland.bundestag.model_utils import ( # noqa: F401
18 | check_allowed_values,
19 | check_validations,
20 | date,
21 | datetime,
22 | file_type,
23 | none_type,
24 | validate_and_convert_types,
25 | )
26 |
27 |
28 | class DefaultApi(object):
29 | """NOTE: This class is auto generated by OpenAPI Generator
30 | Ref: https://openapi-generator.tech
31 |
32 | Do not edit the class manually.
33 | """
34 |
35 | def __init__(self, api_client=None):
36 | if api_client is None:
37 | api_client = ApiClient()
38 | self.api_client = api_client
39 | self.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get_endpoint = _Endpoint(
40 | settings={
41 | "response_type": (str,),
42 | "auth": [],
43 | "endpoint_path": "/blueprint/servlet/content/{ARTICLE_ID}/asAppV2NewsarticleXml",
44 | "operation_id": "blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get",
45 | "http_method": "GET",
46 | "servers": None,
47 | },
48 | params_map={
49 | "all": [
50 | "article_id",
51 | ],
52 | "required": [
53 | "article_id",
54 | ],
55 | "nullable": [],
56 | "enum": [],
57 | "validation": [],
58 | },
59 | root_map={
60 | "validations": {},
61 | "allowed_values": {},
62 | "openapi_types": {
63 | "article_id": (int,),
64 | },
65 | "attribute_map": {
66 | "article_id": "ARTICLE_ID",
67 | },
68 | "location_map": {
69 | "article_id": "path",
70 | },
71 | "collection_format_map": {},
72 | },
73 | headers_map={
74 | "accept": ["application/xml"],
75 | "content_type": [],
76 | },
77 | api_client=api_client,
78 | )
79 | self.iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get_endpoint = _Endpoint(
80 | settings={
81 | "response_type": (str,),
82 | "auth": [],
83 | "endpoint_path": "/iptv/player/macros/_x_s-144277506/bttv/mobile/feed_vod.xml",
84 | "operation_id": "iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get",
85 | "http_method": "GET",
86 | "servers": [
87 | {
88 | "url": "http://webtv.bundestag.de",
89 | "description": "No description provided",
90 | },
91 | ],
92 | },
93 | params_map={
94 | "all": [
95 | "content_id",
96 | ],
97 | "required": [
98 | "content_id",
99 | ],
100 | "nullable": [],
101 | "enum": [],
102 | "validation": [],
103 | },
104 | root_map={
105 | "validations": {},
106 | "allowed_values": {},
107 | "openapi_types": {
108 | "content_id": (int,),
109 | },
110 | "attribute_map": {
111 | "content_id": "contentId",
112 | },
113 | "location_map": {
114 | "content_id": "query",
115 | },
116 | "collection_format_map": {},
117 | },
118 | headers_map={
119 | "accept": ["application/xml"],
120 | "content_type": [],
121 | },
122 | api_client=api_client,
123 | )
124 | self.static_appdata_plenum_v2_conferences_xml_get_endpoint = _Endpoint(
125 | settings={
126 | "response_type": (str,),
127 | "auth": [],
128 | "endpoint_path": "/static/appdata/plenum/v2/conferences.xml",
129 | "operation_id": "static_appdata_plenum_v2_conferences_xml_get",
130 | "http_method": "GET",
131 | "servers": None,
132 | },
133 | params_map={
134 | "all": [],
135 | "required": [],
136 | "nullable": [],
137 | "enum": [],
138 | "validation": [],
139 | },
140 | root_map={
141 | "validations": {},
142 | "allowed_values": {},
143 | "openapi_types": {},
144 | "attribute_map": {},
145 | "location_map": {},
146 | "collection_format_map": {},
147 | },
148 | headers_map={
149 | "accept": ["application/xml"],
150 | "content_type": [],
151 | },
152 | api_client=api_client,
153 | )
154 | self.static_appdata_plenum_v2_speaker_xml_get_endpoint = _Endpoint(
155 | settings={
156 | "response_type": (str,),
157 | "auth": [],
158 | "endpoint_path": "/static/appdata/plenum/v2/speaker.xml",
159 | "operation_id": "static_appdata_plenum_v2_speaker_xml_get",
160 | "http_method": "GET",
161 | "servers": None,
162 | },
163 | params_map={
164 | "all": [],
165 | "required": [],
166 | "nullable": [],
167 | "enum": [],
168 | "validation": [],
169 | },
170 | root_map={
171 | "validations": {},
172 | "allowed_values": {},
173 | "openapi_types": {},
174 | "attribute_map": {},
175 | "location_map": {},
176 | "collection_format_map": {},
177 | },
178 | headers_map={
179 | "accept": ["application/xml"],
180 | "content_type": [],
181 | },
182 | api_client=api_client,
183 | )
184 | self.xml_v2_ausschuesse_ausschussid_xml_get_endpoint = _Endpoint(
185 | settings={
186 | "response_type": (str,),
187 | "auth": [],
188 | "endpoint_path": "/xml/v2/ausschuesse/{AUSSCHUSS_ID}.xml",
189 | "operation_id": "xml_v2_ausschuesse_ausschussid_xml_get",
190 | "http_method": "GET",
191 | "servers": None,
192 | },
193 | params_map={
194 | "all": [
195 | "ausschuss_id",
196 | ],
197 | "required": [
198 | "ausschuss_id",
199 | ],
200 | "nullable": [],
201 | "enum": [],
202 | "validation": [],
203 | },
204 | root_map={
205 | "validations": {},
206 | "allowed_values": {},
207 | "openapi_types": {
208 | "ausschuss_id": (str,),
209 | },
210 | "attribute_map": {
211 | "ausschuss_id": "AUSSCHUSS_ID",
212 | },
213 | "location_map": {
214 | "ausschuss_id": "path",
215 | },
216 | "collection_format_map": {},
217 | },
218 | headers_map={
219 | "accept": ["application/xml"],
220 | "content_type": [],
221 | },
222 | api_client=api_client,
223 | )
224 | self.xml_v2_ausschuesse_index_xml_get_endpoint = _Endpoint(
225 | settings={
226 | "response_type": (str,),
227 | "auth": [],
228 | "endpoint_path": "/xml/v2/ausschuesse/index.xml",
229 | "operation_id": "xml_v2_ausschuesse_index_xml_get",
230 | "http_method": "GET",
231 | "servers": None,
232 | },
233 | params_map={
234 | "all": [],
235 | "required": [],
236 | "nullable": [],
237 | "enum": [],
238 | "validation": [],
239 | },
240 | root_map={
241 | "validations": {},
242 | "allowed_values": {},
243 | "openapi_types": {},
244 | "attribute_map": {},
245 | "location_map": {},
246 | "collection_format_map": {},
247 | },
248 | headers_map={
249 | "accept": ["application/xml"],
250 | "content_type": [],
251 | },
252 | api_client=api_client,
253 | )
254 | self.xml_v2_mdb_biografien_mdbid_xml_get_endpoint = _Endpoint(
255 | settings={
256 | "response_type": (str,),
257 | "auth": [],
258 | "endpoint_path": "/xml/v2/mdb/biografien/{MDB_ID}.xml",
259 | "operation_id": "xml_v2_mdb_biografien_mdbid_xml_get",
260 | "http_method": "GET",
261 | "servers": None,
262 | },
263 | params_map={
264 | "all": [
265 | "mdb_id",
266 | ],
267 | "required": [
268 | "mdb_id",
269 | ],
270 | "nullable": [],
271 | "enum": [],
272 | "validation": [],
273 | },
274 | root_map={
275 | "validations": {},
276 | "allowed_values": {},
277 | "openapi_types": {
278 | "mdb_id": (int,),
279 | },
280 | "attribute_map": {
281 | "mdb_id": "MDB_ID",
282 | },
283 | "location_map": {
284 | "mdb_id": "path",
285 | },
286 | "collection_format_map": {},
287 | },
288 | headers_map={
289 | "accept": ["application/xml"],
290 | "content_type": [],
291 | },
292 | api_client=api_client,
293 | )
294 | self.xml_v2_mdb_index_xml_get_endpoint = _Endpoint(
295 | settings={
296 | "response_type": (str,),
297 | "auth": [],
298 | "endpoint_path": "/xml/v2/mdb/index.xml",
299 | "operation_id": "xml_v2_mdb_index_xml_get",
300 | "http_method": "GET",
301 | "servers": None,
302 | },
303 | params_map={
304 | "all": [],
305 | "required": [],
306 | "nullable": [],
307 | "enum": [],
308 | "validation": [],
309 | },
310 | root_map={
311 | "validations": {},
312 | "allowed_values": {},
313 | "openapi_types": {},
314 | "attribute_map": {},
315 | "location_map": {},
316 | "collection_format_map": {},
317 | },
318 | headers_map={
319 | "accept": ["application/xml"],
320 | "content_type": [],
321 | },
322 | api_client=api_client,
323 | )
324 |
325 | def blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(
326 | self, article_id, **kwargs
327 | ):
328 | """Artikel Details # noqa: E501
329 |
330 | This method makes a synchronous HTTP request by default. To make an
331 | asynchronous HTTP request, please pass async_req=True
332 |
333 | >>> thread = api.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(article_id, async_req=True)
334 | >>> result = thread.get()
335 |
336 | Args:
337 | article_id (int): ID des Nachrichtenbeitrags
338 |
339 | Keyword Args:
340 | _return_http_data_only (bool): response data without head status
341 | code and headers. Default is True.
342 | _preload_content (bool): if False, the urllib3.HTTPResponse object
343 | will be returned without reading/decoding response data.
344 | Default is True.
345 | _request_timeout (int/float/tuple): timeout setting for this request. If
346 | one number provided, it will be total request timeout. It can also
347 | be a pair (tuple) of (connection, read) timeouts.
348 | Default is None.
349 | _check_input_type (bool): specifies if type checking
350 | should be done one the data sent to the server.
351 | Default is True.
352 | _check_return_type (bool): specifies if type checking
353 | should be done one the data received from the server.
354 | Default is True.
355 | _spec_property_naming (bool): True if the variable names in the input data
356 | are serialized names, as specified in the OpenAPI document.
357 | False if the variable names in the input data
358 | are pythonic names, e.g. snake case (default)
359 | _content_type (str/None): force body content-type.
360 | Default is None and content-type will be predicted by allowed
361 | content-types and body.
362 | _host_index (int/None): specifies the index of the server
363 | that we want to use.
364 | Default is read from the configuration.
365 | _request_auths (list): set to override the auth_settings for an a single
366 | request; this effectively ignores the authentication
367 | in the spec for a single request.
368 | Default is None
369 | async_req (bool): execute request asynchronously
370 |
371 | Returns:
372 | str
373 | If the method is called asynchronously, returns the request
374 | thread.
375 | """
376 | kwargs["async_req"] = kwargs.get("async_req", False)
377 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
378 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
379 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
380 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
381 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
382 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
383 | kwargs["_content_type"] = kwargs.get("_content_type")
384 | kwargs["_host_index"] = kwargs.get("_host_index")
385 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
386 | kwargs["article_id"] = article_id
387 | return self.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get_endpoint.call_with_http_info(
388 | **kwargs
389 | )
390 |
391 | def iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get(
392 | self, content_id, **kwargs
393 | ):
394 | """Abruf eines Videos # noqa: E501
395 |
396 | This method makes a synchronous HTTP request by default. To make an
397 | asynchronous HTTP request, please pass async_req=True
398 |
399 | >>> thread = api.iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get(content_id, async_req=True)
400 | >>> result = thread.get()
401 |
402 | Args:
403 | content_id (int): ID des MDB
404 |
405 | Keyword Args:
406 | _return_http_data_only (bool): response data without head status
407 | code and headers. Default is True.
408 | _preload_content (bool): if False, the urllib3.HTTPResponse object
409 | will be returned without reading/decoding response data.
410 | Default is True.
411 | _request_timeout (int/float/tuple): timeout setting for this request. If
412 | one number provided, it will be total request timeout. It can also
413 | be a pair (tuple) of (connection, read) timeouts.
414 | Default is None.
415 | _check_input_type (bool): specifies if type checking
416 | should be done one the data sent to the server.
417 | Default is True.
418 | _check_return_type (bool): specifies if type checking
419 | should be done one the data received from the server.
420 | Default is True.
421 | _spec_property_naming (bool): True if the variable names in the input data
422 | are serialized names, as specified in the OpenAPI document.
423 | False if the variable names in the input data
424 | are pythonic names, e.g. snake case (default)
425 | _content_type (str/None): force body content-type.
426 | Default is None and content-type will be predicted by allowed
427 | content-types and body.
428 | _host_index (int/None): specifies the index of the server
429 | that we want to use.
430 | Default is read from the configuration.
431 | _request_auths (list): set to override the auth_settings for an a single
432 | request; this effectively ignores the authentication
433 | in the spec for a single request.
434 | Default is None
435 | async_req (bool): execute request asynchronously
436 |
437 | Returns:
438 | str
439 | If the method is called asynchronously, returns the request
440 | thread.
441 | """
442 | kwargs["async_req"] = kwargs.get("async_req", False)
443 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
444 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
445 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
446 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
447 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
448 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
449 | kwargs["_content_type"] = kwargs.get("_content_type")
450 | kwargs["_host_index"] = kwargs.get("_host_index")
451 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
452 | kwargs["content_id"] = content_id
453 | return self.iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get_endpoint.call_with_http_info(
454 | **kwargs
455 | )
456 |
457 | def static_appdata_plenum_v2_conferences_xml_get(self, **kwargs):
458 | """Sitzungstag übersicht # noqa: E501
459 |
460 | This method makes a synchronous HTTP request by default. To make an
461 | asynchronous HTTP request, please pass async_req=True
462 |
463 | >>> thread = api.static_appdata_plenum_v2_conferences_xml_get(async_req=True)
464 | >>> result = thread.get()
465 |
466 |
467 | Keyword Args:
468 | _return_http_data_only (bool): response data without head status
469 | code and headers. Default is True.
470 | _preload_content (bool): if False, the urllib3.HTTPResponse object
471 | will be returned without reading/decoding response data.
472 | Default is True.
473 | _request_timeout (int/float/tuple): timeout setting for this request. If
474 | one number provided, it will be total request timeout. It can also
475 | be a pair (tuple) of (connection, read) timeouts.
476 | Default is None.
477 | _check_input_type (bool): specifies if type checking
478 | should be done one the data sent to the server.
479 | Default is True.
480 | _check_return_type (bool): specifies if type checking
481 | should be done one the data received from the server.
482 | Default is True.
483 | _spec_property_naming (bool): True if the variable names in the input data
484 | are serialized names, as specified in the OpenAPI document.
485 | False if the variable names in the input data
486 | are pythonic names, e.g. snake case (default)
487 | _content_type (str/None): force body content-type.
488 | Default is None and content-type will be predicted by allowed
489 | content-types and body.
490 | _host_index (int/None): specifies the index of the server
491 | that we want to use.
492 | Default is read from the configuration.
493 | _request_auths (list): set to override the auth_settings for an a single
494 | request; this effectively ignores the authentication
495 | in the spec for a single request.
496 | Default is None
497 | async_req (bool): execute request asynchronously
498 |
499 | Returns:
500 | str
501 | If the method is called asynchronously, returns the request
502 | thread.
503 | """
504 | kwargs["async_req"] = kwargs.get("async_req", False)
505 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
506 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
507 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
508 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
509 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
510 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
511 | kwargs["_content_type"] = kwargs.get("_content_type")
512 | kwargs["_host_index"] = kwargs.get("_host_index")
513 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
514 | return self.static_appdata_plenum_v2_conferences_xml_get_endpoint.call_with_http_info(
515 | **kwargs
516 | )
517 |
518 | def static_appdata_plenum_v2_speaker_xml_get(self, **kwargs):
519 | """Aktuelle Sprecher*in # noqa: E501
520 |
521 | This method makes a synchronous HTTP request by default. To make an
522 | asynchronous HTTP request, please pass async_req=True
523 |
524 | >>> thread = api.static_appdata_plenum_v2_speaker_xml_get(async_req=True)
525 | >>> result = thread.get()
526 |
527 |
528 | Keyword Args:
529 | _return_http_data_only (bool): response data without head status
530 | code and headers. Default is True.
531 | _preload_content (bool): if False, the urllib3.HTTPResponse object
532 | will be returned without reading/decoding response data.
533 | Default is True.
534 | _request_timeout (int/float/tuple): timeout setting for this request. If
535 | one number provided, it will be total request timeout. It can also
536 | be a pair (tuple) of (connection, read) timeouts.
537 | Default is None.
538 | _check_input_type (bool): specifies if type checking
539 | should be done one the data sent to the server.
540 | Default is True.
541 | _check_return_type (bool): specifies if type checking
542 | should be done one the data received from the server.
543 | Default is True.
544 | _spec_property_naming (bool): True if the variable names in the input data
545 | are serialized names, as specified in the OpenAPI document.
546 | False if the variable names in the input data
547 | are pythonic names, e.g. snake case (default)
548 | _content_type (str/None): force body content-type.
549 | Default is None and content-type will be predicted by allowed
550 | content-types and body.
551 | _host_index (int/None): specifies the index of the server
552 | that we want to use.
553 | Default is read from the configuration.
554 | _request_auths (list): set to override the auth_settings for an a single
555 | request; this effectively ignores the authentication
556 | in the spec for a single request.
557 | Default is None
558 | async_req (bool): execute request asynchronously
559 |
560 | Returns:
561 | str
562 | If the method is called asynchronously, returns the request
563 | thread.
564 | """
565 | kwargs["async_req"] = kwargs.get("async_req", False)
566 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
567 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
568 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
569 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
570 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
571 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
572 | kwargs["_content_type"] = kwargs.get("_content_type")
573 | kwargs["_host_index"] = kwargs.get("_host_index")
574 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
575 | return (
576 | self.static_appdata_plenum_v2_speaker_xml_get_endpoint.call_with_http_info(
577 | **kwargs
578 | )
579 | )
580 |
581 | def xml_v2_ausschuesse_ausschussid_xml_get(self, ausschuss_id, **kwargs):
582 | """Übersicht über die Ausschüsse # noqa: E501
583 |
584 | This method makes a synchronous HTTP request by default. To make an
585 | asynchronous HTTP request, please pass async_req=True
586 |
587 | >>> thread = api.xml_v2_ausschuesse_ausschussid_xml_get(ausschuss_id, async_req=True)
588 | >>> result = thread.get()
589 |
590 | Args:
591 | ausschuss_id (str): ID des Ausschusses
592 |
593 | Keyword Args:
594 | _return_http_data_only (bool): response data without head status
595 | code and headers. Default is True.
596 | _preload_content (bool): if False, the urllib3.HTTPResponse object
597 | will be returned without reading/decoding response data.
598 | Default is True.
599 | _request_timeout (int/float/tuple): timeout setting for this request. If
600 | one number provided, it will be total request timeout. It can also
601 | be a pair (tuple) of (connection, read) timeouts.
602 | Default is None.
603 | _check_input_type (bool): specifies if type checking
604 | should be done one the data sent to the server.
605 | Default is True.
606 | _check_return_type (bool): specifies if type checking
607 | should be done one the data received from the server.
608 | Default is True.
609 | _spec_property_naming (bool): True if the variable names in the input data
610 | are serialized names, as specified in the OpenAPI document.
611 | False if the variable names in the input data
612 | are pythonic names, e.g. snake case (default)
613 | _content_type (str/None): force body content-type.
614 | Default is None and content-type will be predicted by allowed
615 | content-types and body.
616 | _host_index (int/None): specifies the index of the server
617 | that we want to use.
618 | Default is read from the configuration.
619 | _request_auths (list): set to override the auth_settings for an a single
620 | request; this effectively ignores the authentication
621 | in the spec for a single request.
622 | Default is None
623 | async_req (bool): execute request asynchronously
624 |
625 | Returns:
626 | str
627 | If the method is called asynchronously, returns the request
628 | thread.
629 | """
630 | kwargs["async_req"] = kwargs.get("async_req", False)
631 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
632 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
633 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
634 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
635 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
636 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
637 | kwargs["_content_type"] = kwargs.get("_content_type")
638 | kwargs["_host_index"] = kwargs.get("_host_index")
639 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
640 | kwargs["ausschuss_id"] = ausschuss_id
641 | return self.xml_v2_ausschuesse_ausschussid_xml_get_endpoint.call_with_http_info(
642 | **kwargs
643 | )
644 |
645 | def xml_v2_ausschuesse_index_xml_get(self, **kwargs):
646 | """Übersicht über die Ausschüsse # noqa: E501
647 |
648 | This method makes a synchronous HTTP request by default. To make an
649 | asynchronous HTTP request, please pass async_req=True
650 |
651 | >>> thread = api.xml_v2_ausschuesse_index_xml_get(async_req=True)
652 | >>> result = thread.get()
653 |
654 |
655 | Keyword Args:
656 | _return_http_data_only (bool): response data without head status
657 | code and headers. Default is True.
658 | _preload_content (bool): if False, the urllib3.HTTPResponse object
659 | will be returned without reading/decoding response data.
660 | Default is True.
661 | _request_timeout (int/float/tuple): timeout setting for this request. If
662 | one number provided, it will be total request timeout. It can also
663 | be a pair (tuple) of (connection, read) timeouts.
664 | Default is None.
665 | _check_input_type (bool): specifies if type checking
666 | should be done one the data sent to the server.
667 | Default is True.
668 | _check_return_type (bool): specifies if type checking
669 | should be done one the data received from the server.
670 | Default is True.
671 | _spec_property_naming (bool): True if the variable names in the input data
672 | are serialized names, as specified in the OpenAPI document.
673 | False if the variable names in the input data
674 | are pythonic names, e.g. snake case (default)
675 | _content_type (str/None): force body content-type.
676 | Default is None and content-type will be predicted by allowed
677 | content-types and body.
678 | _host_index (int/None): specifies the index of the server
679 | that we want to use.
680 | Default is read from the configuration.
681 | _request_auths (list): set to override the auth_settings for an a single
682 | request; this effectively ignores the authentication
683 | in the spec for a single request.
684 | Default is None
685 | async_req (bool): execute request asynchronously
686 |
687 | Returns:
688 | str
689 | If the method is called asynchronously, returns the request
690 | thread.
691 | """
692 | kwargs["async_req"] = kwargs.get("async_req", False)
693 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
694 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
695 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
696 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
697 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
698 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
699 | kwargs["_content_type"] = kwargs.get("_content_type")
700 | kwargs["_host_index"] = kwargs.get("_host_index")
701 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
702 | return self.xml_v2_ausschuesse_index_xml_get_endpoint.call_with_http_info(
703 | **kwargs
704 | )
705 |
706 | def xml_v2_mdb_biografien_mdbid_xml_get(self, mdb_id, **kwargs):
707 | """Abruf Details eines MDBS # noqa: E501
708 |
709 | This method makes a synchronous HTTP request by default. To make an
710 | asynchronous HTTP request, please pass async_req=True
711 |
712 | >>> thread = api.xml_v2_mdb_biografien_mdbid_xml_get(mdb_id, async_req=True)
713 | >>> result = thread.get()
714 |
715 | Args:
716 | mdb_id (int): ID des MDB
717 |
718 | Keyword Args:
719 | _return_http_data_only (bool): response data without head status
720 | code and headers. Default is True.
721 | _preload_content (bool): if False, the urllib3.HTTPResponse object
722 | will be returned without reading/decoding response data.
723 | Default is True.
724 | _request_timeout (int/float/tuple): timeout setting for this request. If
725 | one number provided, it will be total request timeout. It can also
726 | be a pair (tuple) of (connection, read) timeouts.
727 | Default is None.
728 | _check_input_type (bool): specifies if type checking
729 | should be done one the data sent to the server.
730 | Default is True.
731 | _check_return_type (bool): specifies if type checking
732 | should be done one the data received from the server.
733 | Default is True.
734 | _spec_property_naming (bool): True if the variable names in the input data
735 | are serialized names, as specified in the OpenAPI document.
736 | False if the variable names in the input data
737 | are pythonic names, e.g. snake case (default)
738 | _content_type (str/None): force body content-type.
739 | Default is None and content-type will be predicted by allowed
740 | content-types and body.
741 | _host_index (int/None): specifies the index of the server
742 | that we want to use.
743 | Default is read from the configuration.
744 | _request_auths (list): set to override the auth_settings for an a single
745 | request; this effectively ignores the authentication
746 | in the spec for a single request.
747 | Default is None
748 | async_req (bool): execute request asynchronously
749 |
750 | Returns:
751 | str
752 | If the method is called asynchronously, returns the request
753 | thread.
754 | """
755 | kwargs["async_req"] = kwargs.get("async_req", False)
756 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
757 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
758 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
759 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
760 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
761 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
762 | kwargs["_content_type"] = kwargs.get("_content_type")
763 | kwargs["_host_index"] = kwargs.get("_host_index")
764 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
765 | kwargs["mdb_id"] = mdb_id
766 | return self.xml_v2_mdb_biografien_mdbid_xml_get_endpoint.call_with_http_info(
767 | **kwargs
768 | )
769 |
770 | def xml_v2_mdb_index_xml_get(self, **kwargs):
771 | """Übersicht über alle MDBS # noqa: E501
772 |
773 | This method makes a synchronous HTTP request by default. To make an
774 | asynchronous HTTP request, please pass async_req=True
775 |
776 | >>> thread = api.xml_v2_mdb_index_xml_get(async_req=True)
777 | >>> result = thread.get()
778 |
779 |
780 | Keyword Args:
781 | _return_http_data_only (bool): response data without head status
782 | code and headers. Default is True.
783 | _preload_content (bool): if False, the urllib3.HTTPResponse object
784 | will be returned without reading/decoding response data.
785 | Default is True.
786 | _request_timeout (int/float/tuple): timeout setting for this request. If
787 | one number provided, it will be total request timeout. It can also
788 | be a pair (tuple) of (connection, read) timeouts.
789 | Default is None.
790 | _check_input_type (bool): specifies if type checking
791 | should be done one the data sent to the server.
792 | Default is True.
793 | _check_return_type (bool): specifies if type checking
794 | should be done one the data received from the server.
795 | Default is True.
796 | _spec_property_naming (bool): True if the variable names in the input data
797 | are serialized names, as specified in the OpenAPI document.
798 | False if the variable names in the input data
799 | are pythonic names, e.g. snake case (default)
800 | _content_type (str/None): force body content-type.
801 | Default is None and content-type will be predicted by allowed
802 | content-types and body.
803 | _host_index (int/None): specifies the index of the server
804 | that we want to use.
805 | Default is read from the configuration.
806 | _request_auths (list): set to override the auth_settings for an a single
807 | request; this effectively ignores the authentication
808 | in the spec for a single request.
809 | Default is None
810 | async_req (bool): execute request asynchronously
811 |
812 | Returns:
813 | str
814 | If the method is called asynchronously, returns the request
815 | thread.
816 | """
817 | kwargs["async_req"] = kwargs.get("async_req", False)
818 | kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
819 | kwargs["_preload_content"] = kwargs.get("_preload_content", True)
820 | kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
821 | kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
822 | kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
823 | kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
824 | kwargs["_content_type"] = kwargs.get("_content_type")
825 | kwargs["_host_index"] = kwargs.get("_host_index")
826 | kwargs["_request_auths"] = kwargs.get("_request_auths", None)
827 | return self.xml_v2_mdb_index_xml_get_endpoint.call_with_http_info(**kwargs)
828 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/api_client.py:
--------------------------------------------------------------------------------
1 | """
2 | Bundestag: Live Informationen
3 |
4 | Bundestag Informationen API # 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 atexit
13 | import io
14 | import json
15 | import mimetypes
16 | import os
17 | import re
18 | import typing
19 | from multiprocessing.pool import ThreadPool
20 | from urllib.parse import quote
21 |
22 | from deutschland.bundestag import rest
23 | from deutschland.bundestag.configuration import Configuration
24 | from deutschland.bundestag.exceptions import ApiException, ApiTypeError, ApiValueError
25 | from deutschland.bundestag.model_utils import (
26 | ModelComposed,
27 | ModelNormal,
28 | ModelSimple,
29 | check_allowed_values,
30 | check_validations,
31 | date,
32 | datetime,
33 | deserialize_file,
34 | file_type,
35 | model_to_dict,
36 | none_type,
37 | validate_and_convert_types,
38 | )
39 | from urllib3.fields import RequestField
40 |
41 |
42 | class ApiClient(object):
43 | """Generic API client for OpenAPI client library builds.
44 |
45 | OpenAPI generic API client. This client handles the client-
46 | server communication, and is invariant across implementations. Specifics of
47 | the methods and models for each application are generated from the OpenAPI
48 | templates.
49 |
50 | NOTE: This class is auto generated by OpenAPI Generator.
51 | Ref: https://openapi-generator.tech
52 | Do not edit the class manually.
53 |
54 | :param configuration: .Configuration object for this client
55 | :param header_name: a header to pass when making calls to the API.
56 | :param header_value: a header value to pass when making calls to
57 | the API.
58 | :param cookie: a cookie to include in the header when making calls
59 | to the API
60 | :param pool_threads: The number of threads to use for async requests
61 | to the API. More threads means more concurrent API requests.
62 | """
63 |
64 | _pool = None
65 |
66 | def __init__(
67 | self,
68 | configuration=None,
69 | header_name=None,
70 | header_value=None,
71 | cookie=None,
72 | pool_threads=1,
73 | ):
74 | if configuration is None:
75 | configuration = Configuration.get_default_copy()
76 | self.configuration = configuration
77 | self.pool_threads = pool_threads
78 |
79 | self.rest_client = rest.RESTClientObject(configuration)
80 | self.default_headers = {}
81 | if header_name is not None:
82 | self.default_headers[header_name] = header_value
83 | self.cookie = cookie
84 | # Set default User-Agent.
85 | self.user_agent = "OpenAPI-Generator/0.1.0/python"
86 |
87 | def __enter__(self):
88 | return self
89 |
90 | def __exit__(self, exc_type, exc_value, traceback):
91 | self.close()
92 |
93 | def close(self):
94 | if self._pool:
95 | self._pool.close()
96 | self._pool.join()
97 | self._pool = None
98 | if hasattr(atexit, "unregister"):
99 | atexit.unregister(self.close)
100 |
101 | @property
102 | def pool(self):
103 | """Create thread pool on first request
104 | avoids instantiating unused threadpool for blocking clients.
105 | """
106 | if self._pool is None:
107 | atexit.register(self.close)
108 | self._pool = ThreadPool(self.pool_threads)
109 | return self._pool
110 |
111 | @property
112 | def user_agent(self):
113 | """User agent for this API client"""
114 | return self.default_headers["User-Agent"]
115 |
116 | @user_agent.setter
117 | def user_agent(self, value):
118 | self.default_headers["User-Agent"] = value
119 |
120 | def set_default_header(self, header_name, header_value):
121 | self.default_headers[header_name] = header_value
122 |
123 | def __call_api(
124 | self,
125 | resource_path: str,
126 | method: str,
127 | path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
128 | query_params: typing.Optional[
129 | typing.List[typing.Tuple[str, typing.Any]]
130 | ] = None,
131 | header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
132 | body: typing.Optional[typing.Any] = None,
133 | post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
134 | files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
135 | response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
136 | auth_settings: typing.Optional[typing.List[str]] = None,
137 | _return_http_data_only: typing.Optional[bool] = None,
138 | collection_formats: typing.Optional[typing.Dict[str, str]] = None,
139 | _preload_content: bool = True,
140 | _request_timeout: typing.Optional[
141 | typing.Union[int, float, typing.Tuple]
142 | ] = None,
143 | _host: typing.Optional[str] = None,
144 | _check_type: typing.Optional[bool] = None,
145 | _content_type: typing.Optional[str] = None,
146 | _request_auths: typing.Optional[
147 | typing.List[typing.Dict[str, typing.Any]]
148 | ] = None,
149 | ):
150 |
151 | config = self.configuration
152 |
153 | # header parameters
154 | header_params = header_params or {}
155 | header_params.update(self.default_headers)
156 | if self.cookie:
157 | header_params["Cookie"] = self.cookie
158 | if header_params:
159 | header_params = self.sanitize_for_serialization(header_params)
160 | header_params = dict(
161 | self.parameters_to_tuples(header_params, collection_formats)
162 | )
163 |
164 | # path parameters
165 | if path_params:
166 | path_params = self.sanitize_for_serialization(path_params)
167 | path_params = self.parameters_to_tuples(path_params, collection_formats)
168 | for k, v in path_params:
169 | # specified safe chars, encode everything
170 | resource_path = resource_path.replace(
171 | "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)
172 | )
173 |
174 | # query parameters
175 | if query_params:
176 | query_params = self.sanitize_for_serialization(query_params)
177 | query_params = self.parameters_to_tuples(query_params, collection_formats)
178 |
179 | # post parameters
180 | if post_params or files:
181 | post_params = post_params if post_params else []
182 | post_params = self.sanitize_for_serialization(post_params)
183 | post_params = self.parameters_to_tuples(post_params, collection_formats)
184 | post_params.extend(self.files_parameters(files))
185 | if header_params["Content-Type"].startswith("multipart"):
186 | post_params = self.parameters_to_multipart(post_params, (dict))
187 |
188 | # body
189 | if body:
190 | body = self.sanitize_for_serialization(body)
191 |
192 | # auth setting
193 | self.update_params_for_auth(
194 | header_params,
195 | query_params,
196 | auth_settings,
197 | resource_path,
198 | method,
199 | body,
200 | request_auths=_request_auths,
201 | )
202 |
203 | # request url
204 | if _host is None:
205 | url = self.configuration.host + resource_path
206 | else:
207 | # use server/host defined in path or operation instead
208 | url = _host + resource_path
209 |
210 | try:
211 | # perform request and return response
212 | response_data = self.request(
213 | method,
214 | url,
215 | query_params=query_params,
216 | headers=header_params,
217 | post_params=post_params,
218 | body=body,
219 | _preload_content=_preload_content,
220 | _request_timeout=_request_timeout,
221 | )
222 | except ApiException as e:
223 | e.body = e.body.decode("utf-8")
224 | raise e
225 |
226 | self.last_response = response_data
227 |
228 | return_data = response_data
229 |
230 | if not _preload_content:
231 | return return_data
232 | return return_data
233 |
234 | # deserialize response data
235 | if response_type:
236 | if response_type != (file_type,):
237 | encoding = "utf-8"
238 | content_type = response_data.getheader("content-type")
239 | if content_type is not None:
240 | match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
241 | if match:
242 | encoding = match.group(1)
243 | response_data.data = response_data.data.decode(encoding)
244 |
245 | return_data = self.deserialize(response_data, response_type, _check_type)
246 | else:
247 | return_data = None
248 |
249 | if _return_http_data_only:
250 | return return_data
251 | else:
252 | return (return_data, response_data.status, response_data.getheaders())
253 |
254 | def parameters_to_multipart(self, params, collection_types):
255 | """Get parameters as list of tuples, formatting as json if value is collection_types
256 |
257 | :param params: Parameters as list of two-tuples
258 | :param dict collection_types: Parameter collection types
259 | :return: Parameters as list of tuple or urllib3.fields.RequestField
260 | """
261 | new_params = []
262 | if collection_types is None:
263 | collection_types = dict
264 | for k, v in (
265 | params.items() if isinstance(params, dict) else params
266 | ): # noqa: E501
267 | if isinstance(
268 | v, collection_types
269 | ): # v is instance of collection_type, formatting as application/json
270 | v = json.dumps(v, ensure_ascii=False).encode("utf-8")
271 | field = RequestField(k, v)
272 | field.make_multipart(content_type="application/json; charset=utf-8")
273 | new_params.append(field)
274 | else:
275 | new_params.append((k, v))
276 | return new_params
277 |
278 | @classmethod
279 | def sanitize_for_serialization(cls, obj):
280 | """Prepares data for transmission before it is sent with the rest client
281 | If obj is None, return None.
282 | If obj is str, int, long, float, bool, return directly.
283 | If obj is datetime.datetime, datetime.date
284 | convert to string in iso8601 format.
285 | If obj is list, sanitize each element in the list.
286 | If obj is dict, return the dict.
287 | If obj is OpenAPI model, return the properties dict.
288 | If obj is io.IOBase, return the bytes
289 | :param obj: The data to serialize.
290 | :return: The serialized form of data.
291 | """
292 | if isinstance(obj, (ModelNormal, ModelComposed)):
293 | return {
294 | key: cls.sanitize_for_serialization(val)
295 | for key, val in model_to_dict(obj, serialize=True).items()
296 | }
297 | elif isinstance(obj, io.IOBase):
298 | return cls.get_file_data_and_close_file(obj)
299 | elif isinstance(obj, (str, int, float, none_type, bool)):
300 | return obj
301 | elif isinstance(obj, (datetime, date)):
302 | return obj.isoformat()
303 | elif isinstance(obj, ModelSimple):
304 | return cls.sanitize_for_serialization(obj.value)
305 | elif isinstance(obj, (list, tuple)):
306 | return [cls.sanitize_for_serialization(item) for item in obj]
307 | if isinstance(obj, dict):
308 | return {
309 | key: cls.sanitize_for_serialization(val) for key, val in obj.items()
310 | }
311 | raise ApiValueError(
312 | "Unable to prepare type {} for serialization".format(obj.__class__.__name__)
313 | )
314 |
315 | def deserialize(self, response, response_type, _check_type):
316 | """Deserializes response into an object.
317 |
318 | :param response: RESTResponse object to be deserialized.
319 | :param response_type: For the response, a tuple containing:
320 | valid classes
321 | a list containing valid classes (for list schemas)
322 | a dict containing a tuple of valid classes as the value
323 | Example values:
324 | (str,)
325 | (Pet,)
326 | (float, none_type)
327 | ([int, none_type],)
328 | ({str: (bool, str, int, float, date, datetime, str, none_type)},)
329 | :param _check_type: boolean, whether to check the types of the data
330 | received from the server
331 | :type _check_type: bool
332 |
333 | :return: deserialized object.
334 | """
335 | # handle file downloading
336 | # save response body into a tmp file and return the instance
337 | if response_type == (file_type,):
338 | content_disposition = response.getheader("Content-Disposition")
339 | return deserialize_file(
340 | response.data,
341 | self.configuration,
342 | content_disposition=content_disposition,
343 | )
344 |
345 | # fetch data from response object
346 | try:
347 | received_data = json.loads(response.data)
348 | except ValueError:
349 | received_data = response.data
350 |
351 | # store our data under the key of 'received_data' so users have some
352 | # context if they are deserializing a string and the data type is wrong
353 | deserialized_data = validate_and_convert_types(
354 | received_data,
355 | response_type,
356 | ["received_data"],
357 | True,
358 | _check_type,
359 | configuration=self.configuration,
360 | )
361 | return deserialized_data
362 |
363 | def call_api(
364 | self,
365 | resource_path: str,
366 | method: str,
367 | path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
368 | query_params: typing.Optional[
369 | typing.List[typing.Tuple[str, typing.Any]]
370 | ] = None,
371 | header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
372 | body: typing.Optional[typing.Any] = None,
373 | post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
374 | files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
375 | response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
376 | auth_settings: typing.Optional[typing.List[str]] = None,
377 | async_req: typing.Optional[bool] = None,
378 | _return_http_data_only: typing.Optional[bool] = None,
379 | collection_formats: typing.Optional[typing.Dict[str, str]] = None,
380 | _preload_content: bool = True,
381 | _request_timeout: typing.Optional[
382 | typing.Union[int, float, typing.Tuple]
383 | ] = None,
384 | _host: typing.Optional[str] = None,
385 | _check_type: typing.Optional[bool] = None,
386 | _request_auths: typing.Optional[
387 | typing.List[typing.Dict[str, typing.Any]]
388 | ] = None,
389 | ):
390 | """Makes the HTTP request (synchronous) and returns deserialized data.
391 |
392 | To make an async_req request, set the async_req parameter.
393 |
394 | :param resource_path: Path to method endpoint.
395 | :param method: Method to call.
396 | :param path_params: Path parameters in the url.
397 | :param query_params: Query parameters in the url.
398 | :param header_params: Header parameters to be
399 | placed in the request header.
400 | :param body: Request body.
401 | :param post_params dict: Request post form parameters,
402 | for `application/x-www-form-urlencoded`, `multipart/form-data`.
403 | :param auth_settings list: Auth Settings names for the request.
404 | :param response_type: For the response, a tuple containing:
405 | valid classes
406 | a list containing valid classes (for list schemas)
407 | a dict containing a tuple of valid classes as the value
408 | Example values:
409 | (str,)
410 | (Pet,)
411 | (float, none_type)
412 | ([int, none_type],)
413 | ({str: (bool, str, int, float, date, datetime, str, none_type)},)
414 | :param files: key -> field name, value -> a list of open file
415 | objects for `multipart/form-data`.
416 | :type files: dict
417 | :param async_req bool: execute request asynchronously
418 | :type async_req: bool, optional
419 | :param _return_http_data_only: response data without head status code
420 | and headers
421 | :type _return_http_data_only: bool, optional
422 | :param collection_formats: dict of collection formats for path, query,
423 | header, and post parameters.
424 | :type collection_formats: dict, optional
425 | :param _preload_content: if False, the urllib3.HTTPResponse object will
426 | be returned without reading/decoding response
427 | data. Default is True.
428 | :type _preload_content: bool, optional
429 | :param _request_timeout: timeout setting for this request. If one
430 | number provided, it will be total request
431 | timeout. It can also be a pair (tuple) of
432 | (connection, read) timeouts.
433 | :param _check_type: boolean describing if the data back from the server
434 | should have its type checked.
435 | :type _check_type: bool, optional
436 | :param _request_auths: set to override the auth_settings for an a single
437 | request; this effectively ignores the authentication
438 | in the spec for a single request.
439 | :type _request_auths: list, optional
440 | :return:
441 | If async_req parameter is True,
442 | the request will be called asynchronously.
443 | The method will return the request thread.
444 | If parameter async_req is False or missing,
445 | then the method will return the response directly.
446 | """
447 | if not async_req:
448 | return self.__call_api(
449 | resource_path,
450 | method,
451 | path_params,
452 | query_params,
453 | header_params,
454 | body,
455 | post_params,
456 | files,
457 | response_type,
458 | auth_settings,
459 | _return_http_data_only,
460 | collection_formats,
461 | _preload_content,
462 | _request_timeout,
463 | _host,
464 | _check_type,
465 | _request_auths=_request_auths,
466 | )
467 |
468 | return self.pool.apply_async(
469 | self.__call_api,
470 | (
471 | resource_path,
472 | method,
473 | path_params,
474 | query_params,
475 | header_params,
476 | body,
477 | post_params,
478 | files,
479 | response_type,
480 | auth_settings,
481 | _return_http_data_only,
482 | collection_formats,
483 | _preload_content,
484 | _request_timeout,
485 | _host,
486 | _check_type,
487 | None,
488 | _request_auths,
489 | ),
490 | )
491 |
492 | def request(
493 | self,
494 | method,
495 | url,
496 | query_params=None,
497 | headers=None,
498 | post_params=None,
499 | body=None,
500 | _preload_content=True,
501 | _request_timeout=None,
502 | ):
503 | """Makes the HTTP request using RESTClient."""
504 | if method == "GET":
505 | return self.rest_client.GET(
506 | url,
507 | query_params=query_params,
508 | _preload_content=_preload_content,
509 | _request_timeout=_request_timeout,
510 | headers=headers,
511 | )
512 | elif method == "HEAD":
513 | return self.rest_client.HEAD(
514 | url,
515 | query_params=query_params,
516 | _preload_content=_preload_content,
517 | _request_timeout=_request_timeout,
518 | headers=headers,
519 | )
520 | elif method == "OPTIONS":
521 | return self.rest_client.OPTIONS(
522 | url,
523 | query_params=query_params,
524 | headers=headers,
525 | post_params=post_params,
526 | _preload_content=_preload_content,
527 | _request_timeout=_request_timeout,
528 | body=body,
529 | )
530 | elif method == "POST":
531 | return self.rest_client.POST(
532 | url,
533 | query_params=query_params,
534 | headers=headers,
535 | post_params=post_params,
536 | _preload_content=_preload_content,
537 | _request_timeout=_request_timeout,
538 | body=body,
539 | )
540 | elif method == "PUT":
541 | return self.rest_client.PUT(
542 | url,
543 | query_params=query_params,
544 | headers=headers,
545 | post_params=post_params,
546 | _preload_content=_preload_content,
547 | _request_timeout=_request_timeout,
548 | body=body,
549 | )
550 | elif method == "PATCH":
551 | return self.rest_client.PATCH(
552 | url,
553 | query_params=query_params,
554 | headers=headers,
555 | post_params=post_params,
556 | _preload_content=_preload_content,
557 | _request_timeout=_request_timeout,
558 | body=body,
559 | )
560 | elif method == "DELETE":
561 | return self.rest_client.DELETE(
562 | url,
563 | query_params=query_params,
564 | headers=headers,
565 | _preload_content=_preload_content,
566 | _request_timeout=_request_timeout,
567 | body=body,
568 | )
569 | else:
570 | raise ApiValueError(
571 | "http method must be `GET`, `HEAD`, `OPTIONS`,"
572 | " `POST`, `PATCH`, `PUT` or `DELETE`."
573 | )
574 |
575 | def parameters_to_tuples(self, params, collection_formats):
576 | """Get parameters as list of tuples, formatting collections.
577 |
578 | :param params: Parameters as dict or list of two-tuples
579 | :param dict collection_formats: Parameter collection formats
580 | :return: Parameters as list of tuples, collections formatted
581 | """
582 | new_params = []
583 | if collection_formats is None:
584 | collection_formats = {}
585 | for k, v in (
586 | params.items() if isinstance(params, dict) else params
587 | ): # noqa: E501
588 | if k in collection_formats:
589 | collection_format = collection_formats[k]
590 | if collection_format == "multi":
591 | new_params.extend((k, value) for value in v)
592 | else:
593 | if collection_format == "ssv":
594 | delimiter = " "
595 | elif collection_format == "tsv":
596 | delimiter = "\t"
597 | elif collection_format == "pipes":
598 | delimiter = "|"
599 | else: # csv is the default
600 | delimiter = ","
601 | new_params.append((k, delimiter.join(str(value) for value in v)))
602 | else:
603 | new_params.append((k, v))
604 | return new_params
605 |
606 | @staticmethod
607 | def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes:
608 | file_data = file_instance.read()
609 | file_instance.close()
610 | return file_data
611 |
612 | def files_parameters(
613 | self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None
614 | ):
615 | """Builds form parameters.
616 |
617 | :param files: None or a dict with key=param_name and
618 | value is a list of open file objects
619 | :return: List of tuples of form parameters with file data
620 | """
621 | if files is None:
622 | return []
623 |
624 | params = []
625 | for param_name, file_instances in files.items():
626 | if file_instances is None:
627 | # if the file field is nullable, skip None values
628 | continue
629 | for file_instance in file_instances:
630 | if file_instance is None:
631 | # if the file field is nullable, skip None values
632 | continue
633 | if file_instance.closed is True:
634 | raise ApiValueError(
635 | "Cannot read a closed file. The passed in file_type "
636 | "for %s must be open." % param_name
637 | )
638 | filename = os.path.basename(file_instance.name)
639 | filedata = self.get_file_data_and_close_file(file_instance)
640 | mimetype = (
641 | mimetypes.guess_type(filename)[0] or "application/octet-stream"
642 | )
643 | params.append(
644 | tuple([param_name, tuple([filename, filedata, mimetype])])
645 | )
646 |
647 | return params
648 |
649 | def select_header_accept(self, accepts):
650 | """Returns `Accept` based on an array of accepts provided.
651 |
652 | :param accepts: List of headers.
653 | :return: Accept (e.g. application/json).
654 | """
655 | if not accepts:
656 | return
657 |
658 | accepts = [x.lower() for x in accepts]
659 |
660 | if "application/json" in accepts:
661 | return "application/json"
662 | else:
663 | return ", ".join(accepts)
664 |
665 | def select_header_content_type(self, content_types, method=None, body=None):
666 | """Returns `Content-Type` based on an array of content_types provided.
667 |
668 | :param content_types: List of content-types.
669 | :param method: http method (e.g. POST, PATCH).
670 | :param body: http body to send.
671 | :return: Content-Type (e.g. application/json).
672 | """
673 | if not content_types:
674 | return None
675 |
676 | content_types = [x.lower() for x in content_types]
677 |
678 | if (
679 | method == "PATCH"
680 | and "application/json-patch+json" in content_types
681 | and isinstance(body, list)
682 | ):
683 | return "application/json-patch+json"
684 |
685 | if "application/json" in content_types or "*/*" in content_types:
686 | return "application/json"
687 | else:
688 | return content_types[0]
689 |
690 | def update_params_for_auth(
691 | self,
692 | headers,
693 | queries,
694 | auth_settings,
695 | resource_path,
696 | method,
697 | body,
698 | request_auths=None,
699 | ):
700 | """Updates header and query params based on authentication setting.
701 |
702 | :param headers: Header parameters dict to be updated.
703 | :param queries: Query parameters tuple list to be updated.
704 | :param auth_settings: Authentication setting identifiers list.
705 | :param resource_path: A string representation of the HTTP request resource path.
706 | :param method: A string representation of the HTTP request method.
707 | :param body: A object representing the body of the HTTP request.
708 | The object type is the return value of _encoder.default().
709 | :param request_auths: if set, the provided settings will
710 | override the token in the configuration.
711 | """
712 | if not auth_settings:
713 | return
714 |
715 | if request_auths:
716 | for auth_setting in request_auths:
717 | self._apply_auth_params(
718 | headers, queries, resource_path, method, body, auth_setting
719 | )
720 | return
721 |
722 | for auth in auth_settings:
723 | auth_setting = self.configuration.auth_settings().get(auth)
724 | if auth_setting:
725 | self._apply_auth_params(
726 | headers, queries, resource_path, method, body, auth_setting
727 | )
728 |
729 | def _apply_auth_params(
730 | self, headers, queries, resource_path, method, body, auth_setting
731 | ):
732 | if auth_setting["in"] == "cookie":
733 | headers["Cookie"] = auth_setting["key"] + "=" + auth_setting["value"]
734 | elif auth_setting["in"] == "header":
735 | if auth_setting["type"] != "http-signature":
736 | headers[auth_setting["key"]] = auth_setting["value"]
737 | elif auth_setting["in"] == "query":
738 | queries.append((auth_setting["key"], auth_setting["value"]))
739 | else:
740 | raise ApiValueError("Authentication token must be in `query` or `header`")
741 |
742 |
743 | class Endpoint(object):
744 | def __init__(
745 | self,
746 | settings=None,
747 | params_map=None,
748 | root_map=None,
749 | headers_map=None,
750 | api_client=None,
751 | callable=None,
752 | ):
753 | """Creates an endpoint
754 |
755 | Args:
756 | settings (dict): see below key value pairs
757 | 'response_type' (tuple/None): response type
758 | 'auth' (list): a list of auth type keys
759 | 'endpoint_path' (str): the endpoint path
760 | 'operation_id' (str): endpoint string identifier
761 | 'http_method' (str): POST/PUT/PATCH/GET etc
762 | 'servers' (list): list of str servers that this endpoint is at
763 | params_map (dict): see below key value pairs
764 | 'all' (list): list of str endpoint parameter names
765 | 'required' (list): list of required parameter names
766 | 'nullable' (list): list of nullable parameter names
767 | 'enum' (list): list of parameters with enum values
768 | 'validation' (list): list of parameters with validations
769 | root_map
770 | 'validations' (dict): the dict mapping endpoint parameter tuple
771 | paths to their validation dictionaries
772 | 'allowed_values' (dict): the dict mapping endpoint parameter
773 | tuple paths to their allowed_values (enum) dictionaries
774 | 'openapi_types' (dict): param_name to openapi type
775 | 'attribute_map' (dict): param_name to camelCase name
776 | 'location_map' (dict): param_name to 'body', 'file', 'form',
777 | 'header', 'path', 'query'
778 | collection_format_map (dict): param_name to `csv` etc.
779 | headers_map (dict): see below key value pairs
780 | 'accept' (list): list of Accept header strings
781 | 'content_type' (list): list of Content-Type header strings
782 | api_client (ApiClient) api client instance
783 | callable (function): the function which is invoked when the
784 | Endpoint is called
785 | """
786 | self.settings = settings
787 | self.params_map = params_map
788 | self.params_map["all"].extend(
789 | [
790 | "async_req",
791 | "_host_index",
792 | "_preload_content",
793 | "_request_timeout",
794 | "_return_http_data_only",
795 | "_check_input_type",
796 | "_check_return_type",
797 | "_content_type",
798 | "_spec_property_naming",
799 | "_request_auths",
800 | ]
801 | )
802 | self.params_map["nullable"].extend(["_request_timeout"])
803 | self.validations = root_map["validations"]
804 | self.allowed_values = root_map["allowed_values"]
805 | self.openapi_types = root_map["openapi_types"]
806 | extra_types = {
807 | "async_req": (bool,),
808 | "_host_index": (none_type, int),
809 | "_preload_content": (bool,),
810 | "_request_timeout": (
811 | none_type,
812 | float,
813 | (float,),
814 | [float],
815 | int,
816 | (int,),
817 | [int],
818 | ),
819 | "_return_http_data_only": (bool,),
820 | "_check_input_type": (bool,),
821 | "_check_return_type": (bool,),
822 | "_spec_property_naming": (bool,),
823 | "_content_type": (none_type, str),
824 | "_request_auths": (none_type, list),
825 | }
826 | self.openapi_types.update(extra_types)
827 | self.attribute_map = root_map["attribute_map"]
828 | self.location_map = root_map["location_map"]
829 | self.collection_format_map = root_map["collection_format_map"]
830 | self.headers_map = headers_map
831 | self.api_client = api_client
832 | self.callable = callable
833 |
834 | def __validate_inputs(self, kwargs):
835 | for param in self.params_map["enum"]:
836 | if param in kwargs:
837 | check_allowed_values(self.allowed_values, (param,), kwargs[param])
838 |
839 | for param in self.params_map["validation"]:
840 | if param in kwargs:
841 | check_validations(
842 | self.validations,
843 | (param,),
844 | kwargs[param],
845 | configuration=self.api_client.configuration,
846 | )
847 |
848 | if kwargs["_check_input_type"] is False:
849 | return
850 |
851 | for key, value in kwargs.items():
852 | fixed_val = validate_and_convert_types(
853 | value,
854 | self.openapi_types[key],
855 | [key],
856 | kwargs["_spec_property_naming"],
857 | kwargs["_check_input_type"],
858 | configuration=self.api_client.configuration,
859 | )
860 | kwargs[key] = fixed_val
861 |
862 | def __gather_params(self, kwargs):
863 | params = {
864 | "body": None,
865 | "collection_format": {},
866 | "file": {},
867 | "form": [],
868 | "header": {},
869 | "path": {},
870 | "query": [],
871 | }
872 |
873 | for param_name, param_value in kwargs.items():
874 | param_location = self.location_map.get(param_name)
875 | if param_location is None:
876 | continue
877 | if param_location:
878 | if param_location == "body":
879 | params["body"] = param_value
880 | continue
881 | base_name = self.attribute_map[param_name]
882 | if param_location == "form" and self.openapi_types[param_name] == (
883 | file_type,
884 | ):
885 | params["file"][base_name] = [param_value]
886 | elif param_location == "form" and self.openapi_types[param_name] == (
887 | [file_type],
888 | ):
889 | # param_value is already a list
890 | params["file"][base_name] = param_value
891 | elif param_location in {"form", "query"}:
892 | param_value_full = (base_name, param_value)
893 | params[param_location].append(param_value_full)
894 | if param_location not in {"form", "query"}:
895 | params[param_location][base_name] = param_value
896 | collection_format = self.collection_format_map.get(param_name)
897 | if collection_format:
898 | params["collection_format"][base_name] = collection_format
899 |
900 | return params
901 |
902 | def __call__(self, *args, **kwargs):
903 | """This method is invoked when endpoints are called
904 | Example:
905 |
906 | api_instance = DefaultApi()
907 | api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get # this is an instance of the class Endpoint
908 | api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get() # this invokes api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get.__call__()
909 | which then invokes the callable functions stored in that endpoint at
910 | api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get.callable or self.callable in this class
911 |
912 | """
913 | return self.callable(self, *args, **kwargs)
914 |
915 | def call_with_http_info(self, **kwargs):
916 |
917 | try:
918 | index = (
919 | self.api_client.configuration.server_operation_index.get(
920 | self.settings["operation_id"],
921 | self.api_client.configuration.server_index,
922 | )
923 | if kwargs["_host_index"] is None
924 | else kwargs["_host_index"]
925 | )
926 | server_variables = (
927 | self.api_client.configuration.server_operation_variables.get(
928 | self.settings["operation_id"],
929 | self.api_client.configuration.server_variables,
930 | )
931 | )
932 | _host = self.api_client.configuration.get_host_from_settings(
933 | index, variables=server_variables, servers=self.settings["servers"]
934 | )
935 | except IndexError:
936 | if self.settings["servers"]:
937 | raise ApiValueError(
938 | "Invalid host index. Must be 0 <= index < %s"
939 | % len(self.settings["servers"])
940 | )
941 | _host = None
942 |
943 | for key, value in kwargs.items():
944 | if key not in self.params_map["all"]:
945 | raise ApiTypeError(
946 | "Got an unexpected parameter '%s'"
947 | " to method `%s`" % (key, self.settings["operation_id"])
948 | )
949 | # only throw this nullable ApiValueError if _check_input_type
950 | # is False, if _check_input_type==True we catch this case
951 | # in self.__validate_inputs
952 | if (
953 | key not in self.params_map["nullable"]
954 | and value is None
955 | and kwargs["_check_input_type"] is False
956 | ):
957 | raise ApiValueError(
958 | "Value may not be None for non-nullable parameter `%s`"
959 | " when calling `%s`" % (key, self.settings["operation_id"])
960 | )
961 |
962 | for key in self.params_map["required"]:
963 | if key not in kwargs.keys():
964 | raise ApiValueError(
965 | "Missing the required parameter `%s` when calling "
966 | "`%s`" % (key, self.settings["operation_id"])
967 | )
968 |
969 | self.__validate_inputs(kwargs)
970 |
971 | params = self.__gather_params(kwargs)
972 |
973 | accept_headers_list = self.headers_map["accept"]
974 | if accept_headers_list:
975 | params["header"]["Accept"] = self.api_client.select_header_accept(
976 | accept_headers_list
977 | )
978 |
979 | if kwargs.get("_content_type"):
980 | params["header"]["Content-Type"] = kwargs["_content_type"]
981 | else:
982 | content_type_headers_list = self.headers_map["content_type"]
983 | if content_type_headers_list:
984 | if params["body"] != "":
985 | content_types_list = self.api_client.select_header_content_type(
986 | content_type_headers_list,
987 | self.settings["http_method"],
988 | params["body"],
989 | )
990 | if content_types_list:
991 | params["header"]["Content-Type"] = content_types_list
992 |
993 | return self.api_client.call_api(
994 | self.settings["endpoint_path"],
995 | self.settings["http_method"],
996 | params["path"],
997 | params["query"],
998 | params["header"],
999 | body=params["body"],
1000 | post_params=params["form"],
1001 | files=params["file"],
1002 | response_type=self.settings["response_type"],
1003 | auth_settings=self.settings["auth"],
1004 | async_req=kwargs["async_req"],
1005 | _check_type=kwargs["_check_return_type"],
1006 | _return_http_data_only=kwargs["_return_http_data_only"],
1007 | _preload_content=kwargs["_preload_content"],
1008 | _request_timeout=kwargs["_request_timeout"],
1009 | _host=_host,
1010 | _request_auths=kwargs["_request_auths"],
1011 | collection_formats=params["collection_format"],
1012 | )
1013 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/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.bundestag.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.bundestag.api.default_api import DefaultApi
17 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/configuration.py:
--------------------------------------------------------------------------------
1 | """
2 | Bundestag: Live Informationen
3 |
4 | Bundestag Informationen API # 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.bundestag.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 | """
88 |
89 | _default = None
90 |
91 | def __init__(
92 | self,
93 | host=None,
94 | api_key=None,
95 | api_key_prefix=None,
96 | access_token=None,
97 | username=None,
98 | password=None,
99 | discard_unknown_keys=False,
100 | disabled_client_side_validations="",
101 | server_index=None,
102 | server_variables=None,
103 | server_operation_index=None,
104 | server_operation_variables=None,
105 | ssl_ca_cert=None,
106 | ):
107 | """Constructor"""
108 | self._base_path = "https://www.bundestag.de" if host is None else host
109 | """Default Base url
110 | """
111 | self.server_index = 0 if server_index is None and host is None else server_index
112 | self.server_operation_index = server_operation_index or {}
113 | """Default server index
114 | """
115 | self.server_variables = server_variables or {}
116 | self.server_operation_variables = server_operation_variables or {}
117 | """Default server variables
118 | """
119 | self.temp_folder_path = None
120 | """Temp file folder for downloading files
121 | """
122 | # Authentication Settings
123 | self.access_token = access_token
124 | self.api_key = {}
125 | if api_key:
126 | self.api_key = api_key
127 | """dict to store API key(s)
128 | """
129 | self.api_key_prefix = {}
130 | if api_key_prefix:
131 | self.api_key_prefix = api_key_prefix
132 | """dict to store API prefix (e.g. Bearer)
133 | """
134 | self.refresh_api_key_hook = None
135 | """function hook to refresh API key if expired
136 | """
137 | self.username = username
138 | """Username for HTTP basic authentication
139 | """
140 | self.password = password
141 | """Password for HTTP basic authentication
142 | """
143 | self.discard_unknown_keys = discard_unknown_keys
144 | self.disabled_client_side_validations = disabled_client_side_validations
145 | self.logger = {}
146 | """Logging Settings
147 | """
148 | self.logger["package_logger"] = logging.getLogger("bundestag")
149 | self.logger["urllib3_logger"] = logging.getLogger("urllib3")
150 | self.logger_format = "%(asctime)s %(levelname)s %(message)s"
151 | """Log format
152 | """
153 | self.logger_stream_handler = None
154 | """Log stream handler
155 | """
156 | self.logger_file_handler = None
157 | """Log file handler
158 | """
159 | self.logger_file = None
160 | """Debug file location
161 | """
162 | self.debug = False
163 | """Debug switch
164 | """
165 |
166 | self.verify_ssl = True
167 | """SSL/TLS verification
168 | Set this to false to skip verifying SSL certificate when calling API
169 | from https server.
170 | """
171 | self.ssl_ca_cert = ssl_ca_cert
172 | """Set this to customize the certificate file to verify the peer.
173 | """
174 | self.cert_file = None
175 | """client certificate file
176 | """
177 | self.key_file = None
178 | """client key file
179 | """
180 | self.assert_hostname = None
181 | """Set this to True/False to enable/disable SSL hostname verification.
182 | """
183 |
184 | self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
185 | """urllib3 connection pool's maximum number of connections saved
186 | per pool. urllib3 uses 1 connection as default value, but this is
187 | not the best value when you are making a lot of possibly parallel
188 | requests to the same host, which is often the case here.
189 | cpu_count * 5 is used as default value to increase performance.
190 | """
191 |
192 | self.proxy = None
193 | """Proxy URL
194 | """
195 | self.no_proxy = None
196 | """bypass proxy for host in the no_proxy list.
197 | """
198 | self.proxy_headers = None
199 | """Proxy headers
200 | """
201 | self.safe_chars_for_path_param = ""
202 | """Safe chars for path_param
203 | """
204 | self.retries = None
205 | """Adding retries to override urllib3 default value 3
206 | """
207 | # Enable client side validation
208 | self.client_side_validation = True
209 |
210 | # Options to pass down to the underlying urllib3 socket
211 | self.socket_options = None
212 |
213 | def __deepcopy__(self, memo):
214 | cls = self.__class__
215 | result = cls.__new__(cls)
216 | memo[id(self)] = result
217 | for k, v in self.__dict__.items():
218 | if k not in ("logger", "logger_file_handler"):
219 | setattr(result, k, copy.deepcopy(v, memo))
220 | # shallow copy of loggers
221 | result.logger = copy.copy(self.logger)
222 | # use setters to configure loggers
223 | result.logger_file = self.logger_file
224 | result.debug = self.debug
225 | return result
226 |
227 | def __setattr__(self, name, value):
228 | object.__setattr__(self, name, value)
229 | if name == "disabled_client_side_validations":
230 | s = set(filter(None, value.split(",")))
231 | for v in s:
232 | if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
233 | raise ApiValueError("Invalid keyword: '{0}''".format(v))
234 | self._disabled_client_side_validations = s
235 |
236 | @classmethod
237 | def set_default(cls, default):
238 | """Set default instance of configuration.
239 |
240 | It stores default configuration, which can be
241 | returned by get_default_copy method.
242 |
243 | :param default: object of Configuration
244 | """
245 | cls._default = copy.deepcopy(default)
246 |
247 | @classmethod
248 | def get_default_copy(cls):
249 | """Return new instance of configuration.
250 |
251 | This method returns newly created, based on default constructor,
252 | object of Configuration class or returns a copy of default
253 | configuration passed by the set_default method.
254 |
255 | :return: The configuration object.
256 | """
257 | if cls._default is not None:
258 | return copy.deepcopy(cls._default)
259 | return Configuration()
260 |
261 | @property
262 | def logger_file(self):
263 | """The logger file.
264 |
265 | If the logger_file is None, then add stream handler and remove file
266 | handler. Otherwise, add file handler and remove stream handler.
267 |
268 | :param value: The logger_file path.
269 | :type: str
270 | """
271 | return self.__logger_file
272 |
273 | @logger_file.setter
274 | def logger_file(self, value):
275 | """The logger file.
276 |
277 | If the logger_file is None, then add stream handler and remove file
278 | handler. Otherwise, add file handler and remove stream handler.
279 |
280 | :param value: The logger_file path.
281 | :type: str
282 | """
283 | self.__logger_file = value
284 | if self.__logger_file:
285 | # If set logging file,
286 | # then add file handler and remove stream handler.
287 | self.logger_file_handler = logging.FileHandler(self.__logger_file)
288 | self.logger_file_handler.setFormatter(self.logger_formatter)
289 | for _, logger in self.logger.items():
290 | logger.addHandler(self.logger_file_handler)
291 |
292 | @property
293 | def debug(self):
294 | """Debug status
295 |
296 | :param value: The debug status, True or False.
297 | :type: bool
298 | """
299 | return self.__debug
300 |
301 | @debug.setter
302 | def debug(self, value):
303 | """Debug status
304 |
305 | :param value: The debug status, True or False.
306 | :type: bool
307 | """
308 | self.__debug = value
309 | if self.__debug:
310 | # if debug status is True, turn on debug logging
311 | for _, logger in self.logger.items():
312 | logger.setLevel(logging.DEBUG)
313 | # turn on http_client debug
314 | http_client.HTTPConnection.debuglevel = 1
315 | else:
316 | # if debug status is False, turn off debug logging,
317 | # setting log level to default `logging.WARNING`
318 | for _, logger in self.logger.items():
319 | logger.setLevel(logging.WARNING)
320 | # turn off http_client debug
321 | http_client.HTTPConnection.debuglevel = 0
322 |
323 | @property
324 | def logger_format(self):
325 | """The logger format.
326 |
327 | The logger_formatter will be updated when sets logger_format.
328 |
329 | :param value: The format string.
330 | :type: str
331 | """
332 | return self.__logger_format
333 |
334 | @logger_format.setter
335 | def logger_format(self, value):
336 | """The logger format.
337 |
338 | The logger_formatter will be updated when sets logger_format.
339 |
340 | :param value: The format string.
341 | :type: str
342 | """
343 | self.__logger_format = value
344 | self.logger_formatter = logging.Formatter(self.__logger_format)
345 |
346 | def get_api_key_with_prefix(self, identifier, alias=None):
347 | """Gets API key (with prefix if set).
348 |
349 | :param identifier: The identifier of apiKey.
350 | :param alias: The alternative identifier of apiKey.
351 | :return: The token for api key authentication.
352 | """
353 | if self.refresh_api_key_hook is not None:
354 | self.refresh_api_key_hook(self)
355 | key = self.api_key.get(
356 | identifier, self.api_key.get(alias) if alias is not None else None
357 | )
358 | if key:
359 | prefix = self.api_key_prefix.get(identifier)
360 | if prefix:
361 | return "%s %s" % (prefix, key)
362 | else:
363 | return key
364 |
365 | def get_basic_auth_token(self):
366 | """Gets HTTP basic authentication header (string).
367 |
368 | :return: The token for basic HTTP authentication.
369 | """
370 | username = ""
371 | if self.username is not None:
372 | username = self.username
373 | password = ""
374 | if self.password is not None:
375 | password = self.password
376 | return urllib3.util.make_headers(basic_auth=username + ":" + password).get(
377 | "authorization"
378 | )
379 |
380 | def auth_settings(self):
381 | """Gets Auth Settings dict for api client.
382 |
383 | :return: The Auth Settings information dict.
384 | """
385 | auth = {}
386 | return auth
387 |
388 | def to_debug_report(self):
389 | """Gets the essential information for debugging.
390 |
391 | :return: The report for debugging.
392 | """
393 | return (
394 | "Python SDK Debug Report:\n"
395 | "OS: {env}\n"
396 | "Python Version: {pyversion}\n"
397 | "Version of the API: 1.0.0\n"
398 | "SDK Package Version: 0.1.0".format(env=sys.platform, pyversion=sys.version)
399 | )
400 |
401 | def get_host_settings(self):
402 | """Gets an array of host settings
403 |
404 | :return: An array of host settings
405 | """
406 | return [
407 | {
408 | "url": "https://www.bundestag.de",
409 | "description": "No description provided",
410 | }
411 | ]
412 |
413 | def get_host_from_settings(self, index, variables=None, servers=None):
414 | """Gets host URL based on the index and variables
415 | :param index: array index of the host settings
416 | :param variables: hash of variable and the corresponding value
417 | :param servers: an array of host settings or None
418 | :return: URL based on host settings
419 | """
420 | if index is None:
421 | return self._base_path
422 |
423 | variables = {} if variables is None else variables
424 | servers = self.get_host_settings() if servers is None else servers
425 |
426 | try:
427 | server = servers[index]
428 | except IndexError:
429 | raise ValueError(
430 | "Invalid index {0} when selecting the host settings. "
431 | "Must be less than {1}".format(index, len(servers))
432 | )
433 |
434 | url = server["url"]
435 |
436 | # go through variables and replace placeholders
437 | for variable_name, variable in server.get("variables", {}).items():
438 | used_value = variables.get(variable_name, variable["default_value"])
439 |
440 | if "enum_values" in variable and used_value not in variable["enum_values"]:
441 | raise ValueError(
442 | "The variable `{0}` in the host URL has invalid value "
443 | "{1}. Must be {2}.".format(
444 | variable_name, variables[variable_name], variable["enum_values"]
445 | )
446 | )
447 |
448 | url = url.replace("{" + variable_name + "}", used_value)
449 |
450 | return url
451 |
452 | @property
453 | def host(self):
454 | """Return generated host."""
455 | return self.get_host_from_settings(
456 | self.server_index, variables=self.server_variables
457 | )
458 |
459 | @host.setter
460 | def host(self, value):
461 | """Fix base path."""
462 | self._base_path = value
463 | self.server_index = None
464 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/exceptions.py:
--------------------------------------------------------------------------------
1 | """
2 | Bundestag: Live Informationen
3 |
4 | Bundestag Informationen API # 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/bundestag/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.bundestag.models import ModelA, ModelB
6 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/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.bundestag.model.pet import Pet
8 | # or import this package, but before doing it, use:
9 | # import sys
10 | # sys.setrecursionlimit(n)
11 |
--------------------------------------------------------------------------------
/python-client/deutschland/bundestag/rest.py:
--------------------------------------------------------------------------------
1 | """
2 | Bundestag: Live Informationen
3 |
4 | Bundestag Informationen API # 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.bundestag.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 | # bundestag.DefaultApi
2 |
3 | All URIs are relative to *https://www.bundestag.de*
4 |
5 | Method | HTTP request | Description
6 | ------------- | ------------- | -------------
7 | [**blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get**](DefaultApi.md#blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get) | **GET** /blueprint/servlet/content/{ARTICLE_ID}/asAppV2NewsarticleXml | Artikel Details
8 | [**iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get**](DefaultApi.md#iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get) | **GET** /iptv/player/macros/_x_s-144277506/bttv/mobile/feed_vod.xml | Abruf eines Videos
9 | [**static_appdata_plenum_v2_conferences_xml_get**](DefaultApi.md#static_appdata_plenum_v2_conferences_xml_get) | **GET** /static/appdata/plenum/v2/conferences.xml | Sitzungstag übersicht
10 | [**static_appdata_plenum_v2_speaker_xml_get**](DefaultApi.md#static_appdata_plenum_v2_speaker_xml_get) | **GET** /static/appdata/plenum/v2/speaker.xml | Aktuelle Sprecher*in
11 | [**xml_v2_ausschuesse_ausschussid_xml_get**](DefaultApi.md#xml_v2_ausschuesse_ausschussid_xml_get) | **GET** /xml/v2/ausschuesse/{AUSSCHUSS_ID}.xml | Übersicht über die Ausschüsse
12 | [**xml_v2_ausschuesse_index_xml_get**](DefaultApi.md#xml_v2_ausschuesse_index_xml_get) | **GET** /xml/v2/ausschuesse/index.xml | Übersicht über die Ausschüsse
13 | [**xml_v2_mdb_biografien_mdbid_xml_get**](DefaultApi.md#xml_v2_mdb_biografien_mdbid_xml_get) | **GET** /xml/v2/mdb/biografien/{MDB_ID}.xml | Abruf Details eines MDBS
14 | [**xml_v2_mdb_index_xml_get**](DefaultApi.md#xml_v2_mdb_index_xml_get) | **GET** /xml/v2/mdb/index.xml | Übersicht über alle MDBS
15 |
16 |
17 | # **blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get**
18 | > str blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(article_id)
19 |
20 | Artikel Details
21 |
22 | ### Example
23 |
24 |
25 | ```python
26 | import time
27 | from deutschland import bundestag
28 | from deutschland.bundestag.api import default_api
29 | from pprint import pprint
30 | # Defining the host is optional and defaults to https://www.bundestag.de
31 | # See configuration.py for a list of all supported configuration parameters.
32 | configuration = bundestag.Configuration(
33 | host = "https://www.bundestag.de"
34 | )
35 |
36 |
37 | # Enter a context with an instance of the API client
38 | with bundestag.ApiClient() as api_client:
39 | # Create an instance of the API class
40 | api_instance = default_api.DefaultApi(api_client)
41 | article_id = 849630 # int | ID des Nachrichtenbeitrags
42 |
43 | # example passing only required values which don't have defaults set
44 | try:
45 | # Artikel Details
46 | api_response = api_instance.blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(article_id)
47 | pprint(api_response)
48 | except bundestag.ApiException as e:
49 | print("Exception when calling DefaultApi->blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get: %s\n" % e)
50 | ```
51 |
52 |
53 | ### Parameters
54 |
55 | Name | Type | Description | Notes
56 | ------------- | ------------- | ------------- | -------------
57 | **article_id** | **int**| ID des Nachrichtenbeitrags |
58 |
59 | ### Return type
60 |
61 | **str**
62 |
63 | ### Authorization
64 |
65 | No authorization required
66 |
67 | ### HTTP request headers
68 |
69 | - **Content-Type**: Not defined
70 | - **Accept**: application/xml
71 |
72 |
73 | ### HTTP response details
74 |
75 | | Status code | Description | Response headers |
76 | |-------------|-------------|------------------|
77 | **200** | OK | - |
78 |
79 | [[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)
80 |
81 | # **iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get**
82 | > str iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get(content_id)
83 |
84 | Abruf eines Videos
85 |
86 | ### Example
87 |
88 |
89 | ```python
90 | import time
91 | from deutschland import bundestag
92 | from deutschland.bundestag.api import default_api
93 | from pprint import pprint
94 | # Defining the host is optional and defaults to https://www.bundestag.de
95 | # See configuration.py for a list of all supported configuration parameters.
96 | configuration = bundestag.Configuration(
97 | host = "https://www.bundestag.de"
98 | )
99 |
100 |
101 | # Enter a context with an instance of the API client
102 | with bundestag.ApiClient() as api_client:
103 | # Create an instance of the API class
104 | api_instance = default_api.DefaultApi(api_client)
105 | content_id = 7529016 # int | ID des MDB
106 |
107 | # example passing only required values which don't have defaults set
108 | try:
109 | # Abruf eines Videos
110 | api_response = api_instance.iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get(content_id)
111 | pprint(api_response)
112 | except bundestag.ApiException as e:
113 | print("Exception when calling DefaultApi->iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get: %s\n" % e)
114 | ```
115 |
116 |
117 | ### Parameters
118 |
119 | Name | Type | Description | Notes
120 | ------------- | ------------- | ------------- | -------------
121 | **content_id** | **int**| ID des MDB |
122 |
123 | ### Return type
124 |
125 | **str**
126 |
127 | ### Authorization
128 |
129 | No authorization required
130 |
131 | ### HTTP request headers
132 |
133 | - **Content-Type**: Not defined
134 | - **Accept**: application/xml
135 |
136 |
137 | ### HTTP response details
138 |
139 | | Status code | Description | Response headers |
140 | |-------------|-------------|------------------|
141 | **200** | OK | - |
142 |
143 | [[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)
144 |
145 | # **static_appdata_plenum_v2_conferences_xml_get**
146 | > str static_appdata_plenum_v2_conferences_xml_get()
147 |
148 | Sitzungstag übersicht
149 |
150 | ### Example
151 |
152 |
153 | ```python
154 | import time
155 | from deutschland import bundestag
156 | from deutschland.bundestag.api import default_api
157 | from pprint import pprint
158 | # Defining the host is optional and defaults to https://www.bundestag.de
159 | # See configuration.py for a list of all supported configuration parameters.
160 | configuration = bundestag.Configuration(
161 | host = "https://www.bundestag.de"
162 | )
163 |
164 |
165 | # Enter a context with an instance of the API client
166 | with bundestag.ApiClient() as api_client:
167 | # Create an instance of the API class
168 | api_instance = default_api.DefaultApi(api_client)
169 |
170 | # example, this endpoint has no required or optional parameters
171 | try:
172 | # Sitzungstag übersicht
173 | api_response = api_instance.static_appdata_plenum_v2_conferences_xml_get()
174 | pprint(api_response)
175 | except bundestag.ApiException as e:
176 | print("Exception when calling DefaultApi->static_appdata_plenum_v2_conferences_xml_get: %s\n" % e)
177 | ```
178 |
179 |
180 | ### Parameters
181 | This endpoint does not need any parameter.
182 |
183 | ### Return type
184 |
185 | **str**
186 |
187 | ### Authorization
188 |
189 | No authorization required
190 |
191 | ### HTTP request headers
192 |
193 | - **Content-Type**: Not defined
194 | - **Accept**: application/xml
195 |
196 |
197 | ### HTTP response details
198 |
199 | | Status code | Description | Response headers |
200 | |-------------|-------------|------------------|
201 | **200** | OK | - |
202 |
203 | [[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)
204 |
205 | # **static_appdata_plenum_v2_speaker_xml_get**
206 | > str static_appdata_plenum_v2_speaker_xml_get()
207 |
208 | Aktuelle Sprecher*in
209 |
210 | ### Example
211 |
212 |
213 | ```python
214 | import time
215 | from deutschland import bundestag
216 | from deutschland.bundestag.api import default_api
217 | from pprint import pprint
218 | # Defining the host is optional and defaults to https://www.bundestag.de
219 | # See configuration.py for a list of all supported configuration parameters.
220 | configuration = bundestag.Configuration(
221 | host = "https://www.bundestag.de"
222 | )
223 |
224 |
225 | # Enter a context with an instance of the API client
226 | with bundestag.ApiClient() as api_client:
227 | # Create an instance of the API class
228 | api_instance = default_api.DefaultApi(api_client)
229 |
230 | # example, this endpoint has no required or optional parameters
231 | try:
232 | # Aktuelle Sprecher*in
233 | api_response = api_instance.static_appdata_plenum_v2_speaker_xml_get()
234 | pprint(api_response)
235 | except bundestag.ApiException as e:
236 | print("Exception when calling DefaultApi->static_appdata_plenum_v2_speaker_xml_get: %s\n" % e)
237 | ```
238 |
239 |
240 | ### Parameters
241 | This endpoint does not need any parameter.
242 |
243 | ### Return type
244 |
245 | **str**
246 |
247 | ### Authorization
248 |
249 | No authorization required
250 |
251 | ### HTTP request headers
252 |
253 | - **Content-Type**: Not defined
254 | - **Accept**: application/xml
255 |
256 |
257 | ### HTTP response details
258 |
259 | | Status code | Description | Response headers |
260 | |-------------|-------------|------------------|
261 | **200** | OK | - |
262 |
263 | [[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)
264 |
265 | # **xml_v2_ausschuesse_ausschussid_xml_get**
266 | > str xml_v2_ausschuesse_ausschussid_xml_get(ausschuss_id)
267 |
268 | Übersicht über die Ausschüsse
269 |
270 | ### Example
271 |
272 |
273 | ```python
274 | import time
275 | from deutschland import bundestag
276 | from deutschland.bundestag.api import default_api
277 | from pprint import pprint
278 | # Defining the host is optional and defaults to https://www.bundestag.de
279 | # See configuration.py for a list of all supported configuration parameters.
280 | configuration = bundestag.Configuration(
281 | host = "https://www.bundestag.de"
282 | )
283 |
284 |
285 | # Enter a context with an instance of the API client
286 | with bundestag.ApiClient() as api_client:
287 | # Create an instance of the API class
288 | api_instance = default_api.DefaultApi(api_client)
289 | ausschuss_id = "a11" # str | ID des Ausschusses
290 |
291 | # example passing only required values which don't have defaults set
292 | try:
293 | # Übersicht über die Ausschüsse
294 | api_response = api_instance.xml_v2_ausschuesse_ausschussid_xml_get(ausschuss_id)
295 | pprint(api_response)
296 | except bundestag.ApiException as e:
297 | print("Exception when calling DefaultApi->xml_v2_ausschuesse_ausschussid_xml_get: %s\n" % e)
298 | ```
299 |
300 |
301 | ### Parameters
302 |
303 | Name | Type | Description | Notes
304 | ------------- | ------------- | ------------- | -------------
305 | **ausschuss_id** | **str**| ID des Ausschusses |
306 |
307 | ### Return type
308 |
309 | **str**
310 |
311 | ### Authorization
312 |
313 | No authorization required
314 |
315 | ### HTTP request headers
316 |
317 | - **Content-Type**: Not defined
318 | - **Accept**: application/xml
319 |
320 |
321 | ### HTTP response details
322 |
323 | | Status code | Description | Response headers |
324 | |-------------|-------------|------------------|
325 | **200** | OK | - |
326 |
327 | [[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)
328 |
329 | # **xml_v2_ausschuesse_index_xml_get**
330 | > str xml_v2_ausschuesse_index_xml_get()
331 |
332 | Übersicht über die Ausschüsse
333 |
334 | ### Example
335 |
336 |
337 | ```python
338 | import time
339 | from deutschland import bundestag
340 | from deutschland.bundestag.api import default_api
341 | from pprint import pprint
342 | # Defining the host is optional and defaults to https://www.bundestag.de
343 | # See configuration.py for a list of all supported configuration parameters.
344 | configuration = bundestag.Configuration(
345 | host = "https://www.bundestag.de"
346 | )
347 |
348 |
349 | # Enter a context with an instance of the API client
350 | with bundestag.ApiClient() as api_client:
351 | # Create an instance of the API class
352 | api_instance = default_api.DefaultApi(api_client)
353 |
354 | # example, this endpoint has no required or optional parameters
355 | try:
356 | # Übersicht über die Ausschüsse
357 | api_response = api_instance.xml_v2_ausschuesse_index_xml_get()
358 | pprint(api_response)
359 | except bundestag.ApiException as e:
360 | print("Exception when calling DefaultApi->xml_v2_ausschuesse_index_xml_get: %s\n" % e)
361 | ```
362 |
363 |
364 | ### Parameters
365 | This endpoint does not need any parameter.
366 |
367 | ### Return type
368 |
369 | **str**
370 |
371 | ### Authorization
372 |
373 | No authorization required
374 |
375 | ### HTTP request headers
376 |
377 | - **Content-Type**: Not defined
378 | - **Accept**: application/xml
379 |
380 |
381 | ### HTTP response details
382 |
383 | | Status code | Description | Response headers |
384 | |-------------|-------------|------------------|
385 | **200** | OK | - |
386 |
387 | [[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)
388 |
389 | # **xml_v2_mdb_biografien_mdbid_xml_get**
390 | > str xml_v2_mdb_biografien_mdbid_xml_get(mdb_id)
391 |
392 | Abruf Details eines MDBS
393 |
394 | ### Example
395 |
396 |
397 | ```python
398 | import time
399 | from deutschland import bundestag
400 | from deutschland.bundestag.api import default_api
401 | from pprint import pprint
402 | # Defining the host is optional and defaults to https://www.bundestag.de
403 | # See configuration.py for a list of all supported configuration parameters.
404 | configuration = bundestag.Configuration(
405 | host = "https://www.bundestag.de"
406 | )
407 |
408 |
409 | # Enter a context with an instance of the API client
410 | with bundestag.ApiClient() as api_client:
411 | # Create an instance of the API class
412 | api_instance = default_api.DefaultApi(api_client)
413 | mdb_id = 1769 # int | ID des MDB
414 |
415 | # example passing only required values which don't have defaults set
416 | try:
417 | # Abruf Details eines MDBS
418 | api_response = api_instance.xml_v2_mdb_biografien_mdbid_xml_get(mdb_id)
419 | pprint(api_response)
420 | except bundestag.ApiException as e:
421 | print("Exception when calling DefaultApi->xml_v2_mdb_biografien_mdbid_xml_get: %s\n" % e)
422 | ```
423 |
424 |
425 | ### Parameters
426 |
427 | Name | Type | Description | Notes
428 | ------------- | ------------- | ------------- | -------------
429 | **mdb_id** | **int**| ID des MDB |
430 |
431 | ### Return type
432 |
433 | **str**
434 |
435 | ### Authorization
436 |
437 | No authorization required
438 |
439 | ### HTTP request headers
440 |
441 | - **Content-Type**: Not defined
442 | - **Accept**: application/xml
443 |
444 |
445 | ### HTTP response details
446 |
447 | | Status code | Description | Response headers |
448 | |-------------|-------------|------------------|
449 | **200** | OK | - |
450 |
451 | [[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)
452 |
453 | # **xml_v2_mdb_index_xml_get**
454 | > str xml_v2_mdb_index_xml_get()
455 |
456 | Übersicht über alle MDBS
457 |
458 | ### Example
459 |
460 |
461 | ```python
462 | import time
463 | from deutschland import bundestag
464 | from deutschland.bundestag.api import default_api
465 | from pprint import pprint
466 | # Defining the host is optional and defaults to https://www.bundestag.de
467 | # See configuration.py for a list of all supported configuration parameters.
468 | configuration = bundestag.Configuration(
469 | host = "https://www.bundestag.de"
470 | )
471 |
472 |
473 | # Enter a context with an instance of the API client
474 | with bundestag.ApiClient() as api_client:
475 | # Create an instance of the API class
476 | api_instance = default_api.DefaultApi(api_client)
477 |
478 | # example, this endpoint has no required or optional parameters
479 | try:
480 | # Übersicht über alle MDBS
481 | api_response = api_instance.xml_v2_mdb_index_xml_get()
482 | pprint(api_response)
483 | except bundestag.ApiException as e:
484 | print("Exception when calling DefaultApi->xml_v2_mdb_index_xml_get: %s\n" % e)
485 | ```
486 |
487 |
488 | ### Parameters
489 | This endpoint does not need any parameter.
490 |
491 | ### Return type
492 |
493 | **str**
494 |
495 | ### Authorization
496 |
497 | No authorization required
498 |
499 | ### HTTP request headers
500 |
501 | - **Content-Type**: Not defined
502 | - **Accept**: application/xml
503 |
504 |
505 | ### HTTP response details
506 |
507 | | Status code | Description | Response headers |
508 | |-------------|-------------|------------------|
509 | **200** | OK | - |
510 |
511 | [[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)
512 |
513 |
--------------------------------------------------------------------------------
/python-client/pyproject.toml:
--------------------------------------------------------------------------------
1 | [tool]
2 | [tool.poetry]
3 | name = "de-bundestag"
4 | version = "0.1.0"
5 | description = "Bundestag: Live Informationen"
6 | keywords = ["OpenAPI", "OpenAPI-Generator", "bundestag", "App", "API"]
7 | homepage = "https://github.com/bundesAPI/bundestag-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/bundestag-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 | # For the full list of built-in configuration values, see the documentation:
8 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
9 |
10 | # -- Project information -----------------------------------------------------
11 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
12 |
13 | project = "bundestag-api"
14 | copyright = "2022, BundesAPI"
15 | author = "BundesAPI"
16 |
17 | version = "0.1.0"
18 | release = "0.1.0"
19 |
20 | # -- General configuration ---------------------------------------------------
21 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
22 |
23 | extensions = [
24 | "m2r2",
25 | "sphinx.ext.autodoc",
26 | "sphinx.ext.napoleon",
27 | "sphinx.ext.autosummary",
28 | ]
29 |
30 | templates_path = ["_templates"]
31 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
32 |
33 | language = "de"
34 |
35 | # -- Options for HTML output -------------------------------------------------
36 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37 |
38 | html_theme = "alabaster"
39 | html_static_path = ["_static"]
40 |
41 | source_extensions = [".rst", ".md"]
42 |
--------------------------------------------------------------------------------
/python-client/sphinx-docs/index.rst:
--------------------------------------------------------------------------------
1 | bundestag-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/bundestag.api.rst:
--------------------------------------------------------------------------------
1 | bundestag.api package
2 | =====================
3 |
4 | Submodules
5 | ----------
6 |
7 | bundestag.api.default\_api module
8 | ---------------------------------
9 |
10 | .. automodule:: bundestag.api.default_api
11 | :members:
12 | :undoc-members:
13 | :show-inheritance:
14 |
15 | Module contents
16 | ---------------
17 |
18 | .. automodule:: bundestag.api
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
--------------------------------------------------------------------------------
/python-client/sphinx-docs/source/bundestag.apis.rst:
--------------------------------------------------------------------------------
1 | bundestag.apis package
2 | ======================
3 |
4 | Module contents
5 | ---------------
6 |
7 | .. automodule:: bundestag.apis
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
--------------------------------------------------------------------------------
/python-client/sphinx-docs/source/bundestag.model.rst:
--------------------------------------------------------------------------------
1 | bundestag.model package
2 | =======================
3 |
4 | Module contents
5 | ---------------
6 |
7 | .. automodule:: bundestag.model
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
--------------------------------------------------------------------------------
/python-client/sphinx-docs/source/bundestag.models.rst:
--------------------------------------------------------------------------------
1 | bundestag.models package
2 | ========================
3 |
4 | Module contents
5 | ---------------
6 |
7 | .. automodule:: bundestag.models
8 | :members:
9 | :undoc-members:
10 | :show-inheritance:
11 |
--------------------------------------------------------------------------------
/python-client/sphinx-docs/source/bundestag.rst:
--------------------------------------------------------------------------------
1 | bundestag package
2 | =================
3 |
4 | Subpackages
5 | -----------
6 |
7 | .. toctree::
8 | :maxdepth: 4
9 |
10 | bundestag.api
11 | bundestag.apis
12 | bundestag.model
13 | bundestag.models
14 |
15 | Submodules
16 | ----------
17 |
18 | bundestag.api\_client module
19 | ----------------------------
20 |
21 | .. automodule:: bundestag.api_client
22 | :members:
23 | :undoc-members:
24 | :show-inheritance:
25 |
26 | bundestag.configuration module
27 | ------------------------------
28 |
29 | .. automodule:: bundestag.configuration
30 | :members:
31 | :undoc-members:
32 | :show-inheritance:
33 |
34 | bundestag.exceptions module
35 | ---------------------------
36 |
37 | .. automodule:: bundestag.exceptions
38 | :members:
39 | :undoc-members:
40 | :show-inheritance:
41 |
42 | bundestag.model\_utils module
43 | -----------------------------
44 |
45 | .. automodule:: bundestag.model_utils
46 | :members:
47 | :undoc-members:
48 | :show-inheritance:
49 |
50 | bundestag.rest module
51 | ---------------------
52 |
53 | .. automodule:: bundestag.rest
54 | :members:
55 | :undoc-members:
56 | :show-inheritance:
57 |
58 | Module contents
59 | ---------------
60 |
61 | .. automodule:: bundestag
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 | bundestag
8 |
--------------------------------------------------------------------------------
/python-client/test-requirements.txt:
--------------------------------------------------------------------------------
1 | pytest-cov>=2.8.1
2 |
--------------------------------------------------------------------------------
/python-client/test/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bundesAPI/bundestag-api/38b9a453d1a0bee68fd2f2b032e63e3880bcb139/python-client/test/__init__.py
--------------------------------------------------------------------------------
/python-client/test/test_default_api.py:
--------------------------------------------------------------------------------
1 | """
2 | Bundestag: Live Informationen
3 |
4 | Bundestag Informationen API # 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.bundestag.api.default_api import DefaultApi # noqa: E501
15 |
16 | from deutschland import bundestag
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_blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get(self):
29 | """Test case for blueprint_servlet_content_articleidas_app_v2_newsarticle_xml_get
30 |
31 | Artikel Details # noqa: E501
32 | """
33 | pass
34 |
35 | def test_iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get(self):
36 | """Test case for iptv_player_macros_xs144277506_bttv_mobile_feed_vod_xml_get
37 |
38 | Abruf eines Videos # noqa: E501
39 | """
40 | pass
41 |
42 | def test_static_appdata_plenum_v2_conferences_xml_get(self):
43 | """Test case for static_appdata_plenum_v2_conferences_xml_get
44 |
45 | Sitzungstag übersicht # noqa: E501
46 | """
47 | pass
48 |
49 | def test_static_appdata_plenum_v2_speaker_xml_get(self):
50 | """Test case for static_appdata_plenum_v2_speaker_xml_get
51 |
52 | Aktuelle Sprecher*in # noqa: E501
53 | """
54 | pass
55 |
56 | def test_xml_v2_ausschuesse_ausschussid_xml_get(self):
57 | """Test case for xml_v2_ausschuesse_ausschussid_xml_get
58 |
59 | Übersicht über die Ausschüsse # noqa: E501
60 | """
61 | pass
62 |
63 | def test_xml_v2_ausschuesse_index_xml_get(self):
64 | """Test case for xml_v2_ausschuesse_index_xml_get
65 |
66 | Übersicht über die Ausschüsse # noqa: E501
67 | """
68 | pass
69 |
70 | def test_xml_v2_mdb_biografien_mdbid_xml_get(self):
71 | """Test case for xml_v2_mdb_biografien_mdbid_xml_get
72 |
73 | Abruf Details eines MDBS # noqa: E501
74 | """
75 | pass
76 |
77 | def test_xml_v2_mdb_index_xml_get(self):
78 | """Test case for xml_v2_mdb_index_xml_get
79 |
80 | Übersicht über alle MDBS # noqa: E501
81 | """
82 | pass
83 |
84 |
85 | if __name__ == "__main__":
86 | unittest.main()
87 |
--------------------------------------------------------------------------------
/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=bundestag
10 |
--------------------------------------------------------------------------------