diff --git a/swagger/analyse/api.yaml b/swagger/analyse/api.yaml index 71725b3d5f9890e675a6747dfad87005357ac61d..704e94f59e70eb3810f6c35d5098905ceede5f11 100644 --- a/swagger/analyse/api.yaml +++ b/swagger/analyse/api.yaml @@ -1 +1 @@ -{"definitions":{},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service that analyses data structures","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Analyse Service API","version":"1.1.0-alpha"},"openapi":"3.0.0","paths":{"/api/analyse/determinedt":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the datatypes of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"enum":{"example":true,"type":"boolean"},"enum_tol":{"example":0.1},"filepath":{"example":"/data/testdt08.csv","type":"string"},"separator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine datatypes"}},"/api/analyse/determinepk":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the primary keys + ranking of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"filepath":{"example":"/data/testdt08.csv","type":"string"},"seperator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine primary keys"}}},"servers":[{"description":"Generated server url","url":"http://localhost:5000"}]} +{"definitions":{},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service that analyses data structures","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Analyse Service API","version":"1.1.0-alpha"},"openapi":"3.0.0","paths":{"/api/analyse/determinedt":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the datatypes of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"enum":{"example":true,"type":"boolean"},"enum_tol":{"example":0.1},"filepath":{"example":"/data/testdt08.csv","type":"string"},"separator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine datatypes"}},"/api/analyse/determinepk":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the primary keys + ranking of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"filepath":{"example":"/data/testdt08.csv","type":"string"},"seperator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine primary keys"}}},"servers":[{"description":"Generated server url","url":"http://localhost:5000"},{"description":"DBRepo Sandbox","url":"https://dbrepo2.tuwien.ac.at:5000"}]} diff --git a/swagger/api-analyse.yaml b/swagger/api-analyse.yaml index 71725b3d5f9890e675a6747dfad87005357ac61d..704e94f59e70eb3810f6c35d5098905ceede5f11 100644 --- a/swagger/api-analyse.yaml +++ b/swagger/api-analyse.yaml @@ -1 +1 @@ -{"definitions":{},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service that analyses data structures","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Analyse Service API","version":"1.1.0-alpha"},"openapi":"3.0.0","paths":{"/api/analyse/determinedt":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the datatypes of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"enum":{"example":true,"type":"boolean"},"enum_tol":{"example":0.1},"filepath":{"example":"/data/testdt08.csv","type":"string"},"separator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine datatypes"}},"/api/analyse/determinepk":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the primary keys + ranking of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"filepath":{"example":"/data/testdt08.csv","type":"string"},"seperator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine primary keys"}}},"servers":[{"description":"Generated server url","url":"http://localhost:5000"}]} +{"definitions":{},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service that analyses data structures","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Analyse Service API","version":"1.1.0-alpha"},"openapi":"3.0.0","paths":{"/api/analyse/determinedt":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the datatypes of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"enum":{"example":true,"type":"boolean"},"enum_tol":{"example":0.1},"filepath":{"example":"/data/testdt08.csv","type":"string"},"separator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine datatypes"}},"/api/analyse/determinepk":{"post":{"consumes":["application/json"],"description":"This is a simple API which returns the primary keys + ranking of a (path) csv file","parameters":[{"description":"to-do description","in":"body","name":"body","required":true,"schema":{"properties":{"filepath":{"example":"/data/testdt08.csv","type":"string"},"seperator":{"example":",","type":"string"}},"type":"object"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Determine primary keys"}}},"servers":[{"description":"Generated server url","url":"http://localhost:5000"},{"description":"DBRepo Sandbox","url":"https://dbrepo2.tuwien.ac.at:5000"}]} diff --git a/swagger/api-authentication.yaml b/swagger/api-authentication.yaml index 85eeb5d071670b32cebb81e3b0deef9de9338972..a7026565a9f9d60fbb1c4b1c40b3927c5043e38e 100644 --- a/swagger/api-authentication.yaml +++ b/swagger/api-authentication.yaml @@ -1378,18 +1378,19 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - /api/user/token/{hash}: + /api/user/token/{id}: delete: tags: - token-endpoint summary: Delete developer token operationId: delete parameters: - - name: hash + - name: id in: path required: true schema: - type: string + type: integer + format: int64 responses: "417": description: Expectation Failed @@ -1579,10 +1580,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -1599,17 +1598,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -1619,13 +1621,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -1637,9 +1656,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -1655,12 +1671,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -1676,7 +1696,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -1725,8 +1744,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -2175,15 +2192,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -2195,6 +2210,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -2202,9 +2220,8 @@ components: example: air_quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -2215,6 +2232,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -2227,22 +2248,24 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true UserDto: required: - email - email_verified - id + - roles - theme_dark - username type: object @@ -2270,6 +2293,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: @@ -2333,6 +2364,10 @@ components: type: array items: type: string + enum: + - researcher + - developer + - data_steward UserPasswordDto: required: - password @@ -2392,9 +2427,6 @@ components: expires: type: string format: date-time - deleted: - type: string - format: date-time token: type: string example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c @@ -2454,9 +2486,6 @@ components: expires: type: string format: date-time - deleted: - type: string - format: date-time token_hash: type: string example: 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 diff --git a/swagger/api-container.yaml b/swagger/api-container.yaml index 6ab5dce17180f908e7706825f0829a6652e4ef76..b39513d6e8648674fd876385bccaf9a0cc171c5c 100644 --- a/swagger/api-container.yaml +++ b/swagger/api-container.yaml @@ -776,9 +776,8 @@ components: example: air-quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -789,6 +788,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -801,17 +804,18 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true ImageCreateDto: required: - default_port @@ -900,10 +904,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -920,17 +922,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -940,13 +945,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -958,9 +980,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -976,12 +995,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -997,7 +1020,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -1046,8 +1068,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -1376,15 +1396,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -1396,6 +1414,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -1406,6 +1427,7 @@ components: - email - email_verified - id + - roles - theme_dark - username type: object @@ -1433,6 +1455,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: diff --git a/swagger/api-database.yaml b/swagger/api-database.yaml index e22dc884054fceb7dff912cf1d9a05693a7aeaa6..dddf38b757e84f91609c04ae10e82f229587cba0 100644 --- a/swagger/api-database.yaml +++ b/swagger/api-database.yaml @@ -72,24 +72,197 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/DatabaseDto' + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/access/{username}: + put: + tags: + - access-endpoint + summary: Modify access to some database + operationId: update + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + - name: username + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseModifyAccessDto' + required: true + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "417": description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - $ref: '#/components/schemas/DatabaseDto' + type: object + security: + - bearerAuth: [] + delete: + tags: + - access-endpoint + summary: Revoke access to some database + operationId: update_1 + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + - name: username + in: path + required: true + schema: + type: string + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: object security: - bearerAuth: [] /api/container/{id}/database: @@ -136,8 +309,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -148,6 +321,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -205,24 +384,187 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/DatabaseBriefDto' + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/access: + get: + tags: + - access-endpoint + summary: Check access to some database + operationId: find + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/DatabaseAccessDto' + security: + - bearerAuth: [] + post: + tags: + - access-endpoint + summary: Give access to some database + operationId: create_1 + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseGiveAccessDto' + required: true + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "417": description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - $ref: '#/components/schemas/DatabaseBriefDto' + type: object security: - bearerAuth: [] /api/container/{id}/database/{databaseId}: @@ -275,8 +617,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -287,6 +629,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -344,8 +692,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -356,6 +704,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -408,8 +762,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -420,6 +774,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -551,10 +911,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -571,17 +929,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -591,13 +952,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -609,9 +987,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -627,12 +1002,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -648,7 +1027,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -697,8 +1075,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -1147,15 +1523,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -1167,6 +1541,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -1174,9 +1551,8 @@ components: example: air_quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -1187,6 +1563,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -1199,22 +1579,24 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true UserDto: required: - email - email_verified - id + - roles - theme_dark - username type: object @@ -1242,6 +1624,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: @@ -1268,6 +1658,17 @@ components: email_verified: type: boolean example: true + DatabaseModifyAccessDto: + required: + - type + type: object + properties: + type: + type: string + enum: + - read + - write_own + - write_all DatabaseCreateDto: required: - is_public @@ -1321,7 +1722,7 @@ components: type: string example: Air Quality in Austria identifier: - $ref: '#/components/schemas/IdentifierBriefDto' + $ref: '#/components/schemas/IdentifierDto' engine: type: string example: mariadb:10.5 @@ -1335,43 +1736,20 @@ components: is_public: type: boolean example: true - IdentifierBriefDto: + DatabaseGiveAccessDto: required: - - container id - - database id - - title - type + - username type: object properties: - id: - type: integer - format: int64 - title: + username: type: string - example: "Airquality Stephansplatz, Vienna, Austria" type: type: string enum: - - database - - subset - created: - type: string - format: date-time - container id: - type: integer - format: int64 - example: 1 - database id: - type: integer - format: int64 - example: 1 - query id: - type: integer - format: int64 - example: 1 - last_modified: - type: string - format: date-time + - read + - write_own + - write_all securitySchemes: bearerAuth: type: http diff --git a/swagger/api-identifier.yaml b/swagger/api-identifier.yaml index 120e774b525f97f349e563b828bb73b73a14c1f8..8aedd6ba273aef6e32b0c08bbd04d84a0c8e662e 100644 --- a/swagger/api-identifier.yaml +++ b/swagger/api-identifier.yaml @@ -17,62 +17,6 @@ servers: description: Generated server url paths: /api/identifier/{id}: - get: - tags: - - identifier-endpoint - summary: Export some identifier metadata - operationId: export - parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 - responses: - "404": - description: Not Found - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Bad Request - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "200": - description: OK - content: - '*/*': - schema: - type: string - format: binary put: tags: - identifier-endpoint @@ -80,7 +24,7 @@ paths: operationId: update parameters: - name: id - in: query + in: path required: true schema: type: integer @@ -139,11 +83,11 @@ paths: delete: tags: - identifier-endpoint - summary: Delete some identifer + summary: Delete some identifier operationId: delete parameters: - name: id - in: query + in: path required: true schema: type: integer @@ -467,65 +411,22 @@ components: code: type: string example: error.container.notfound - ContainerDto: - required: - - created - - hash - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - hash: - type: string - example: f829dd8a884182d0da846f365dee1221fd16610a14c81b8f9f295ff162749e50 - name: - type: string - example: Air Quality - state: - type: string - example: running - enum: - - created - - restarting - - running - - paused - - exited - - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' - image: - $ref: '#/components/schemas/ImageBriefDto' - port: - type: integer - format: int32 - created: - type: string - format: date-time - example: 2021-03-12T15:26:21.678396092Z - internal_name: - type: string - example: air-quality - ip_address: - type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: type: string - example: "Carberry, Josiah" + example: Josiah + lastname: + type: string + example: Carberry affiliation: type: string example: Wesleyan University @@ -535,64 +436,12 @@ components: created: type: string format: date-time - last_modified: + lastModified: type: string format: date-time - DatabaseDto: - required: - - creator - - exchange - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: Air Quality - exchange: - type: string - example: air_quality - creator: - $ref: '#/components/schemas/UserBriefDto' - identifier: - $ref: '#/components/schemas/IdentifierDto' - description: - type: string - example: Weather Australia 2009-2021 - tables: - type: array - items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' - created: - type: string - format: date-time - deleted: - type: string - format: date-time - internal_name: - type: string - example: weather_australia - is_public: - type: boolean - example: true - GrantedAuthorityDto: - type: object - properties: - authority: - type: string - example: ROLE_RESEARCHER IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -641,8 +490,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -883,126 +730,6 @@ components: last_modified: type: string format: date-time - ImageBriefDto: - required: - - id - - repository - - tag - type: object - properties: - id: - type: integer - format: int64 - repository: - type: string - example: mariadb - tag: - type: string - example: "10.5" - ImageDateDto: - required: - - database_format - - example - - has_time - - id - - unix_format - type: object - properties: - id: - type: integer - format: int64 - example: - type: string - example: 30.01.2022 - database_format: - type: string - example: '%d.%c.%Y' - unix_format: - type: string - example: dd.MM.YYYY - has_time: - type: boolean - example: false - created_at: - type: string - format: date-time - ImageDto: - required: - - default_port - - dialect - - driver_class - - environment - - id - - jdbc_method - - repository - - tag - type: object - properties: - id: - type: integer - format: int64 - repository: - type: string - example: mariadb - tag: - type: string - example: "10.5" - dialect: - type: string - example: org.hibernate.dialect.MariaDBDialect - hash: - type: string - example: sha256:c5ec7353d87dfc35067e7bffeb25d6a0d52dad41e8b7357213e3b12d6e7ff78e - compiled: - type: string - format: date-time - example: 2021-03-12T15:26:21.678396092Z - size: - type: integer - example: 314295447 - environment: - type: array - items: - $ref: '#/components/schemas/ImageEnvItemDto' - driver_class: - type: string - example: org.mariadb.jdbc.Driver - date_formats: - type: array - items: - $ref: '#/components/schemas/ImageDateDto' - jdbc_method: - type: string - example: mariadb - default_port: - type: integer - format: int32 - example: 3306 - ImageEnvItemDto: - required: - - iid - - key - - type - - value - type: object - properties: - iid: - type: integer - format: int64 - key: - type: string - example: MARIADB_ROOT_PASSWORD - value: - type: string - example: mariadb - type: - type: string - example: PRIVILEGED_PASSWORD - enum: - - username - - password - - privileged_username - - privileged_password LicenseDto: required: - identifier @@ -1091,135 +818,21 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time - TableBriefDto: - required: - - creator - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: Air Quality - creator: - $ref: '#/components/schemas/UserBriefDto' - internal_name: - type: string - example: air_quality - UserBriefDto: - required: - - email_verified - - id - - theme_dark - - username - type: object - properties: - id: - type: integer - format: int64 - username: - type: string - description: Only contains lowercase characters - example: user - firstname: - type: string - example: Josiah - lastname: - type: string - example: Carberry - affiliation: - type: string - example: Brown University - orcid: - type: string - example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: - type: boolean - example: true - email_verified: - type: boolean - example: true - UserDto: + CreatorCreateDto: required: - - email - - email_verified - - id - - theme_dark - - username + - firstname + - lastname type: object properties: - id: - type: integer - format: int64 - authorities: - type: array - items: - $ref: '#/components/schemas/GrantedAuthorityDto' - username: - type: string - description: Only contains lowercase characters - example: jcarberry firstname: type: string example: Josiah lastname: type: string example: Carberry - affiliation: - type: string - example: Brown University - orcid: - type: string - example: 0000-0002-1825-0097 - containers: - type: array - items: - $ref: '#/components/schemas/ContainerDto' - databases: - type: array - items: - $ref: '#/components/schemas/ContainerDto' - identifiers: - type: array - items: - $ref: '#/components/schemas/ContainerDto' - email: - type: string - example: jcarberry@brown.edu - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: - type: boolean - example: true - email_verified: - type: boolean - example: true - CreatorCreateDto: - required: - - name - type: object - properties: - name: - type: string - example: "Carberry, Josiah" affiliation: type: string example: Wesleyan University diff --git a/swagger/api-metadata.yaml b/swagger/api-metadata.yaml index cfae26f6afcd8cb5a9da489c97eb0bbdb0bf18e8..464eeaa7c19d1402a59f00be03dfab3440704112 100644 --- a/swagger/api-metadata.yaml +++ b/swagger/api-metadata.yaml @@ -149,11 +149,11 @@ components: type: string resumptionToken: type: string - parametersString: - type: string fromDate: type: string format: date-time untilDate: type: string format: date-time + parametersString: + type: string diff --git a/swagger/api-query.yaml b/swagger/api-query.yaml index a215efed2ff48a042cba6cbe17c2a38b2e2de861..78da736748dd3f2063b66594ef30b604efe79527 100644 --- a/swagger/api-query.yaml +++ b/swagger/api-query.yaml @@ -42,8 +42,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -66,6 +66,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -119,8 +125,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -143,6 +149,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -228,8 +240,8 @@ paths: schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -252,6 +264,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -309,8 +327,8 @@ paths: $ref: '#/components/schemas/TableCsvUpdateDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -333,6 +351,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -386,8 +410,8 @@ paths: $ref: '#/components/schemas/TableCsvDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -410,6 +434,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -463,8 +493,8 @@ paths: $ref: '#/components/schemas/TableCsvDeleteDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -487,6 +517,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -565,8 +601,8 @@ paths: schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -589,6 +625,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -615,12 +657,12 @@ paths: $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query: + /api/container/{id}/database/{databaseId}/query/{queryId}: get: tags: - store-endpoint - summary: Find queries - operationId: findAll_2 + summary: Find some query + operationId: find_1 parameters: - name: id in: path @@ -634,14 +676,15 @@ paths: schema: type: integer format: int64 - - name: persisted - in: query - required: false + - name: queryId + in: path + required: true schema: - type: boolean + type: integer + format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -664,6 +707,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -687,16 +736,14 @@ paths: content: '*/*': schema: - type: array - items: - $ref: '#/components/schemas/QueryBriefDto' + $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] put: tags: - - query-endpoint - summary: Execute query - operationId: execute + - store-endpoint + summary: Persist some query + operationId: persist parameters: - name: id in: path @@ -710,40 +757,15 @@ paths: schema: type: integer format: int64 - - name: page - in: query - required: false - schema: - type: integer - format: int64 - - name: size - in: query - required: false + - name: queryId + in: path + required: true schema: type: integer format: int64 - - name: sortDirection - in: query - required: false - schema: - type: string - enum: - - asc - - desc - - name: sortColumn - in: query - required: false - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExecuteStatementDto' - required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -766,6 +788,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -789,15 +817,15 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryResultDto' + $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query/{queryId}: + /api/container/{id}/database/{databaseId}/view: get: tags: - - store-endpoint - summary: Find some query - operationId: find + - view-endpoint + summary: Find all views + operationId: findAll parameters: - name: id in: path @@ -811,15 +839,9 @@ paths: schema: type: integer format: int64 - - name: queryId - in: path - required: true - schema: - type: integer - format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -842,6 +864,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -865,14 +893,16 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryDto' + type: array + items: + $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] - put: + post: tags: - - store-endpoint - summary: Persist some query - operationId: persist + - view-endpoint + summary: Create a view + operationId: create parameters: - name: id in: path @@ -886,15 +916,15 @@ paths: schema: type: integer format: int64 - - name: queryId - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ViewCreateDto' required: true - schema: - type: integer - format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -917,6 +947,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -940,15 +976,15 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryDto' + $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/view: - get: + /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: + post: tags: - - view-endpoint - summary: Find all views - operationId: findAll + - table-data-endpoint + summary: Insert data from csv + operationId: importCsv parameters: - name: id in: path @@ -962,9 +998,21 @@ paths: schema: type: integer format: int64 + - name: tableId + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImportDto' + required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -987,6 +1035,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1007,19 +1061,14 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] - post: + /api/container/{id}/database/{databaseId}/query: + get: tags: - - view-endpoint - summary: Create a view - operationId: create + - store-endpoint + summary: Find queries + operationId: findAll_1 parameters: - name: id in: path @@ -1033,15 +1082,14 @@ paths: schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ViewCreateDto' - required: true + - name: persisted + in: query + required: false + schema: + type: boolean responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1064,6 +1112,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1087,15 +1141,16 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/ViewBriefDto' + type: array + items: + $ref: '#/components/schemas/QueryBriefDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: post: tags: - - table-data-endpoint - summary: Insert data from csv - operationId: importCsv + - query-endpoint + summary: Execute query + operationId: execute parameters: - name: id in: path @@ -1109,21 +1164,40 @@ paths: schema: type: integer format: int64 - - name: tableId - in: path - required: true + - name: page + in: query + required: false schema: type: integer format: int64 + - name: size + in: query + required: false + schema: + type: integer + format: int64 + - name: sortDirection + in: query + required: false + schema: + type: string + enum: + - asc + - desc + - name: sortColumn + in: query + required: false + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/ImportDto' + $ref: '#/components/schemas/ExecuteStatementDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1146,6 +1220,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1166,6 +1246,10 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] /api/container/{id}/database/{databaseId}/view/{viewId}: @@ -1173,7 +1257,7 @@ paths: tags: - view-endpoint summary: Find one view - operationId: findAll_1 + operationId: find parameters: - name: id in: path @@ -1194,8 +1278,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1218,6 +1302,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1269,8 +1359,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1293,6 +1383,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1357,8 +1453,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1381,6 +1477,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1439,8 +1541,8 @@ paths: type: string format: date-time responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1463,6 +1565,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1515,14 +1623,14 @@ paths: schema: type: integer format: int64 - - name: download - in: query - required: false + - name: Accept + in: header + required: true schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1545,6 +1653,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1622,8 +1736,8 @@ paths: schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1646,6 +1760,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1808,14 +1928,6 @@ components: type: object additionalProperties: type: object - ExecuteStatementDto: - required: - - statement - type: object - properties: - statement: - type: string - example: SELECT `id` FROM `air_quality` ContainerDto: required: - created @@ -1844,10 +1956,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -1864,17 +1974,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -1884,13 +1997,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -1902,9 +2032,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -1920,12 +2047,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -1941,7 +2072,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -1990,8 +2120,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -2494,15 +2622,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -2514,6 +2640,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -2521,9 +2650,8 @@ components: example: air_quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -2534,6 +2662,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -2546,22 +2678,24 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true UserDto: required: - email - email_verified - id + - roles - theme_dark - username type: object @@ -2589,6 +2723,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: @@ -2636,6 +2778,8 @@ components: - created - created_by - id + - internalName + - name - query - vdbid type: object @@ -2649,15 +2793,15 @@ components: name: type: string example: Air Quality + internalName: + type: string + example: air_quality query: type: string example: SELECT `id` FROM `air_quality` ORDER BY `value` DESC created: type: string format: date-time - deleted: - type: string - format: date-time is_public: type: boolean example: true @@ -2706,12 +2850,21 @@ components: null_element: type: string example: NA + ExecuteStatementDto: + required: + - statement + type: object + properties: + statement: + type: string + example: SELECT `id` FROM `air_quality` ViewDto: required: - created - creator - database - id + - internalName - name - query - vdbid @@ -2730,15 +2883,15 @@ components: name: type: string example: Air Quality + internalName: + type: string + example: air_quality query: type: string example: SELECT `id` FROM `air_quality` ORDER BY `value` DESC created: type: string format: date-time - deleted: - type: string - format: date-time is_public: type: boolean example: true diff --git a/swagger/api-semantics.yaml b/swagger/api-semantics.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e813438f15157b3a207c52d54551e19f07318975 --- /dev/null +++ b/swagger/api-semantics.yaml @@ -0,0 +1 @@ +{"definitions":{},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service for assigning concepts to database tables and columns.","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Unit / Ontology Service API","version":"1.1.0-alpha"},"openapi":"3.0.0","paths":{"/api/semantics/concept":{"get":{"consumes":["application/json"],"description":"This is a simple API which returns a list of suggested concepts.","parameters":[{"description":"The query to retrieve a fitting concept","in":"query","name":"q","schema":{"type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Suggest a concept","tags":["concepts-endpoint"]},"post":{"consumes":["application/json"],"description":"This is a simple API for saving concept","produces":["application/json"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"example":"metre","type":"string"},"uri":{"example":"http://www.ontology-of-units-of-measure.org/resource/om-2/metre","type":"string"}},"required":["uri","name"],"type":"object"}}}},"responses":{"200":{"description":"OK"},"201":{"description":"Created"},"405":{"description":"Invalid input"},"409":{"description":"Concept already present"}},"summary":"Save concept to MDB","tags":["concepts-endpoint"]}},"/api/semantics/concept/{concept}/validate":{"get":{"consumes":["application/json"],"description":"This is a simple API for validating concepts.","parameters":[{"description":"Validates concepts against om-2.","in":"path","name":"unit","required":true,"schema":{"example":"distance","type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Validate concepts","tags":["concepts-endpoint"]}},"/api/semantics/ontology":{"get":{"consumes":["application/json"],"description":"This is a simple API for listing all ontologies (.nt, .ttl files) used in DB-Repo.","produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"List ontologies","tags":["ontologies-endpoint"]}},"/api/semantics/ontology/{name}":{"get":{"consumes":["application/json"],"description":"This is a simple API for getting a certain ontologies (.nt, .ttl files) stored in DB-Repo.","parameters":[{"in":"path","name":"o_name","required":true,"schema":{"example":"VOCAB_QUDT-UNITS-ALL-v2.1","type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"},"405":{"description":"Invalid input"}},"summary":"Get ontology","tags":["ontologies-endpoint"]}},"/api/semantics/unit":{"get":{"consumes":["application/json"],"description":"This is a simple API which returns a list of suggested units.","parameters":[{"description":"The query to retrieve a fitting unit","in":"query","name":"q","schema":{"type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Suggest a unit","tags":["units-endpoint"]},"post":{"consumes":["application/json"],"description":"This is a simple API for saving units","produces":["application/json"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"example":"second","type":"string"},"uri":{"example":"http://www.ontology-of-units-of-measure.org/resource/om-2/second-Time","type":"string"}},"required":["uri","name"],"type":"object"}}}},"responses":{"200":{"description":"OK"},"201":{"description":"Created"},"405":{"description":"Invalid input"},"409":{"description":"Concept already present"}},"summary":"Save unit to MDB","tags":["units-endpoint"]}},"/api/semantics/unit/{unit}/validate":{"get":{"consumes":["application/json"],"description":"This is a simple API for validating units.","parameters":[{"description":"Validates unit against om-2.","in":"path","name":"unit","required":true,"schema":{"example":"metre","type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Validate units","tags":["units-endpoint"]}}},"servers":[{"description":"Generated server url","url":"http://localhost:5010"},{"description":"DBRepo Production Server","url":"https://dbrepo1.ec.tuwien.ac.at/api/units"}]} diff --git a/swagger/api-table.yaml b/swagger/api-table.yaml index 1624286e82cd5b8b59b7c5712bbc71f165e6f818..372f3dc894dd7b08838d0da1a7ba98b6eadd5a47 100644 --- a/swagger/api-table.yaml +++ b/swagger/api-table.yaml @@ -16,12 +16,12 @@ servers: - url: http://localhost:9094 description: Generated server url paths: - /api/container/{id}/database/{databaseId}/table/{tableId}: - get: + /api/container/{id}/database/{databaseId}/table/{tableId}/column/{columnId}: + put: tags: - - table-endpoint - summary: Get information about table - operationId: findById + - table-column-endpoint + summary: Update a table column semantic mapping + operationId: update parameters: - name: id in: path @@ -41,6 +41,18 @@ paths: schema: type: integer format: int64 + - name: columnId + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ColumnSemanticsUpdateDto' + required: true responses: "400": description: Bad Request @@ -77,14 +89,15 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/TableDto' + $ref: '#/components/schemas/ColumnDto' security: - bearerAuth: [] - put: + /api/container/{id}/database/{databaseId}/table: + get: tags: - table-endpoint - summary: Update a table - operationId: update + summary: List all tables + operationId: list parameters: - name: id in: path @@ -98,12 +111,71 @@ paths: schema: type: integer format: int64 - - name: tableId + responses: + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/TableBriefDto' + security: + - bearerAuth: [] + post: + tags: + - table-endpoint + summary: Create a table + operationId: create + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId in: path required: true schema: type: integer format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TableCreateDto' + required: true responses: "400": description: Bad Request @@ -143,11 +215,12 @@ paths: $ref: '#/components/schemas/TableBriefDto' security: - bearerAuth: [] - delete: + /api/container/{id}/database/{databaseId}/table/{tableId}: + get: tags: - table-endpoint - summary: Delete a table - operationId: delete + summary: Get information about table + operationId: findById parameters: - name: id in: path @@ -200,14 +273,17 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/TableDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table: - get: + delete: tags: - table-endpoint - summary: List all tables - operationId: list + summary: Delete a table + operationId: delete parameters: - name: id in: path @@ -221,6 +297,12 @@ paths: schema: type: integer format: int64 + - name: tableId + in: path + required: true + schema: + type: integer + format: int64 responses: "400": description: Bad Request @@ -254,19 +336,14 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/TableBriefDto' security: - bearerAuth: [] - post: + /api/container/{id}/database/{databaseId}/table/{tableId}/access: + get: tags: - - table-endpoint - summary: Create a table - operationId: create + - access-endpoint + summary: Check access to some table + operationId: checkAccess parameters: - name: id in: path @@ -280,12 +357,12 @@ paths: schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TableCreateDto' + - name: tableId + in: path required: true + schema: + type: integer + format: int64 responses: "400": description: Bad Request @@ -322,7 +399,7 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/TableBriefDto' + $ref: '#/components/schemas/DatabaseAccessDto' security: - bearerAuth: [] components: @@ -412,128 +489,13 @@ components: code: type: string example: error.container.notfound - TableBriefDto: - required: - - creator - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: Air Quality - creator: - $ref: '#/components/schemas/UserBriefDto' - internal_name: - type: string - example: air_quality - UserBriefDto: - required: - - email_verified - - id - - theme_dark - - username - type: object - properties: - id: - type: integer - format: int64 - username: - type: string - description: Only contains lowercase characters - example: user - firstname: - type: string - example: Josiah - lastname: - type: string - example: Carberry - affiliation: - type: string - example: Brown University - orcid: - type: string - example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: - type: boolean - example: true - email_verified: - type: boolean - example: true - ColumnCreateDto: - required: - - name - - null_allowed - - primary_key - - type - - unique - type: object - properties: - name: - type: string - example: Date - type: - type: string - example: string - enum: - - enum - - number - - decimal - - string - - text - - boolean - - date - - timestamp - - blob - dfid: - type: integer - description: date format id - format: int64 - unique: - type: boolean - example: false - references: - type: string - primary_key: - type: boolean - example: false - null_allowed: - type: boolean - example: true - check_expression: - type: string - foreign_key: - type: string - enum_values: - type: array - items: - type: string - TableCreateDto: - required: - - columns - - description - - name + ColumnSemanticsUpdateDto: type: object properties: - name: + concept_uri: type: string - example: Air Quality - description: + unit_uri: type: string - example: Air Quality in Austria - columns: - type: array - items: - $ref: '#/components/schemas/ColumnCreateDto' ColumnDto: required: - auto_generated @@ -552,6 +514,10 @@ components: name: type: string example: Date + concept: + $ref: '#/components/schemas/ConceptDto' + unit: + $ref: '#/components/schemas/UnitDto' unique: type: boolean example: true @@ -581,8 +547,6 @@ components: - date - timestamp - blob - column_concept: - $ref: '#/components/schemas/ConceptDto' is_null_allowed: type: boolean example: false @@ -635,15 +599,98 @@ components: created_at: type: string format: date-time - TableDto: + UnitDto: required: - - columns - - creator - - description - - id + - created + - name + - uri + type: object + properties: + uri: + type: string + name: + type: string + created: + type: string + format: date-time + ColumnCreateDto: + required: + - name + - null_allowed + - primary_key + - type + - unique + type: object + properties: + name: + type: string + example: Date + type: + type: string + example: string + enum: + - enum + - number + - decimal + - string + - text + - boolean + - date + - timestamp + - blob + dfid: + type: integer + description: date format id + format: int64 + unique: + type: boolean + example: false + references: + type: string + description: "foreign key reference, only considered when foreignKey !=\ + \ null" + primary_key: + type: boolean + example: false + null_allowed: + type: boolean + example: true + check_expression: + type: string + description: check constraint + example: id > 0 + foreign_key: + type: string + enum_values: + type: array + description: "enum values, only considered when type = ENUM" + items: + type: string + description: "enum values, only considered when type = ENUM" + TableCreateDto: + required: + - columns + - description + - name + type: object + properties: + name: + type: string + example: Air Quality + description: + type: string + example: Air Quality in Austria + columns: + type: array + items: + $ref: '#/components/schemas/ColumnCreateDto' + TableBriefDto: + required: + - creator + - description + - id - internal_name - name - - topic type: object properties: id: @@ -652,11 +699,76 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' - topic: + internal_name: type: string example: air_quality + UserBriefDto: + required: + - id + - roles + - username + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + description: Only contains lowercase characters + example: user + titlesBefore: + type: string + titlesAfter: + type: string + firstname: + type: string + example: Josiah + lastname: + type: string + example: Carberry + affiliation: + type: string + example: Brown University + orcid: + type: string + example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: + type: boolean + emailVerified: + type: boolean + TableDto: + required: + - columns + - creator + - description + - id + - internal_name + - name + - queue_name + - routing_key + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: Air Quality + creator: + $ref: '#/components/schemas/UserBriefDto' description: type: string example: Air Quality in Austria @@ -670,6 +782,695 @@ components: internal_name: type: string example: air_quality + queue_name: + type: string + example: dbrepo/4/4/2 + routing_key: + type: string + example: dbrepo/4/4/2/1 + ContainerDto: + required: + - created + - hash + - id + - internal_name + - name + type: object + properties: + id: + type: integer + format: int64 + hash: + type: string + example: f829dd8a884182d0da846f365dee1221fd16610a14c81b8f9f295ff162749e50 + name: + type: string + example: Air Quality + state: + type: string + example: running + enum: + - created + - restarting + - running + - paused + - exited + - dead + database: + $ref: '#/components/schemas/DatabaseDto' + image: + $ref: '#/components/schemas/ImageBriefDto' + port: + type: integer + format: int32 + created: + type: string + format: date-time + example: 2021-03-12T15:26:21.678396092Z + internal_name: + type: string + example: air-quality + ip_address: + type: string + CreatorDto: + required: + - firstname + - id + - lastname + type: object + properties: + id: + type: integer + format: int64 + firstname: + type: string + example: Josiah + lastname: + type: string + example: Carberry + affiliation: + type: string + example: Wesleyan University + orcid: + type: string + example: 0000-0002-1825-0097 + created: + type: string + format: date-time + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: + type: string + format: date-time + DatabaseDto: + required: + - creator + - exchange_name + - id + - internal_name + - name + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: Air Quality + creator: + $ref: '#/components/schemas/UserBriefDto' + identifier: + $ref: '#/components/schemas/IdentifierDto' + description: + type: string + example: Weather Australia 2009-2021 + tables: + type: array + items: + $ref: '#/components/schemas/TableBriefDto' + image: + $ref: '#/components/schemas/ImageDto' + container: + $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' + created: + type: string + format: date-time + exchange_name: + type: string + example: dbrepo/4/4 + internal_name: + type: string + example: weather_australia + is_public: + type: boolean + example: true + GrantedAuthorityDto: + type: object + properties: + authority: + type: string + example: ROLE_RESEARCHER + IdentifierDto: + required: + - container id + - creators + - database id + - execution + - publication_year + - query + - query_hash + - query_normalized + - result_hash + - result_number + - title + - type + - visibility + type: object + properties: + id: + type: integer + format: int64 + type: + type: string + enum: + - database + - subset + title: + type: string + example: "Airquality Stephansplatz, Vienna, Austria" + description: + type: string + example: "Air quality reports at Stephansplatz, Vienna" + query: + type: string + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + execution: + type: string + format: date-time + visibility: + type: string + example: everyone + enum: + - everyone + - trusted + - self + doi: + type: string + example: 10.1038/nphys1170 + publisher: + type: string + example: TU Wien + language: + type: string + enum: + - ab + - aa + - af + - ak + - sq + - am + - ar + - an + - hy + - as + - av + - ae + - ay + - az + - bm + - ba + - eu + - be + - bn + - bh + - bi + - bs + - br + - bg + - my + - ca + - km + - ch + - ce + - ny + - zh + - cu + - cv + - kw + - co + - cr + - hr + - cs + - da + - dv + - nl + - dz + - en + - eo + - et + - ee + - fo + - fj + - fi + - fr + - ff + - gd + - gl + - lg + - ka + - de + - ki + - el + - kl + - gn + - gu + - ht + - ha + - he + - hz + - hi + - ho + - hu + - is + - io + - ig + - id + - ia + - ie + - iu + - ik + - ga + - it + - ja + - jv + - kn + - kr + - ks + - kk + - rw + - kv + - kg + - ko + - kj + - ku + - ky + - lo + - la + - lv + - lb + - li + - ln + - lt + - lu + - mk + - mg + - ms + - ml + - mt + - gv + - mi + - mr + - mh + - ro + - mn + - na + - nv + - nd + - ng + - ne + - se + - "no" + - nb + - nn + - ii + - oc + - oj + - or + - om + - os + - pi + - pa + - ps + - fa + - pl + - pt + - qu + - rm + - rn + - ru + - sm + - sg + - sa + - sc + - sr + - sn + - sd + - si + - sk + - sl + - so + - st + - nr + - es + - su + - sw + - ss + - sv + - tl + - ty + - tg + - ta + - tt + - te + - th + - bo + - ti + - to + - ts + - tn + - tr + - tk + - tw + - ug + - uk + - ur + - uz + - ve + - vi + - vo + - wa + - cy + - fy + - wo + - xh + - yi + - yo + - za + - zu + license: + $ref: '#/components/schemas/LicenseDto' + creators: + type: array + items: + $ref: '#/components/schemas/CreatorDto' + created: + type: string + format: date-time + container id: + type: integer + format: int64 + example: 1 + database id: + type: integer + format: int64 + example: 1 + query id: + type: integer + format: int64 + example: 1 + query_normalized: + type: string + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + related: + type: array + items: + $ref: '#/components/schemas/RelatedIdentifierDto' + query_hash: + type: string + description: query hash in sha512 + result_hash: + type: string + result_number: + type: integer + format: int64 + example: 1 + publication_day: + type: integer + format: int32 + example: 15 + publication_month: + type: integer + format: int32 + example: 12 + publication_year: + type: integer + format: int32 + example: 2022 + last_modified: + type: string + format: date-time + ImageBriefDto: + required: + - id + - repository + - tag + type: object + properties: + id: + type: integer + format: int64 + repository: + type: string + example: mariadb + tag: + type: string + example: "10.5" + ImageDto: + required: + - default_port + - dialect + - driver_class + - environment + - id + - jdbc_method + - repository + - tag + type: object + properties: + id: + type: integer + format: int64 + repository: + type: string + example: mariadb + tag: + type: string + example: "10.5" + dialect: + type: string + example: org.hibernate.dialect.MariaDBDialect + hash: + type: string + example: sha256:c5ec7353d87dfc35067e7bffeb25d6a0d52dad41e8b7357213e3b12d6e7ff78e + compiled: + type: string + format: date-time + example: 2021-03-12T15:26:21.678396092Z + size: + type: integer + example: 314295447 + environment: + type: array + items: + $ref: '#/components/schemas/ImageEnvItemDto' + driver_class: + type: string + example: org.mariadb.jdbc.Driver + date_formats: + type: array + items: + $ref: '#/components/schemas/ImageDateDto' + jdbc_method: + type: string + example: mariadb + default_port: + type: integer + format: int32 + example: 3306 + ImageEnvItemDto: + required: + - iid + - key + - type + - value + type: object + properties: + iid: + type: integer + format: int64 + key: + type: string + example: MARIADB_ROOT_PASSWORD + value: + type: string + example: mariadb + type: + type: string + example: PRIVILEGED_PASSWORD + enum: + - username + - password + - privileged_username + - privileged_password + LicenseDto: + required: + - identifier + - uri + type: object + properties: + identifier: + type: string + example: MIT + uri: + type: string + example: https://opensource.org/licenses/MIT + RelatedIdentifierDto: + required: + - created + - id + - value + type: object + properties: + id: + type: integer + format: int64 + value: + type: string + example: 10.70124/dc4zh-9ce78 + type: + type: string + example: DOI + enum: + - DOI + - URL + - URN + - ARK + - arXiv + - bibcode + - EAN13 + - EISSN + - Handle + - IGSN + - ISBN + - ISTC + - LISSN + - LSID + - PMID + - PURL + - UPC + - w3id + relation: + type: string + example: Cites + enum: + - IsCitedBy + - Cites + - IsSupplementTo + - IsSupplementedBy + - IsContinuedBy + - Continues + - IsDescribedBy + - Describes + - HasMetadata + - IsMetadataFor + - HasVersion + - IsVersionOf + - IsNewVersionOf + - IsPreviousVersionOf + - IsPartOf + - HasPart + - IsPublishedIn + - IsReferencedBy + - References + - IsDocumentedBy + - Documents + - IsCompiledBy + - Compiles + - IsVariantFormOf + - IsOriginalFormOf + - IsIdenticalTo + - IsReviewedBy + - Reviews + - IsDerivedFrom + - IsSourceOf + - IsRequiredBy + - Requires + - IsObsoletedBy + - Obsoletes + created: + type: string + format: date-time + last_modified: + type: string + format: date-time + UserDto: + required: + - email + - email_verified + - id + - roles + - theme_dark + - username + type: object + properties: + id: + type: integer + format: int64 + authorities: + type: array + items: + $ref: '#/components/schemas/GrantedAuthorityDto' + username: + type: string + description: Only contains lowercase characters + example: jcarberry + firstname: + type: string + example: Josiah + lastname: + type: string + example: Carberry + affiliation: + type: string + example: Brown University + orcid: + type: string + example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + containers: + type: array + items: + $ref: '#/components/schemas/ContainerDto' + databases: + type: array + items: + $ref: '#/components/schemas/ContainerDto' + identifiers: + type: array + items: + $ref: '#/components/schemas/ContainerDto' + email: + type: string + example: jcarberry@brown.edu + titles_before: + type: string + example: Prof. + titles_after: + type: string + theme_dark: + type: boolean + example: true + email_verified: + type: boolean + example: true securitySchemes: bearerAuth: type: http diff --git a/swagger/api/api_authentication/__init__.py b/swagger/api/api_authentication/__init__.py index b0babf029dd738c8a08ae3f2360b6b3a5e0cdfec..c88ae78f688f281f4b227a9500f3890047d89269 100644 --- a/swagger/api/api_authentication/__init__.py +++ b/swagger/api/api_authentication/__init__.py @@ -26,6 +26,7 @@ from api_authentication.configuration import Configuration from api_authentication.models.api_error_dto import ApiErrorDto from api_authentication.models.container_dto import ContainerDto from api_authentication.models.creator_dto import CreatorDto +from api_authentication.models.database_access_dto import DatabaseAccessDto from api_authentication.models.database_dto import DatabaseDto from api_authentication.models.granted_authority_dto import GrantedAuthorityDto from api_authentication.models.identifier_dto import IdentifierDto diff --git a/swagger/api/api_authentication/api/token_endpoint_api.py b/swagger/api/api_authentication/api/token_endpoint_api.py index 554d4694bc844a7c21578b1f7b4446e28a311dc9..134c5c1398dda6f20a5254088827a54a88eb841c 100644 --- a/swagger/api/api_authentication/api/token_endpoint_api.py +++ b/swagger/api/api_authentication/api/token_endpoint_api.py @@ -117,43 +117,43 @@ class TokenEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def delete(self, hash, **kwargs): # noqa: E501 + def delete(self, id, **kwargs): # noqa: E501 """Delete developer token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete(hash, async_req=True) + >>> thread = api.delete(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str hash: (required) + :param int id: (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.delete_with_http_info(hash, **kwargs) # noqa: E501 + return self.delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.delete_with_http_info(hash, **kwargs) # noqa: E501 + (data) = self.delete_with_http_info(id, **kwargs) # noqa: E501 return data - def delete_with_http_info(self, hash, **kwargs): # noqa: E501 + def delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete developer token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_with_http_info(hash, async_req=True) + >>> thread = api.delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool - :param str hash: (required) + :param int id: (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['hash'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -168,16 +168,16 @@ class TokenEndpointApi(object): ) params[key] = val del params['kwargs'] - # verify the required parameter 'hash' is set - if ('hash' not in params or - params['hash'] is None): - raise ValueError("Missing the required parameter `hash` when calling `delete`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete`") # noqa: E501 collection_formats = {} path_params = {} - if 'hash' in params: - path_params['hash'] = params['hash'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] @@ -195,7 +195,7 @@ class TokenEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/user/token/{hash}', 'DELETE', + '/api/user/token/{id}', 'DELETE', path_params, query_params, header_params, diff --git a/swagger/api/api_authentication/models/__init__.py b/swagger/api/api_authentication/models/__init__.py index ba53b0f5ea004397009f41a1e85b17e3ac868851..62a7c8d553af228180d59ecdf8707a728d0a131d 100644 --- a/swagger/api/api_authentication/models/__init__.py +++ b/swagger/api/api_authentication/models/__init__.py @@ -17,6 +17,7 @@ from __future__ import absolute_import from api_authentication.models.api_error_dto import ApiErrorDto from api_authentication.models.container_dto import ContainerDto from api_authentication.models.creator_dto import CreatorDto +from api_authentication.models.database_access_dto import DatabaseAccessDto from api_authentication.models.database_dto import DatabaseDto from api_authentication.models.granted_authority_dto import GrantedAuthorityDto from api_authentication.models.identifier_dto import IdentifierDto diff --git a/swagger/api/api_authentication/models/container_dto.py b/swagger/api/api_authentication/models/container_dto.py index 2ee63baa6c5eb205fd79c108439fdf048c487371..df862ae7b1edf222b3c1387facbe900706520a46 100644 --- a/swagger/api/api_authentication/models/container_dto.py +++ b/swagger/api/api_authentication/models/container_dto.py @@ -32,7 +32,7 @@ class ContainerDto(object): 'hash': 'str', 'name': 'str', 'state': 'str', - 'databases': 'list[DatabaseDto]', + 'database': 'DatabaseDto', 'image': 'ImageBriefDto', 'port': 'int', 'created': 'datetime', @@ -45,7 +45,7 @@ class ContainerDto(object): 'hash': 'hash', 'name': 'name', 'state': 'state', - 'databases': 'databases', + 'database': 'database', 'image': 'image', 'port': 'port', 'created': 'created', @@ -53,13 +53,13 @@ class ContainerDto(object): 'ip_address': 'ip_address' } - def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + def __init__(self, id=None, hash=None, name=None, state=None, database=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 """ContainerDto - a model defined in Swagger""" # noqa: E501 self._id = None self._hash = None self._name = None self._state = None - self._databases = None + self._database = None self._image = None self._port = None self._created = None @@ -71,8 +71,8 @@ class ContainerDto(object): self.name = name if state is not None: self.state = state - if databases is not None: - self.databases = databases + if database is not None: + self.database = database if image is not None: self.image = image if port is not None: @@ -179,25 +179,25 @@ class ContainerDto(object): self._state = state @property - def databases(self): - """Gets the databases of this ContainerDto. # noqa: E501 + def database(self): + """Gets the database of this ContainerDto. # noqa: E501 - :return: The databases of this ContainerDto. # noqa: E501 - :rtype: list[DatabaseDto] + :return: The database of this ContainerDto. # noqa: E501 + :rtype: DatabaseDto """ - return self._databases + return self._database - @databases.setter - def databases(self, databases): - """Sets the databases of this ContainerDto. + @database.setter + def database(self, database): + """Sets the database of this ContainerDto. - :param databases: The databases of this ContainerDto. # noqa: E501 - :type: list[DatabaseDto] + :param database: The database of this ContainerDto. # noqa: E501 + :type: DatabaseDto """ - self._databases = databases + self._database = database @property def image(self): diff --git a/swagger/api/api_authentication/models/creator_dto.py b/swagger/api/api_authentication/models/creator_dto.py index c658d9f4d33230608429da34da80afea90c4fe9c..89cce124fe5576e77f2b32f88466a0dba534ac3c 100644 --- a/swagger/api/api_authentication/models/creator_dto.py +++ b/swagger/api/api_authentication/models/creator_dto.py @@ -29,7 +29,8 @@ class CreatorDto(object): """ swagger_types = { 'id': 'int', - 'name': 'str', + 'firstname': 'str', + 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', 'created': 'datetime', @@ -38,29 +39,33 @@ class CreatorDto(object): attribute_map = { 'id': 'id', - 'name': 'name', + 'firstname': 'firstname', + 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', 'created': 'created', - 'last_modified': 'last_modified' + 'last_modified': 'lastModified' } - def __init__(self, id=None, name=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, firstname=None, lastname=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 """CreatorDto - a model defined in Swagger""" # noqa: E501 self._id = None - self._name = None + self._firstname = None + self._lastname = None self._affiliation = None self._orcid = None self._created = None self._last_modified = None self.discriminator = None self.id = id - self.name = name + self.firstname = firstname + self.lastname = lastname if affiliation is not None: self.affiliation = affiliation if orcid is not None: self.orcid = orcid - self.created = created + if created is not None: + self.created = created if last_modified is not None: self.last_modified = last_modified @@ -88,27 +93,50 @@ class CreatorDto(object): self._id = id @property - def name(self): - """Gets the name of this CreatorDto. # noqa: E501 + def firstname(self): + """Gets the firstname of this CreatorDto. # noqa: E501 - :return: The name of this CreatorDto. # noqa: E501 + :return: The firstname of this CreatorDto. # noqa: E501 :rtype: str """ - return self._name + return self._firstname - @name.setter - def name(self, name): - """Sets the name of this CreatorDto. + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorDto. - :param name: The name of this CreatorDto. # noqa: E501 + :param firstname: The firstname of this CreatorDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 - self._name = name + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorDto. # noqa: E501 + + + :return: The lastname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorDto. + + + :param lastname: The lastname of this CreatorDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname @property def affiliation(self): @@ -170,8 +198,6 @@ class CreatorDto(object): :param created: The created of this CreatorDto. # noqa: E501 :type: datetime """ - if created is None: - raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 self._created = created diff --git a/swagger/api/api_authentication/models/database_access_dto.py b/swagger/api/api_authentication/models/database_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..23a8e1a53efe186098d3d5a8b7419596c4d19ecf --- /dev/null +++ b/swagger/api/api_authentication/models/database_access_dto.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Database Repository Authentication Service API + + Service that manages the authentication # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user': 'UserDto', + 'type': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'user': 'user', + 'type': 'type', + 'created': 'created' + } + + def __init__(self, user=None, type=None, created=None): # noqa: E501 + """DatabaseAccessDto - a model defined in Swagger""" # noqa: E501 + self._user = None + self._type = None + self._created = None + self.discriminator = None + self.user = user + self.type = type + if created is not None: + self.created = created + + @property + def user(self): + """Gets the user of this DatabaseAccessDto. # noqa: E501 + + + :return: The user of this DatabaseAccessDto. # noqa: E501 + :rtype: UserDto + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this DatabaseAccessDto. + + + :param user: The user of this DatabaseAccessDto. # noqa: E501 + :type: UserDto + """ + if user is None: + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + @property + def type(self): + """Gets the type of this DatabaseAccessDto. # noqa: E501 + + + :return: The type of this DatabaseAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseAccessDto. + + + :param type: The type of this DatabaseAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def created(self): + """Gets the created of this DatabaseAccessDto. # noqa: E501 + + + :return: The created of this DatabaseAccessDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseAccessDto. + + + :param created: The created of this DatabaseAccessDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_authentication/models/database_dto.py b/swagger/api/api_authentication/models/database_dto.py index 9003079cba6f9bd0d1fceebd265115c0235843d8..cfdd04170cdf03be3af44a9e0fa019fee7a7524d 100644 --- a/swagger/api/api_authentication/models/database_dto.py +++ b/swagger/api/api_authentication/models/database_dto.py @@ -30,15 +30,15 @@ class DatabaseDto(object): swagger_types = { 'id': 'int', 'name': 'str', - 'exchange': 'str', 'creator': 'UserBriefDto', 'identifier': 'IdentifierDto', 'description': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', + 'accesses': 'list[DatabaseAccessDto]', 'created': 'datetime', - 'deleted': 'datetime', + 'exchange_name': 'str', 'internal_name': 'str', 'is_public': 'bool' } @@ -46,38 +46,37 @@ class DatabaseDto(object): attribute_map = { 'id': 'id', 'name': 'name', - 'exchange': 'exchange', 'creator': 'creator', 'identifier': 'identifier', 'description': 'description', 'tables': 'tables', 'image': 'image', 'container': 'container', + 'accesses': 'accesses', 'created': 'created', - 'deleted': 'deleted', + 'exchange_name': 'exchange_name', 'internal_name': 'internal_name', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, accesses=None, created=None, exchange_name=None, internal_name=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None - self._exchange = None self._creator = None self._identifier = None self._description = None self._tables = None self._image = None self._container = None + self._accesses = None self._created = None - self._deleted = None + self._exchange_name = None self._internal_name = None self._is_public = None self.discriminator = None self.id = id self.name = name - self.exchange = exchange self.creator = creator if identifier is not None: self.identifier = identifier @@ -89,10 +88,11 @@ class DatabaseDto(object): self.image = image if container is not None: self.container = container + if accesses is not None: + self.accesses = accesses if created is not None: self.created = created - if deleted is not None: - self.deleted = deleted + self.exchange_name = exchange_name self.internal_name = internal_name if is_public is not None: self.is_public = is_public @@ -143,29 +143,6 @@ class DatabaseDto(object): self._name = name - @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 - - - :return: The exchange of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. - - - :param exchange: The exchange of this DatabaseDto. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - @property def creator(self): """Gets the creator of this DatabaseDto. # noqa: E501 @@ -294,6 +271,27 @@ class DatabaseDto(object): self._container = container + @property + def accesses(self): + """Gets the accesses of this DatabaseDto. # noqa: E501 + + + :return: The accesses of this DatabaseDto. # noqa: E501 + :rtype: list[DatabaseAccessDto] + """ + return self._accesses + + @accesses.setter + def accesses(self, accesses): + """Sets the accesses of this DatabaseDto. + + + :param accesses: The accesses of this DatabaseDto. # noqa: E501 + :type: list[DatabaseAccessDto] + """ + + self._accesses = accesses + @property def created(self): """Gets the created of this DatabaseDto. # noqa: E501 @@ -316,25 +314,27 @@ class DatabaseDto(object): self._created = created @property - def deleted(self): - """Gets the deleted of this DatabaseDto. # noqa: E501 + def exchange_name(self): + """Gets the exchange_name of this DatabaseDto. # noqa: E501 - :return: The deleted of this DatabaseDto. # noqa: E501 - :rtype: datetime + :return: The exchange_name of this DatabaseDto. # noqa: E501 + :rtype: str """ - return self._deleted + return self._exchange_name - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this DatabaseDto. + @exchange_name.setter + def exchange_name(self, exchange_name): + """Sets the exchange_name of this DatabaseDto. - :param deleted: The deleted of this DatabaseDto. # noqa: E501 - :type: datetime + :param exchange_name: The exchange_name of this DatabaseDto. # noqa: E501 + :type: str """ + if exchange_name is None: + raise ValueError("Invalid value for `exchange_name`, must not be `None`") # noqa: E501 - self._deleted = deleted + self._exchange_name = exchange_name @property def internal_name(self): diff --git a/swagger/api/api_authentication/models/identifier_dto.py b/swagger/api/api_authentication/models/identifier_dto.py index 67aa0ce33e277e75b69bb29968d425933c81c3c1..9761fc5b8405a2584edd4a2073dbcbe9f33518ea 100644 --- a/swagger/api/api_authentication/models/identifier_dto.py +++ b/swagger/api/api_authentication/models/identifier_dto.py @@ -37,7 +37,6 @@ class IdentifierDto(object): 'visibility': 'str', 'doi': 'str', 'publisher': 'str', - 'creator': 'UserDto', 'language': 'str', 'license': 'LicenseDto', 'creators': 'list[CreatorDto]', @@ -66,7 +65,6 @@ class IdentifierDto(object): 'visibility': 'visibility', 'doi': 'doi', 'publisher': 'publisher', - 'creator': 'creator', 'language': 'language', 'license': 'license', 'creators': 'creators', @@ -85,7 +83,7 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._type = None @@ -96,7 +94,6 @@ class IdentifierDto(object): self._visibility = None self._doi = None self._publisher = None - self._creator = None self._language = None self._license = None self._creators = None @@ -127,7 +124,6 @@ class IdentifierDto(object): self.doi = doi if publisher is not None: self.publisher = publisher - self.creator = creator if language is not None: self.language = language if license is not None: @@ -364,29 +360,6 @@ class IdentifierDto(object): self._publisher = publisher - @property - def creator(self): - """Gets the creator of this IdentifierDto. # noqa: E501 - - - :return: The creator of this IdentifierDto. # noqa: E501 - :rtype: UserDto - """ - return self._creator - - @creator.setter - def creator(self, creator): - """Sets the creator of this IdentifierDto. - - - :param creator: The creator of this IdentifierDto. # noqa: E501 - :type: UserDto - """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 - - self._creator = creator - @property def language(self): """Gets the language of this IdentifierDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/related_identifier_dto.py b/swagger/api/api_authentication/models/related_identifier_dto.py index b75773d2c6df3bf4d147a129bd98d987a161ebd6..1d2c91fe6d69f019bfaaf0f6c5281b2a7552d321 100644 --- a/swagger/api/api_authentication/models/related_identifier_dto.py +++ b/swagger/api/api_authentication/models/related_identifier_dto.py @@ -33,7 +33,6 @@ class RelatedIdentifierDto(object): 'type': 'str', 'relation': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'last_modified': 'datetime' } @@ -43,18 +42,16 @@ class RelatedIdentifierDto(object): 'type': 'type', 'relation': 'relation', 'created': 'created', - 'deleted': 'deleted', 'last_modified': 'last_modified' } - def __init__(self, id=None, value=None, type=None, relation=None, created=None, deleted=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None): # noqa: E501 """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._value = None self._type = None self._relation = None self._created = None - self._deleted = None self._last_modified = None self.discriminator = None self.id = id @@ -64,8 +61,6 @@ class RelatedIdentifierDto(object): if relation is not None: self.relation = relation self.created = created - if deleted is not None: - self.deleted = deleted if last_modified is not None: self.last_modified = last_modified @@ -192,27 +187,6 @@ class RelatedIdentifierDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this RelatedIdentifierDto. # noqa: E501 - - - :return: The deleted of this RelatedIdentifierDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this RelatedIdentifierDto. - - - :param deleted: The deleted of this RelatedIdentifierDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def last_modified(self): """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/table_brief_dto.py b/swagger/api/api_authentication/models/table_brief_dto.py index a20c8802164e2c36f9ad791c1cca72e26d659f8c..c25e0c067db51da441df0248c2e92c67813b6bc2 100644 --- a/swagger/api/api_authentication/models/table_brief_dto.py +++ b/swagger/api/api_authentication/models/table_brief_dto.py @@ -30,6 +30,7 @@ class TableBriefDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'description': 'str', 'creator': 'UserBriefDto', 'internal_name': 'str' } @@ -37,19 +38,22 @@ class TableBriefDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'description': 'description', 'creator': 'creator', 'internal_name': 'internal_name' } - def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, description=None, creator=None, internal_name=None): # noqa: E501 """TableBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._description = None self._creator = None self._internal_name = None self.discriminator = None self.id = id self.name = name + self.description = description self.creator = creator self.internal_name = internal_name @@ -99,6 +103,29 @@ class TableBriefDto(object): self._name = name + @property + def description(self): + """Gets the description of this TableBriefDto. # noqa: E501 + + + :return: The description of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableBriefDto. + + + :param description: The description of this TableBriefDto. # noqa: E501 + :type: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + @property def creator(self): """Gets the creator of this TableBriefDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/token_brief_dto.py b/swagger/api/api_authentication/models/token_brief_dto.py index b86592c9b9b8725950fdeb1c05c307693584b2f3..228505ff88a3c00b4cc348d4b5ea30ec99f29d04 100644 --- a/swagger/api/api_authentication/models/token_brief_dto.py +++ b/swagger/api/api_authentication/models/token_brief_dto.py @@ -31,7 +31,6 @@ class TokenBriefDto(object): 'id': 'int', 'created': 'datetime', 'expires': 'datetime', - 'deleted': 'datetime', 'token_hash': 'str', 'last_used': 'datetime' } @@ -40,25 +39,21 @@ class TokenBriefDto(object): 'id': 'id', 'created': 'created', 'expires': 'expires', - 'deleted': 'deleted', 'token_hash': 'token_hash', 'last_used': 'last_used' } - def __init__(self, id=None, created=None, expires=None, deleted=None, token_hash=None, last_used=None): # noqa: E501 + def __init__(self, id=None, created=None, expires=None, token_hash=None, last_used=None): # noqa: E501 """TokenBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._created = None self._expires = None - self._deleted = None self._token_hash = None self._last_used = None self.discriminator = None self.id = id self.created = created self.expires = expires - if deleted is not None: - self.deleted = deleted self.token_hash = token_hash if last_used is not None: self.last_used = last_used @@ -132,27 +127,6 @@ class TokenBriefDto(object): self._expires = expires - @property - def deleted(self): - """Gets the deleted of this TokenBriefDto. # noqa: E501 - - - :return: The deleted of this TokenBriefDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this TokenBriefDto. - - - :param deleted: The deleted of this TokenBriefDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def token_hash(self): """Gets the token_hash of this TokenBriefDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/token_dto.py b/swagger/api/api_authentication/models/token_dto.py index e2a7c97556d255f2f950fd67e054113c672f3e06..23f0c9c040d107880fd50a22fe9b50890a903ce5 100644 --- a/swagger/api/api_authentication/models/token_dto.py +++ b/swagger/api/api_authentication/models/token_dto.py @@ -31,7 +31,6 @@ class TokenDto(object): 'id': 'int', 'created': 'datetime', 'expires': 'datetime', - 'deleted': 'datetime', 'token': 'str', 'token_hash': 'str', 'last_used': 'datetime' @@ -41,18 +40,16 @@ class TokenDto(object): 'id': 'id', 'created': 'created', 'expires': 'expires', - 'deleted': 'deleted', 'token': 'token', 'token_hash': 'token_hash', 'last_used': 'last_used' } - def __init__(self, id=None, created=None, expires=None, deleted=None, token=None, token_hash=None, last_used=None): # noqa: E501 + def __init__(self, id=None, created=None, expires=None, token=None, token_hash=None, last_used=None): # noqa: E501 """TokenDto - a model defined in Swagger""" # noqa: E501 self._id = None self._created = None self._expires = None - self._deleted = None self._token = None self._token_hash = None self._last_used = None @@ -60,8 +57,6 @@ class TokenDto(object): self.id = id self.created = created self.expires = expires - if deleted is not None: - self.deleted = deleted self.token = token self.token_hash = token_hash if last_used is not None: @@ -136,27 +131,6 @@ class TokenDto(object): self._expires = expires - @property - def deleted(self): - """Gets the deleted of this TokenDto. # noqa: E501 - - - :return: The deleted of this TokenDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this TokenDto. - - - :param deleted: The deleted of this TokenDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def token(self): """Gets the token of this TokenDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/user_brief_dto.py b/swagger/api/api_authentication/models/user_brief_dto.py index 79fbd2db971a41b74fda65941dde1e04f6e81ebf..84e3367c2933d3736647fb4babf35ed6f49e8176 100644 --- a/swagger/api/api_authentication/models/user_brief_dto.py +++ b/swagger/api/api_authentication/models/user_brief_dto.py @@ -30,12 +30,13 @@ class UserBriefDto(object): swagger_types = { 'id': 'int', 'username': 'str', + 'titles_before': 'str', + 'titles_after': 'str', 'firstname': 'str', 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', - 'titles_before': 'str', - 'titles_after': 'str', + 'roles': 'list[str]', 'theme_dark': 'bool', 'email_verified': 'bool' } @@ -43,31 +44,37 @@ class UserBriefDto(object): attribute_map = { 'id': 'id', 'username': 'username', + 'titles_before': 'titlesBefore', + 'titles_after': 'titlesAfter', 'firstname': 'firstname', 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', - 'titles_before': 'titles_before', - 'titles_after': 'titles_after', - 'theme_dark': 'theme_dark', - 'email_verified': 'email_verified' + 'roles': 'roles', + 'theme_dark': 'themeDark', + 'email_verified': 'emailVerified' } - def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, username=None, titles_before=None, titles_after=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, theme_dark=None, email_verified=None): # noqa: E501 """UserBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._username = None + self._titles_before = None + self._titles_after = None self._firstname = None self._lastname = None self._affiliation = None self._orcid = None - self._titles_before = None - self._titles_after = None + self._roles = None self._theme_dark = None self._email_verified = None self.discriminator = None self.id = id self.username = username + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after if firstname is not None: self.firstname = firstname if lastname is not None: @@ -76,12 +83,11 @@ class UserBriefDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid - if titles_before is not None: - self.titles_before = titles_before - if titles_after is not None: - self.titles_after = titles_after - self.theme_dark = theme_dark - self.email_verified = email_verified + self.roles = roles + if theme_dark is not None: + self.theme_dark = theme_dark + if email_verified is not None: + self.email_verified = email_verified @property def id(self): @@ -131,6 +137,48 @@ class UserBriefDto(object): self._username = username + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + @property def firstname(self): """Gets the firstname of this UserBriefDto. # noqa: E501 @@ -216,46 +264,29 @@ class UserBriefDto(object): self._orcid = orcid @property - def titles_before(self): - """Gets the titles_before of this UserBriefDto. # noqa: E501 + def roles(self): + """Gets the roles of this UserBriefDto. # noqa: E501 + Roles of the user # noqa: E501 - :return: The titles_before of this UserBriefDto. # noqa: E501 - :rtype: str + :return: The roles of this UserBriefDto. # noqa: E501 + :rtype: list[str] """ - return self._titles_before + return self._roles - @titles_before.setter - def titles_before(self, titles_before): - """Sets the titles_before of this UserBriefDto. + @roles.setter + def roles(self, roles): + """Sets the roles of this UserBriefDto. + Roles of the user # noqa: E501 - :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 - :type: str + :param roles: The roles of this UserBriefDto. # noqa: E501 + :type: list[str] """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 - self._titles_before = titles_before - - @property - def titles_after(self): - """Gets the titles_after of this UserBriefDto. # noqa: E501 - - - :return: The titles_after of this UserBriefDto. # noqa: E501 - :rtype: str - """ - return self._titles_after - - @titles_after.setter - def titles_after(self, titles_after): - """Sets the titles_after of this UserBriefDto. - - - :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 - :type: str - """ - - self._titles_after = titles_after + self._roles = roles @property def theme_dark(self): @@ -275,8 +306,6 @@ class UserBriefDto(object): :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 :type: bool """ - if theme_dark is None: - raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 self._theme_dark = theme_dark @@ -298,8 +327,6 @@ class UserBriefDto(object): :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 :type: bool """ - if email_verified is None: - raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 self._email_verified = email_verified diff --git a/swagger/api/api_authentication/models/user_dto.py b/swagger/api/api_authentication/models/user_dto.py index e5a3cf440293c565718006cd46962706ad260f6f..c487ca7c5f19d8a39248b6f0f114c8f5c509dce9 100644 --- a/swagger/api/api_authentication/models/user_dto.py +++ b/swagger/api/api_authentication/models/user_dto.py @@ -35,6 +35,7 @@ class UserDto(object): 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', + 'roles': 'list[str]', 'containers': 'list[ContainerDto]', 'databases': 'list[ContainerDto]', 'identifiers': 'list[ContainerDto]', @@ -53,6 +54,7 @@ class UserDto(object): 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', + 'roles': 'roles', 'containers': 'containers', 'databases': 'databases', 'identifiers': 'identifiers', @@ -63,7 +65,7 @@ class UserDto(object): 'email_verified': 'email_verified' } - def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 """UserDto - a model defined in Swagger""" # noqa: E501 self._id = None self._authorities = None @@ -72,6 +74,7 @@ class UserDto(object): self._lastname = None self._affiliation = None self._orcid = None + self._roles = None self._containers = None self._databases = None self._identifiers = None @@ -93,6 +96,7 @@ class UserDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid + self.roles = roles if containers is not None: self.containers = containers if databases is not None: @@ -260,6 +264,31 @@ class UserDto(object): self._orcid = orcid + @property + def roles(self): + """Gets the roles of this UserDto. # noqa: E501 + + Roles of the user # noqa: E501 + + :return: The roles of this UserDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UserDto. + + Roles of the user # noqa: E501 + + :param roles: The roles of this UserDto. # noqa: E501 + :type: list[str] + """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + + self._roles = roles + @property def containers(self): """Gets the containers of this UserDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/user_roles_dto.py b/swagger/api/api_authentication/models/user_roles_dto.py index e3630ac9e655960726e318b2511a1f11889fd5c1..79a1384dfb15df54584e2030a3fe14de5af16c57 100644 --- a/swagger/api/api_authentication/models/user_roles_dto.py +++ b/swagger/api/api_authentication/models/user_roles_dto.py @@ -61,6 +61,13 @@ class UserRolesDto(object): """ if roles is None: raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + allowed_values = ["researcher", "developer", "data_steward"] # noqa: E501 + if not set(roles).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `roles` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(roles) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) self._roles = roles diff --git a/swagger/api/api_container/__init__.py b/swagger/api/api_container/__init__.py index 5c202db249aefebe9939234e90f99ec884eeb541..d2bcec43a6fbc08c21dc2be7d2a873637c6b3dac 100644 --- a/swagger/api/api_container/__init__.py +++ b/swagger/api/api_container/__init__.py @@ -27,6 +27,7 @@ from api_container.models.container_change_dto import ContainerChangeDto from api_container.models.container_create_request_dto import ContainerCreateRequestDto from api_container.models.container_dto import ContainerDto from api_container.models.creator_dto import CreatorDto +from api_container.models.database_access_dto import DatabaseAccessDto from api_container.models.database_dto import DatabaseDto from api_container.models.granted_authority_dto import GrantedAuthorityDto from api_container.models.identifier_dto import IdentifierDto diff --git a/swagger/api/api_container/models/__init__.py b/swagger/api/api_container/models/__init__.py index 2f3f0932583ab6e3c27a0f9fa2cddf8dcbe98d13..e4f3f9404a64b95066b68eaf552abfe96f2c306e 100644 --- a/swagger/api/api_container/models/__init__.py +++ b/swagger/api/api_container/models/__init__.py @@ -20,6 +20,7 @@ from api_container.models.container_change_dto import ContainerChangeDto from api_container.models.container_create_request_dto import ContainerCreateRequestDto from api_container.models.container_dto import ContainerDto from api_container.models.creator_dto import CreatorDto +from api_container.models.database_access_dto import DatabaseAccessDto from api_container.models.database_dto import DatabaseDto from api_container.models.granted_authority_dto import GrantedAuthorityDto from api_container.models.identifier_dto import IdentifierDto diff --git a/swagger/api/api_container/models/container_dto.py b/swagger/api/api_container/models/container_dto.py index 0be42d21d1d2692b65afe99388fb1eccd24a93cf..4a7d5a0646eb13e682abeaeef79ca152625a4593 100644 --- a/swagger/api/api_container/models/container_dto.py +++ b/swagger/api/api_container/models/container_dto.py @@ -32,7 +32,7 @@ class ContainerDto(object): 'hash': 'str', 'name': 'str', 'state': 'str', - 'databases': 'list[DatabaseDto]', + 'database': 'DatabaseDto', 'image': 'ImageBriefDto', 'port': 'int', 'created': 'datetime', @@ -45,7 +45,7 @@ class ContainerDto(object): 'hash': 'hash', 'name': 'name', 'state': 'state', - 'databases': 'databases', + 'database': 'database', 'image': 'image', 'port': 'port', 'created': 'created', @@ -53,13 +53,13 @@ class ContainerDto(object): 'ip_address': 'ip_address' } - def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + def __init__(self, id=None, hash=None, name=None, state=None, database=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 """ContainerDto - a model defined in Swagger""" # noqa: E501 self._id = None self._hash = None self._name = None self._state = None - self._databases = None + self._database = None self._image = None self._port = None self._created = None @@ -71,8 +71,8 @@ class ContainerDto(object): self.name = name if state is not None: self.state = state - if databases is not None: - self.databases = databases + if database is not None: + self.database = database if image is not None: self.image = image if port is not None: @@ -179,25 +179,25 @@ class ContainerDto(object): self._state = state @property - def databases(self): - """Gets the databases of this ContainerDto. # noqa: E501 + def database(self): + """Gets the database of this ContainerDto. # noqa: E501 - :return: The databases of this ContainerDto. # noqa: E501 - :rtype: list[DatabaseDto] + :return: The database of this ContainerDto. # noqa: E501 + :rtype: DatabaseDto """ - return self._databases + return self._database - @databases.setter - def databases(self, databases): - """Sets the databases of this ContainerDto. + @database.setter + def database(self, database): + """Sets the database of this ContainerDto. - :param databases: The databases of this ContainerDto. # noqa: E501 - :type: list[DatabaseDto] + :param database: The database of this ContainerDto. # noqa: E501 + :type: DatabaseDto """ - self._databases = databases + self._database = database @property def image(self): diff --git a/swagger/api/api_container/models/creator_dto.py b/swagger/api/api_container/models/creator_dto.py index d3dd17c191d513f6806239c20b6164888ff0e40c..72bd78ee568145d1aa3417bf8007f52464c0aa76 100644 --- a/swagger/api/api_container/models/creator_dto.py +++ b/swagger/api/api_container/models/creator_dto.py @@ -29,7 +29,8 @@ class CreatorDto(object): """ swagger_types = { 'id': 'int', - 'name': 'str', + 'firstname': 'str', + 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', 'created': 'datetime', @@ -38,29 +39,33 @@ class CreatorDto(object): attribute_map = { 'id': 'id', - 'name': 'name', + 'firstname': 'firstname', + 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', 'created': 'created', - 'last_modified': 'last_modified' + 'last_modified': 'lastModified' } - def __init__(self, id=None, name=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, firstname=None, lastname=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 """CreatorDto - a model defined in Swagger""" # noqa: E501 self._id = None - self._name = None + self._firstname = None + self._lastname = None self._affiliation = None self._orcid = None self._created = None self._last_modified = None self.discriminator = None self.id = id - self.name = name + self.firstname = firstname + self.lastname = lastname if affiliation is not None: self.affiliation = affiliation if orcid is not None: self.orcid = orcid - self.created = created + if created is not None: + self.created = created if last_modified is not None: self.last_modified = last_modified @@ -88,27 +93,50 @@ class CreatorDto(object): self._id = id @property - def name(self): - """Gets the name of this CreatorDto. # noqa: E501 + def firstname(self): + """Gets the firstname of this CreatorDto. # noqa: E501 - :return: The name of this CreatorDto. # noqa: E501 + :return: The firstname of this CreatorDto. # noqa: E501 :rtype: str """ - return self._name + return self._firstname - @name.setter - def name(self, name): - """Sets the name of this CreatorDto. + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorDto. - :param name: The name of this CreatorDto. # noqa: E501 + :param firstname: The firstname of this CreatorDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 - self._name = name + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorDto. # noqa: E501 + + + :return: The lastname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorDto. + + + :param lastname: The lastname of this CreatorDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname @property def affiliation(self): @@ -170,8 +198,6 @@ class CreatorDto(object): :param created: The created of this CreatorDto. # noqa: E501 :type: datetime """ - if created is None: - raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 self._created = created diff --git a/swagger/api/api_container/models/database_access_dto.py b/swagger/api/api_container/models/database_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b4efd141bd6f87eae3f95d29888cf416fa205fad --- /dev/null +++ b/swagger/api/api_container/models/database_access_dto.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Database Repository Container Service API + + Service that manages the containers # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user': 'UserDto', + 'type': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'user': 'user', + 'type': 'type', + 'created': 'created' + } + + def __init__(self, user=None, type=None, created=None): # noqa: E501 + """DatabaseAccessDto - a model defined in Swagger""" # noqa: E501 + self._user = None + self._type = None + self._created = None + self.discriminator = None + self.user = user + self.type = type + if created is not None: + self.created = created + + @property + def user(self): + """Gets the user of this DatabaseAccessDto. # noqa: E501 + + + :return: The user of this DatabaseAccessDto. # noqa: E501 + :rtype: UserDto + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this DatabaseAccessDto. + + + :param user: The user of this DatabaseAccessDto. # noqa: E501 + :type: UserDto + """ + if user is None: + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + @property + def type(self): + """Gets the type of this DatabaseAccessDto. # noqa: E501 + + + :return: The type of this DatabaseAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseAccessDto. + + + :param type: The type of this DatabaseAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def created(self): + """Gets the created of this DatabaseAccessDto. # noqa: E501 + + + :return: The created of this DatabaseAccessDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseAccessDto. + + + :param created: The created of this DatabaseAccessDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_container/models/database_dto.py b/swagger/api/api_container/models/database_dto.py index 4cfdfd3fc8373c5e04966280d14399e47f50d66d..afa0e76b8dfe2fdda9385a2fb9ebfec73697b072 100644 --- a/swagger/api/api_container/models/database_dto.py +++ b/swagger/api/api_container/models/database_dto.py @@ -30,15 +30,15 @@ class DatabaseDto(object): swagger_types = { 'id': 'int', 'name': 'str', - 'exchange': 'str', 'creator': 'UserBriefDto', 'identifier': 'IdentifierDto', 'description': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', + 'accesses': 'list[DatabaseAccessDto]', 'created': 'datetime', - 'deleted': 'datetime', + 'exchange_name': 'str', 'internal_name': 'str', 'is_public': 'bool' } @@ -46,38 +46,37 @@ class DatabaseDto(object): attribute_map = { 'id': 'id', 'name': 'name', - 'exchange': 'exchange', 'creator': 'creator', 'identifier': 'identifier', 'description': 'description', 'tables': 'tables', 'image': 'image', 'container': 'container', + 'accesses': 'accesses', 'created': 'created', - 'deleted': 'deleted', + 'exchange_name': 'exchange_name', 'internal_name': 'internal_name', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, accesses=None, created=None, exchange_name=None, internal_name=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None - self._exchange = None self._creator = None self._identifier = None self._description = None self._tables = None self._image = None self._container = None + self._accesses = None self._created = None - self._deleted = None + self._exchange_name = None self._internal_name = None self._is_public = None self.discriminator = None self.id = id self.name = name - self.exchange = exchange self.creator = creator if identifier is not None: self.identifier = identifier @@ -89,10 +88,11 @@ class DatabaseDto(object): self.image = image if container is not None: self.container = container + if accesses is not None: + self.accesses = accesses if created is not None: self.created = created - if deleted is not None: - self.deleted = deleted + self.exchange_name = exchange_name self.internal_name = internal_name if is_public is not None: self.is_public = is_public @@ -143,29 +143,6 @@ class DatabaseDto(object): self._name = name - @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 - - - :return: The exchange of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. - - - :param exchange: The exchange of this DatabaseDto. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - @property def creator(self): """Gets the creator of this DatabaseDto. # noqa: E501 @@ -294,6 +271,27 @@ class DatabaseDto(object): self._container = container + @property + def accesses(self): + """Gets the accesses of this DatabaseDto. # noqa: E501 + + + :return: The accesses of this DatabaseDto. # noqa: E501 + :rtype: list[DatabaseAccessDto] + """ + return self._accesses + + @accesses.setter + def accesses(self, accesses): + """Sets the accesses of this DatabaseDto. + + + :param accesses: The accesses of this DatabaseDto. # noqa: E501 + :type: list[DatabaseAccessDto] + """ + + self._accesses = accesses + @property def created(self): """Gets the created of this DatabaseDto. # noqa: E501 @@ -316,25 +314,27 @@ class DatabaseDto(object): self._created = created @property - def deleted(self): - """Gets the deleted of this DatabaseDto. # noqa: E501 + def exchange_name(self): + """Gets the exchange_name of this DatabaseDto. # noqa: E501 - :return: The deleted of this DatabaseDto. # noqa: E501 - :rtype: datetime + :return: The exchange_name of this DatabaseDto. # noqa: E501 + :rtype: str """ - return self._deleted + return self._exchange_name - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this DatabaseDto. + @exchange_name.setter + def exchange_name(self, exchange_name): + """Sets the exchange_name of this DatabaseDto. - :param deleted: The deleted of this DatabaseDto. # noqa: E501 - :type: datetime + :param exchange_name: The exchange_name of this DatabaseDto. # noqa: E501 + :type: str """ + if exchange_name is None: + raise ValueError("Invalid value for `exchange_name`, must not be `None`") # noqa: E501 - self._deleted = deleted + self._exchange_name = exchange_name @property def internal_name(self): diff --git a/swagger/api/api_container/models/identifier_dto.py b/swagger/api/api_container/models/identifier_dto.py index e17a6c46819e3f50a0749b7883086cdfc4559dfe..a56d46ef3f4fcd72d0575818747cf62de90d2e7f 100644 --- a/swagger/api/api_container/models/identifier_dto.py +++ b/swagger/api/api_container/models/identifier_dto.py @@ -37,7 +37,6 @@ class IdentifierDto(object): 'visibility': 'str', 'doi': 'str', 'publisher': 'str', - 'creator': 'UserDto', 'language': 'str', 'license': 'LicenseDto', 'creators': 'list[CreatorDto]', @@ -66,7 +65,6 @@ class IdentifierDto(object): 'visibility': 'visibility', 'doi': 'doi', 'publisher': 'publisher', - 'creator': 'creator', 'language': 'language', 'license': 'license', 'creators': 'creators', @@ -85,7 +83,7 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._type = None @@ -96,7 +94,6 @@ class IdentifierDto(object): self._visibility = None self._doi = None self._publisher = None - self._creator = None self._language = None self._license = None self._creators = None @@ -127,7 +124,6 @@ class IdentifierDto(object): self.doi = doi if publisher is not None: self.publisher = publisher - self.creator = creator if language is not None: self.language = language if license is not None: @@ -364,29 +360,6 @@ class IdentifierDto(object): self._publisher = publisher - @property - def creator(self): - """Gets the creator of this IdentifierDto. # noqa: E501 - - - :return: The creator of this IdentifierDto. # noqa: E501 - :rtype: UserDto - """ - return self._creator - - @creator.setter - def creator(self, creator): - """Sets the creator of this IdentifierDto. - - - :param creator: The creator of this IdentifierDto. # noqa: E501 - :type: UserDto - """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 - - self._creator = creator - @property def language(self): """Gets the language of this IdentifierDto. # noqa: E501 diff --git a/swagger/api/api_container/models/related_identifier_dto.py b/swagger/api/api_container/models/related_identifier_dto.py index e35dace89a088cc3c8ba2544c68645db51424e9d..fa2ac45fb14b8e74bcaa22596ec84075a75b9cc5 100644 --- a/swagger/api/api_container/models/related_identifier_dto.py +++ b/swagger/api/api_container/models/related_identifier_dto.py @@ -33,7 +33,6 @@ class RelatedIdentifierDto(object): 'type': 'str', 'relation': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'last_modified': 'datetime' } @@ -43,18 +42,16 @@ class RelatedIdentifierDto(object): 'type': 'type', 'relation': 'relation', 'created': 'created', - 'deleted': 'deleted', 'last_modified': 'last_modified' } - def __init__(self, id=None, value=None, type=None, relation=None, created=None, deleted=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None): # noqa: E501 """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._value = None self._type = None self._relation = None self._created = None - self._deleted = None self._last_modified = None self.discriminator = None self.id = id @@ -64,8 +61,6 @@ class RelatedIdentifierDto(object): if relation is not None: self.relation = relation self.created = created - if deleted is not None: - self.deleted = deleted if last_modified is not None: self.last_modified = last_modified @@ -192,27 +187,6 @@ class RelatedIdentifierDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this RelatedIdentifierDto. # noqa: E501 - - - :return: The deleted of this RelatedIdentifierDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this RelatedIdentifierDto. - - - :param deleted: The deleted of this RelatedIdentifierDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def last_modified(self): """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 diff --git a/swagger/api/api_container/models/table_brief_dto.py b/swagger/api/api_container/models/table_brief_dto.py index 6aa1c9d655b5b342ed7ca3ec1f4a7ac58a2fcbf0..ce3bc12bdd1c08c366945cb1ee3405d5c1813a28 100644 --- a/swagger/api/api_container/models/table_brief_dto.py +++ b/swagger/api/api_container/models/table_brief_dto.py @@ -30,6 +30,7 @@ class TableBriefDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'description': 'str', 'creator': 'UserBriefDto', 'internal_name': 'str' } @@ -37,19 +38,22 @@ class TableBriefDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'description': 'description', 'creator': 'creator', 'internal_name': 'internal_name' } - def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, description=None, creator=None, internal_name=None): # noqa: E501 """TableBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._description = None self._creator = None self._internal_name = None self.discriminator = None self.id = id self.name = name + self.description = description self.creator = creator self.internal_name = internal_name @@ -99,6 +103,29 @@ class TableBriefDto(object): self._name = name + @property + def description(self): + """Gets the description of this TableBriefDto. # noqa: E501 + + + :return: The description of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableBriefDto. + + + :param description: The description of this TableBriefDto. # noqa: E501 + :type: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + @property def creator(self): """Gets the creator of this TableBriefDto. # noqa: E501 diff --git a/swagger/api/api_container/models/user_brief_dto.py b/swagger/api/api_container/models/user_brief_dto.py index 15e5e217a9b1cc3b4ee91e65f422dc782a4c37ac..007174c58a7685bb499ef3732f681c7b19850a7c 100644 --- a/swagger/api/api_container/models/user_brief_dto.py +++ b/swagger/api/api_container/models/user_brief_dto.py @@ -30,12 +30,13 @@ class UserBriefDto(object): swagger_types = { 'id': 'int', 'username': 'str', + 'titles_before': 'str', + 'titles_after': 'str', 'firstname': 'str', 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', - 'titles_before': 'str', - 'titles_after': 'str', + 'roles': 'list[str]', 'theme_dark': 'bool', 'email_verified': 'bool' } @@ -43,31 +44,37 @@ class UserBriefDto(object): attribute_map = { 'id': 'id', 'username': 'username', + 'titles_before': 'titlesBefore', + 'titles_after': 'titlesAfter', 'firstname': 'firstname', 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', - 'titles_before': 'titles_before', - 'titles_after': 'titles_after', - 'theme_dark': 'theme_dark', - 'email_verified': 'email_verified' + 'roles': 'roles', + 'theme_dark': 'themeDark', + 'email_verified': 'emailVerified' } - def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, username=None, titles_before=None, titles_after=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, theme_dark=None, email_verified=None): # noqa: E501 """UserBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._username = None + self._titles_before = None + self._titles_after = None self._firstname = None self._lastname = None self._affiliation = None self._orcid = None - self._titles_before = None - self._titles_after = None + self._roles = None self._theme_dark = None self._email_verified = None self.discriminator = None self.id = id self.username = username + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after if firstname is not None: self.firstname = firstname if lastname is not None: @@ -76,12 +83,11 @@ class UserBriefDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid - if titles_before is not None: - self.titles_before = titles_before - if titles_after is not None: - self.titles_after = titles_after - self.theme_dark = theme_dark - self.email_verified = email_verified + self.roles = roles + if theme_dark is not None: + self.theme_dark = theme_dark + if email_verified is not None: + self.email_verified = email_verified @property def id(self): @@ -131,6 +137,48 @@ class UserBriefDto(object): self._username = username + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + @property def firstname(self): """Gets the firstname of this UserBriefDto. # noqa: E501 @@ -216,46 +264,29 @@ class UserBriefDto(object): self._orcid = orcid @property - def titles_before(self): - """Gets the titles_before of this UserBriefDto. # noqa: E501 + def roles(self): + """Gets the roles of this UserBriefDto. # noqa: E501 + Roles of the user # noqa: E501 - :return: The titles_before of this UserBriefDto. # noqa: E501 - :rtype: str + :return: The roles of this UserBriefDto. # noqa: E501 + :rtype: list[str] """ - return self._titles_before + return self._roles - @titles_before.setter - def titles_before(self, titles_before): - """Sets the titles_before of this UserBriefDto. + @roles.setter + def roles(self, roles): + """Sets the roles of this UserBriefDto. + Roles of the user # noqa: E501 - :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 - :type: str + :param roles: The roles of this UserBriefDto. # noqa: E501 + :type: list[str] """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 - self._titles_before = titles_before - - @property - def titles_after(self): - """Gets the titles_after of this UserBriefDto. # noqa: E501 - - - :return: The titles_after of this UserBriefDto. # noqa: E501 - :rtype: str - """ - return self._titles_after - - @titles_after.setter - def titles_after(self, titles_after): - """Sets the titles_after of this UserBriefDto. - - - :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 - :type: str - """ - - self._titles_after = titles_after + self._roles = roles @property def theme_dark(self): @@ -275,8 +306,6 @@ class UserBriefDto(object): :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 :type: bool """ - if theme_dark is None: - raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 self._theme_dark = theme_dark @@ -298,8 +327,6 @@ class UserBriefDto(object): :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 :type: bool """ - if email_verified is None: - raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 self._email_verified = email_verified diff --git a/swagger/api/api_container/models/user_dto.py b/swagger/api/api_container/models/user_dto.py index 3d1b14417ef4405b97be22e752df7c5144127a49..9bb5e315f1eaa5947c7943a5f3796cb0904526d2 100644 --- a/swagger/api/api_container/models/user_dto.py +++ b/swagger/api/api_container/models/user_dto.py @@ -35,6 +35,7 @@ class UserDto(object): 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', + 'roles': 'list[str]', 'containers': 'list[ContainerDto]', 'databases': 'list[ContainerDto]', 'identifiers': 'list[ContainerDto]', @@ -53,6 +54,7 @@ class UserDto(object): 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', + 'roles': 'roles', 'containers': 'containers', 'databases': 'databases', 'identifiers': 'identifiers', @@ -63,7 +65,7 @@ class UserDto(object): 'email_verified': 'email_verified' } - def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 """UserDto - a model defined in Swagger""" # noqa: E501 self._id = None self._authorities = None @@ -72,6 +74,7 @@ class UserDto(object): self._lastname = None self._affiliation = None self._orcid = None + self._roles = None self._containers = None self._databases = None self._identifiers = None @@ -93,6 +96,7 @@ class UserDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid + self.roles = roles if containers is not None: self.containers = containers if databases is not None: @@ -260,6 +264,31 @@ class UserDto(object): self._orcid = orcid + @property + def roles(self): + """Gets the roles of this UserDto. # noqa: E501 + + Roles of the user # noqa: E501 + + :return: The roles of this UserDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UserDto. + + Roles of the user # noqa: E501 + + :param roles: The roles of this UserDto. # noqa: E501 + :type: list[str] + """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + + self._roles = roles + @property def containers(self): """Gets the containers of this UserDto. # noqa: E501 diff --git a/swagger/api/api_database/__init__.py b/swagger/api/api_database/__init__.py index 234f48713cc53d5a1e86ed5b580a9857888c8dbf..a381fd9ebbd2dbf148915bc5f1f4cfb478234745 100644 --- a/swagger/api/api_database/__init__.py +++ b/swagger/api/api_database/__init__.py @@ -15,6 +15,7 @@ from __future__ import absolute_import # import apis into sdk package +from api_database.api.access_endpoint_api import AccessEndpointApi from api_database.api.database_endpoint_api import DatabaseEndpointApi from api_database.api.license_endpoint_api import LicenseEndpointApi # import ApiClient @@ -25,12 +26,14 @@ from api_database.models.api_error_dto import ApiErrorDto from api_database.models.container_brief_dto import ContainerBriefDto from api_database.models.container_dto import ContainerDto from api_database.models.creator_dto import CreatorDto +from api_database.models.database_access_dto import DatabaseAccessDto from api_database.models.database_brief_dto import DatabaseBriefDto from api_database.models.database_create_dto import DatabaseCreateDto from api_database.models.database_dto import DatabaseDto +from api_database.models.database_give_access_dto import DatabaseGiveAccessDto +from api_database.models.database_modify_access_dto import DatabaseModifyAccessDto from api_database.models.database_transfer_dto import DatabaseTransferDto from api_database.models.granted_authority_dto import GrantedAuthorityDto -from api_database.models.identifier_brief_dto import IdentifierBriefDto from api_database.models.identifier_dto import IdentifierDto from api_database.models.image_brief_dto import ImageBriefDto from api_database.models.image_date_dto import ImageDateDto diff --git a/swagger/api/api_database/api/__init__.py b/swagger/api/api_database/api/__init__.py index 3b6a63f77fec6a8c865d232230262a4acf91671e..ee03764b97972d79280bdbc1c1ff14f575da809d 100644 --- a/swagger/api/api_database/api/__init__.py +++ b/swagger/api/api_database/api/__init__.py @@ -3,5 +3,6 @@ from __future__ import absolute_import # flake8: noqa # import apis into api package +from api_database.api.access_endpoint_api import AccessEndpointApi from api_database.api.database_endpoint_api import DatabaseEndpointApi from api_database.api.license_endpoint_api import LicenseEndpointApi diff --git a/swagger/api/api_database/api/container_database_endpoint_api.py b/swagger/api/api_database/api/access_endpoint_api.py similarity index 56% rename from swagger/api/api_database/api/container_database_endpoint_api.py rename to swagger/api/api_database/api/access_endpoint_api.py index c05c11e8bbf51f594aa5736b1f4a5abed2d61e3f..a12279a27744e389b946137742abc3a0c235fc63 100644 --- a/swagger/api/api_database/api/container_database_endpoint_api.py +++ b/swagger/api/api_database/api/access_endpoint_api.py @@ -20,7 +20,7 @@ import six from api_database.api_client import ApiClient -class ContainerDatabaseEndpointApi(object): +class AccessEndpointApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -32,120 +32,16 @@ class ContainerDatabaseEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def create(self, body, id, **kwargs): # noqa: E501 - """Create database # noqa: E501 + def create1(self, body, id, database_id, **kwargs): # noqa: E501 + """Give access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param DatabaseCreateDto body: (required) - :param int id: (required) - :return: DatabaseBriefDto - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_with_http_info(body, id, **kwargs) # noqa: E501 - else: - (data) = self.create_with_http_info(body, id, **kwargs) # noqa: E501 - return data - - def create_with_http_info(self, body, id, **kwargs): # noqa: E501 - """Create database # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_with_http_info(body, id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param DatabaseCreateDto body: (required) - :param int id: (required) - :return: DatabaseBriefDto - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body', 'id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `create`") # noqa: E501 - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `create`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearerAuth'] # noqa: E501 - - return self.api_client.call_api( - '/api/container/{id}/database', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='DatabaseBriefDto', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete1(self, id, database_id, **kwargs): # noqa: E501 - """Delete some database # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete1(id, database_id, async_req=True) + >>> thread = api.create1(body, id, database_id, async_req=True) >>> result = thread.get() :param async_req bool + :param DatabaseGiveAccessDto body: (required) :param int id: (required) :param int database_id: (required) :return: object @@ -154,20 +50,21 @@ class ContainerDatabaseEndpointApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + return self.create1_with_http_info(body, id, database_id, **kwargs) # noqa: E501 else: - (data) = self.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.create1_with_http_info(body, id, database_id, **kwargs) # noqa: E501 return data - def delete1_with_http_info(self, id, database_id, **kwargs): # noqa: E501 - """Delete some database # noqa: E501 + def create1_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 + """Give access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete1_with_http_info(id, database_id, async_req=True) + >>> thread = api.create1_with_http_info(body, id, database_id, async_req=True) >>> result = thread.get() :param async_req bool + :param DatabaseGiveAccessDto body: (required) :param int id: (required) :param int database_id: (required) :return: object @@ -175,7 +72,7 @@ class ContainerDatabaseEndpointApi(object): returns the request thread. """ - all_params = ['id', 'database_id'] # noqa: E501 + all_params = ['body', 'id', 'database_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -186,18 +83,22 @@ class ContainerDatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete1" % key + " to method create1" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `create1`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `delete1`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `create1`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `delete1`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `create1`") # noqa: E501 collection_formats = {} @@ -215,15 +116,21 @@ class ContainerDatabaseEndpointApi(object): local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}', 'DELETE', + '/api/container/{id}/database/{databaseId}/access', 'POST', path_params, query_params, header_params, @@ -238,133 +145,40 @@ class ContainerDatabaseEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all(self, id, **kwargs): # noqa: E501 - """List databases # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int id: (required) - :return: list[DatabaseBriefDto] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.find_all_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.find_all_with_http_info(id, **kwargs) # noqa: E501 - return data - - def find_all_with_http_info(self, id, **kwargs): # noqa: E501 - """List databases # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int id: (required) - :return: list[DatabaseBriefDto] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method find_all" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `find_all`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/container/{id}/database', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[DatabaseBriefDto]', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def find_by_id(self, id, database_id, **kwargs): # noqa: E501 - """Find some database # noqa: E501 + def find(self, id, database_id, **kwargs): # noqa: E501 + """Check access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_by_id(id, database_id, async_req=True) + >>> thread = api.find(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :return: DatabaseDto + :return: DatabaseAccessDto If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.find_by_id_with_http_info(id, database_id, **kwargs) # noqa: E501 + return self.find_with_http_info(id, database_id, **kwargs) # noqa: E501 else: - (data) = self.find_by_id_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.find_with_http_info(id, database_id, **kwargs) # noqa: E501 return data - def find_by_id_with_http_info(self, id, database_id, **kwargs): # noqa: E501 - """Find some database # noqa: E501 + def find_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Check access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_by_id_with_http_info(id, database_id, async_req=True) + >>> thread = api.find_with_http_info(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :return: DatabaseDto + :return: DatabaseAccessDto If the method is called asynchronously, returns the request thread. """ @@ -380,18 +194,18 @@ class ContainerDatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_by_id" % key + " to method find" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `find_by_id`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `find`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `find_by_id`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `find`") # noqa: E501 collection_formats = {} @@ -417,14 +231,14 @@ class ContainerDatabaseEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}', 'GET', + '/api/container/{id}/database/{databaseId}/access', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='DatabaseDto', # noqa: E501 + response_type='DatabaseAccessDto', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -432,47 +246,49 @@ class ContainerDatabaseEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def transfer(self, body, id, database_id, **kwargs): # noqa: E501 - """Update database # noqa: E501 + def update(self, body, id, database_id, username, **kwargs): # noqa: E501 + """Modify access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.transfer(body, id, database_id, async_req=True) + >>> thread = api.update(body, id, database_id, username, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseTransferDto body: (required) + :param DatabaseModifyAccessDto body: (required) :param int id: (required) :param int database_id: (required) - :return: DatabaseDto + :param str username: (required) + :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return self.update_with_http_info(body, id, database_id, username, **kwargs) # noqa: E501 else: - (data) = self.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + (data) = self.update_with_http_info(body, id, database_id, username, **kwargs) # noqa: E501 return data - def transfer_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 - """Update database # noqa: E501 + def update_with_http_info(self, body, id, database_id, username, **kwargs): # noqa: E501 + """Modify access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.transfer_with_http_info(body, id, database_id, async_req=True) + >>> thread = api.update_with_http_info(body, id, database_id, username, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseTransferDto body: (required) + :param DatabaseModifyAccessDto body: (required) :param int id: (required) :param int database_id: (required) - :return: DatabaseDto + :param str username: (required) + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'id', 'database_id'] # noqa: E501 + all_params = ['body', 'id', 'database_id', 'username'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -483,22 +299,26 @@ class ContainerDatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method transfer" % key + " to method update" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'body' is set if ('body' not in params or params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `transfer`") # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `update`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `transfer`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `update`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `transfer`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `update`") # noqa: E501 + # verify the required parameter 'username' is set + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update`") # noqa: E501 collection_formats = {} @@ -507,6 +327,8 @@ class ContainerDatabaseEndpointApi(object): path_params['id'] = params['id'] # noqa: E501 if 'database_id' in params: path_params['databaseId'] = params['database_id'] # noqa: E501 + if 'username' in params: + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -530,14 +352,14 @@ class ContainerDatabaseEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/transfer', 'PUT', + '/api/container/{id}/database/{databaseId}/access/{username}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='DatabaseDto', # noqa: E501 + response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -545,47 +367,47 @@ class ContainerDatabaseEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def update(self, body, id, database_id, **kwargs): # noqa: E501 - """Update database # noqa: E501 + def update1(self, id, database_id, username, **kwargs): # noqa: E501 + """Revoke access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update(body, id, database_id, async_req=True) + >>> thread = api.update1(id, database_id, username, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseModifyDto body: (required) :param int id: (required) :param int database_id: (required) - :return: DatabaseDto + :param str username: (required) + :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return self.update1_with_http_info(id, database_id, username, **kwargs) # noqa: E501 else: - (data) = self.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + (data) = self.update1_with_http_info(id, database_id, username, **kwargs) # noqa: E501 return data - def update_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 - """Update database # noqa: E501 + def update1_with_http_info(self, id, database_id, username, **kwargs): # noqa: E501 + """Revoke access to some database # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_with_http_info(body, id, database_id, async_req=True) + >>> thread = api.update1_with_http_info(id, database_id, username, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseModifyDto body: (required) :param int id: (required) :param int database_id: (required) - :return: DatabaseDto + :param str username: (required) + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'id', 'database_id'] # noqa: E501 + all_params = ['id', 'database_id', 'username'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -596,22 +418,22 @@ class ContainerDatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method update" % key + " to method update1" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): - raise ValueError("Missing the required parameter `body` when calling `update`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `update`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `update1`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `update`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `update1`") # noqa: E501 + # verify the required parameter 'username' is set + if ('username' not in params or + params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `update1`") # noqa: E501 collection_formats = {} @@ -620,6 +442,8 @@ class ContainerDatabaseEndpointApi(object): path_params['id'] = params['id'] # noqa: E501 if 'database_id' in params: path_params['databaseId'] = params['database_id'] # noqa: E501 + if 'username' in params: + path_params['username'] = params['username'] # noqa: E501 query_params = [] @@ -629,28 +453,22 @@ class ContainerDatabaseEndpointApi(object): local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['*/*']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}', 'PUT', + '/api/container/{id}/database/{databaseId}/access/{username}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='DatabaseDto', # noqa: E501 + response_type='object', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/swagger/api/api_database/models/__init__.py b/swagger/api/api_database/models/__init__.py index 21d9634c64dcf7aefc43514da153f435ae5a7b29..31780c58b3a08a6bed6ca36be0c05e13000960c9 100644 --- a/swagger/api/api_database/models/__init__.py +++ b/swagger/api/api_database/models/__init__.py @@ -18,12 +18,14 @@ from api_database.models.api_error_dto import ApiErrorDto from api_database.models.container_brief_dto import ContainerBriefDto from api_database.models.container_dto import ContainerDto from api_database.models.creator_dto import CreatorDto +from api_database.models.database_access_dto import DatabaseAccessDto from api_database.models.database_brief_dto import DatabaseBriefDto from api_database.models.database_create_dto import DatabaseCreateDto from api_database.models.database_dto import DatabaseDto +from api_database.models.database_give_access_dto import DatabaseGiveAccessDto +from api_database.models.database_modify_access_dto import DatabaseModifyAccessDto from api_database.models.database_transfer_dto import DatabaseTransferDto from api_database.models.granted_authority_dto import GrantedAuthorityDto -from api_database.models.identifier_brief_dto import IdentifierBriefDto from api_database.models.identifier_dto import IdentifierDto from api_database.models.image_brief_dto import ImageBriefDto from api_database.models.image_date_dto import ImageDateDto diff --git a/swagger/api/api_database/models/container_dto.py b/swagger/api/api_database/models/container_dto.py index 1ab9e4195efa179e64077d6c9a8e62938cd10c24..885b53fd54452e01bf468e9728b0816690287db1 100644 --- a/swagger/api/api_database/models/container_dto.py +++ b/swagger/api/api_database/models/container_dto.py @@ -32,7 +32,7 @@ class ContainerDto(object): 'hash': 'str', 'name': 'str', 'state': 'str', - 'databases': 'list[DatabaseDto]', + 'database': 'DatabaseDto', 'image': 'ImageBriefDto', 'port': 'int', 'created': 'datetime', @@ -45,7 +45,7 @@ class ContainerDto(object): 'hash': 'hash', 'name': 'name', 'state': 'state', - 'databases': 'databases', + 'database': 'database', 'image': 'image', 'port': 'port', 'created': 'created', @@ -53,13 +53,13 @@ class ContainerDto(object): 'ip_address': 'ip_address' } - def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + def __init__(self, id=None, hash=None, name=None, state=None, database=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 """ContainerDto - a model defined in Swagger""" # noqa: E501 self._id = None self._hash = None self._name = None self._state = None - self._databases = None + self._database = None self._image = None self._port = None self._created = None @@ -71,8 +71,8 @@ class ContainerDto(object): self.name = name if state is not None: self.state = state - if databases is not None: - self.databases = databases + if database is not None: + self.database = database if image is not None: self.image = image if port is not None: @@ -179,25 +179,25 @@ class ContainerDto(object): self._state = state @property - def databases(self): - """Gets the databases of this ContainerDto. # noqa: E501 + def database(self): + """Gets the database of this ContainerDto. # noqa: E501 - :return: The databases of this ContainerDto. # noqa: E501 - :rtype: list[DatabaseDto] + :return: The database of this ContainerDto. # noqa: E501 + :rtype: DatabaseDto """ - return self._databases + return self._database - @databases.setter - def databases(self, databases): - """Sets the databases of this ContainerDto. + @database.setter + def database(self, database): + """Sets the database of this ContainerDto. - :param databases: The databases of this ContainerDto. # noqa: E501 - :type: list[DatabaseDto] + :param database: The database of this ContainerDto. # noqa: E501 + :type: DatabaseDto """ - self._databases = databases + self._database = database @property def image(self): diff --git a/swagger/api/api_database/models/creator_dto.py b/swagger/api/api_database/models/creator_dto.py index e45b85f54d837323447fe5df46828cb61797e885..bd885db65e9d9b5f0633e9ecc7246d5690a674ef 100644 --- a/swagger/api/api_database/models/creator_dto.py +++ b/swagger/api/api_database/models/creator_dto.py @@ -29,7 +29,8 @@ class CreatorDto(object): """ swagger_types = { 'id': 'int', - 'name': 'str', + 'firstname': 'str', + 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', 'created': 'datetime', @@ -38,29 +39,33 @@ class CreatorDto(object): attribute_map = { 'id': 'id', - 'name': 'name', + 'firstname': 'firstname', + 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', 'created': 'created', - 'last_modified': 'last_modified' + 'last_modified': 'lastModified' } - def __init__(self, id=None, name=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, firstname=None, lastname=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 """CreatorDto - a model defined in Swagger""" # noqa: E501 self._id = None - self._name = None + self._firstname = None + self._lastname = None self._affiliation = None self._orcid = None self._created = None self._last_modified = None self.discriminator = None self.id = id - self.name = name + self.firstname = firstname + self.lastname = lastname if affiliation is not None: self.affiliation = affiliation if orcid is not None: self.orcid = orcid - self.created = created + if created is not None: + self.created = created if last_modified is not None: self.last_modified = last_modified @@ -88,27 +93,50 @@ class CreatorDto(object): self._id = id @property - def name(self): - """Gets the name of this CreatorDto. # noqa: E501 + def firstname(self): + """Gets the firstname of this CreatorDto. # noqa: E501 - :return: The name of this CreatorDto. # noqa: E501 + :return: The firstname of this CreatorDto. # noqa: E501 :rtype: str """ - return self._name + return self._firstname - @name.setter - def name(self, name): - """Sets the name of this CreatorDto. + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorDto. - :param name: The name of this CreatorDto. # noqa: E501 + :param firstname: The firstname of this CreatorDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 - self._name = name + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorDto. # noqa: E501 + + + :return: The lastname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorDto. + + + :param lastname: The lastname of this CreatorDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname @property def affiliation(self): @@ -170,8 +198,6 @@ class CreatorDto(object): :param created: The created of this CreatorDto. # noqa: E501 :type: datetime """ - if created is None: - raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 self._created = created diff --git a/swagger/api/api_database/models/database_access_dto.py b/swagger/api/api_database/models/database_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..a5a25ee3bfd6c262387b2287d19e672c479d60a1 --- /dev/null +++ b/swagger/api/api_database/models/database_access_dto.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Database Repository Database Service API + + Service that manages the databases # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user': 'UserDto', + 'type': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'user': 'user', + 'type': 'type', + 'created': 'created' + } + + def __init__(self, user=None, type=None, created=None): # noqa: E501 + """DatabaseAccessDto - a model defined in Swagger""" # noqa: E501 + self._user = None + self._type = None + self._created = None + self.discriminator = None + self.user = user + self.type = type + if created is not None: + self.created = created + + @property + def user(self): + """Gets the user of this DatabaseAccessDto. # noqa: E501 + + + :return: The user of this DatabaseAccessDto. # noqa: E501 + :rtype: UserDto + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this DatabaseAccessDto. + + + :param user: The user of this DatabaseAccessDto. # noqa: E501 + :type: UserDto + """ + if user is None: + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + @property + def type(self): + """Gets the type of this DatabaseAccessDto. # noqa: E501 + + + :return: The type of this DatabaseAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseAccessDto. + + + :param type: The type of this DatabaseAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def created(self): + """Gets the created of this DatabaseAccessDto. # noqa: E501 + + + :return: The created of this DatabaseAccessDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseAccessDto. + + + :param created: The created of this DatabaseAccessDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_database/models/database_brief_dto.py b/swagger/api/api_database/models/database_brief_dto.py index 1597621ff1c3dfb49a7b63125415bd8c2516d04e..5ba4c4f7d793639dc53c430c9ce9a8136ca928eb 100644 --- a/swagger/api/api_database/models/database_brief_dto.py +++ b/swagger/api/api_database/models/database_brief_dto.py @@ -31,7 +31,7 @@ class DatabaseBriefDto(object): 'id': 'int', 'name': 'str', 'description': 'str', - 'identifier': 'IdentifierBriefDto', + 'identifier': 'IdentifierDto', 'engine': 'str', 'container': 'ContainerBriefDto', 'creator': 'UserBriefDto', @@ -153,7 +153,7 @@ class DatabaseBriefDto(object): :return: The identifier of this DatabaseBriefDto. # noqa: E501 - :rtype: IdentifierBriefDto + :rtype: IdentifierDto """ return self._identifier @@ -163,7 +163,7 @@ class DatabaseBriefDto(object): :param identifier: The identifier of this DatabaseBriefDto. # noqa: E501 - :type: IdentifierBriefDto + :type: IdentifierDto """ self._identifier = identifier diff --git a/swagger/api/api_database/models/database_dto.py b/swagger/api/api_database/models/database_dto.py index 28909d435b7b96b6171e494eb9a4a97f1fe1f9a7..c996c3ab6a34fcc5675b217cceecab4ad91be2fa 100644 --- a/swagger/api/api_database/models/database_dto.py +++ b/swagger/api/api_database/models/database_dto.py @@ -30,15 +30,15 @@ class DatabaseDto(object): swagger_types = { 'id': 'int', 'name': 'str', - 'exchange': 'str', 'creator': 'UserBriefDto', 'identifier': 'IdentifierDto', 'description': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', + 'accesses': 'list[DatabaseAccessDto]', 'created': 'datetime', - 'deleted': 'datetime', + 'exchange_name': 'str', 'internal_name': 'str', 'is_public': 'bool' } @@ -46,38 +46,37 @@ class DatabaseDto(object): attribute_map = { 'id': 'id', 'name': 'name', - 'exchange': 'exchange', 'creator': 'creator', 'identifier': 'identifier', 'description': 'description', 'tables': 'tables', 'image': 'image', 'container': 'container', + 'accesses': 'accesses', 'created': 'created', - 'deleted': 'deleted', + 'exchange_name': 'exchange_name', 'internal_name': 'internal_name', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, accesses=None, created=None, exchange_name=None, internal_name=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None - self._exchange = None self._creator = None self._identifier = None self._description = None self._tables = None self._image = None self._container = None + self._accesses = None self._created = None - self._deleted = None + self._exchange_name = None self._internal_name = None self._is_public = None self.discriminator = None self.id = id self.name = name - self.exchange = exchange self.creator = creator if identifier is not None: self.identifier = identifier @@ -89,10 +88,11 @@ class DatabaseDto(object): self.image = image if container is not None: self.container = container + if accesses is not None: + self.accesses = accesses if created is not None: self.created = created - if deleted is not None: - self.deleted = deleted + self.exchange_name = exchange_name self.internal_name = internal_name if is_public is not None: self.is_public = is_public @@ -143,29 +143,6 @@ class DatabaseDto(object): self._name = name - @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 - - - :return: The exchange of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. - - - :param exchange: The exchange of this DatabaseDto. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - @property def creator(self): """Gets the creator of this DatabaseDto. # noqa: E501 @@ -294,6 +271,27 @@ class DatabaseDto(object): self._container = container + @property + def accesses(self): + """Gets the accesses of this DatabaseDto. # noqa: E501 + + + :return: The accesses of this DatabaseDto. # noqa: E501 + :rtype: list[DatabaseAccessDto] + """ + return self._accesses + + @accesses.setter + def accesses(self, accesses): + """Sets the accesses of this DatabaseDto. + + + :param accesses: The accesses of this DatabaseDto. # noqa: E501 + :type: list[DatabaseAccessDto] + """ + + self._accesses = accesses + @property def created(self): """Gets the created of this DatabaseDto. # noqa: E501 @@ -316,25 +314,27 @@ class DatabaseDto(object): self._created = created @property - def deleted(self): - """Gets the deleted of this DatabaseDto. # noqa: E501 + def exchange_name(self): + """Gets the exchange_name of this DatabaseDto. # noqa: E501 - :return: The deleted of this DatabaseDto. # noqa: E501 - :rtype: datetime + :return: The exchange_name of this DatabaseDto. # noqa: E501 + :rtype: str """ - return self._deleted + return self._exchange_name - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this DatabaseDto. + @exchange_name.setter + def exchange_name(self, exchange_name): + """Sets the exchange_name of this DatabaseDto. - :param deleted: The deleted of this DatabaseDto. # noqa: E501 - :type: datetime + :param exchange_name: The exchange_name of this DatabaseDto. # noqa: E501 + :type: str """ + if exchange_name is None: + raise ValueError("Invalid value for `exchange_name`, must not be `None`") # noqa: E501 - self._deleted = deleted + self._exchange_name = exchange_name @property def internal_name(self): diff --git a/swagger/api/api_database/models/database_give_access_dto.py b/swagger/api/api_database/models/database_give_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..50c39f65ed4026a94397a545b25f05bf2336e29f --- /dev/null +++ b/swagger/api/api_database/models/database_give_access_dto.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Database Repository Database Service API + + Service that manages the databases # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseGiveAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'username': 'str', + 'type': 'str' + } + + attribute_map = { + 'username': 'username', + 'type': 'type' + } + + def __init__(self, username=None, type=None): # noqa: E501 + """DatabaseGiveAccessDto - a model defined in Swagger""" # noqa: E501 + self._username = None + self._type = None + self.discriminator = None + self.username = username + self.type = type + + @property + def username(self): + """Gets the username of this DatabaseGiveAccessDto. # noqa: E501 + + + :return: The username of this DatabaseGiveAccessDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this DatabaseGiveAccessDto. + + + :param username: The username of this DatabaseGiveAccessDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def type(self): + """Gets the type of this DatabaseGiveAccessDto. # noqa: E501 + + + :return: The type of this DatabaseGiveAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseGiveAccessDto. + + + :param type: The type of this DatabaseGiveAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseGiveAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseGiveAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_database/models/database_modify_access_dto.py b/swagger/api/api_database/models/database_modify_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c95b40167b95a037621bbec54b64e00c2232569a --- /dev/null +++ b/swagger/api/api_database/models/database_modify_access_dto.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Database Repository Database Service API + + Service that manages the databases # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseModifyAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str' + } + + attribute_map = { + 'type': 'type' + } + + def __init__(self, type=None): # noqa: E501 + """DatabaseModifyAccessDto - a model defined in Swagger""" # noqa: E501 + self._type = None + self.discriminator = None + self.type = type + + @property + def type(self): + """Gets the type of this DatabaseModifyAccessDto. # noqa: E501 + + + :return: The type of this DatabaseModifyAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseModifyAccessDto. + + + :param type: The type of this DatabaseModifyAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseModifyAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseModifyAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_database/models/database_modify_dto.py b/swagger/api/api_database/models/database_modify_dto.py deleted file mode 100644 index 5e06737345cf1408c32915c4c7f744635a08dc0b..0000000000000000000000000000000000000000 --- a/swagger/api/api_database/models/database_modify_dto.py +++ /dev/null @@ -1,332 +0,0 @@ -# coding: utf-8 - -""" - Database Repository Database Service API - - Service that manages the databases # noqa: E501 - - OpenAPI spec version: 1.1.0-alpha - Contact: andreas.rauber@tuwien.ac.at - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class DatabaseModifyDto(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'subjects': 'list[str]', - 'description': 'str', - 'publisher': 'str', - 'license': 'LicenseDto', - 'language': 'str', - 'publication_year': 'int', - 'publication_month': 'int', - 'publication_day': 'int', - 'contact_person': 'str' - } - - attribute_map = { - 'subjects': 'subjects', - 'description': 'description', - 'publisher': 'publisher', - 'license': 'license', - 'language': 'language', - 'publication_year': 'publication_year', - 'publication_month': 'publication_month', - 'publication_day': 'publication_day', - 'contact_person': 'contact_person' - } - - def __init__(self, subjects=None, description=None, publisher=None, license=None, language=None, publication_year=None, publication_month=None, publication_day=None, contact_person=None): # noqa: E501 - """DatabaseModifyDto - a model defined in Swagger""" # noqa: E501 - self._subjects = None - self._description = None - self._publisher = None - self._license = None - self._language = None - self._publication_year = None - self._publication_month = None - self._publication_day = None - self._contact_person = None - self.discriminator = None - if subjects is not None: - self.subjects = subjects - if description is not None: - self.description = description - self.publisher = publisher - if license is not None: - self.license = license - if language is not None: - self.language = language - self.publication_year = publication_year - if publication_month is not None: - self.publication_month = publication_month - if publication_day is not None: - self.publication_day = publication_day - if contact_person is not None: - self.contact_person = contact_person - - @property - def subjects(self): - """Gets the subjects of this DatabaseModifyDto. # noqa: E501 - - - :return: The subjects of this DatabaseModifyDto. # noqa: E501 - :rtype: list[str] - """ - return self._subjects - - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseModifyDto. - - - :param subjects: The subjects of this DatabaseModifyDto. # noqa: E501 - :type: list[str] - """ - - self._subjects = subjects - - @property - def description(self): - """Gets the description of this DatabaseModifyDto. # noqa: E501 - - - :return: The description of this DatabaseModifyDto. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this DatabaseModifyDto. - - - :param description: The description of this DatabaseModifyDto. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def publisher(self): - """Gets the publisher of this DatabaseModifyDto. # noqa: E501 - - - :return: The publisher of this DatabaseModifyDto. # noqa: E501 - :rtype: str - """ - return self._publisher - - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseModifyDto. - - - :param publisher: The publisher of this DatabaseModifyDto. # noqa: E501 - :type: str - """ - if publisher is None: - raise ValueError("Invalid value for `publisher`, must not be `None`") # noqa: E501 - - self._publisher = publisher - - @property - def license(self): - """Gets the license of this DatabaseModifyDto. # noqa: E501 - - - :return: The license of this DatabaseModifyDto. # noqa: E501 - :rtype: LicenseDto - """ - return self._license - - @license.setter - def license(self, license): - """Sets the license of this DatabaseModifyDto. - - - :param license: The license of this DatabaseModifyDto. # noqa: E501 - :type: LicenseDto - """ - - self._license = license - - @property - def language(self): - """Gets the language of this DatabaseModifyDto. # noqa: E501 - - - :return: The language of this DatabaseModifyDto. # noqa: E501 - :rtype: str - """ - return self._language - - @language.setter - def language(self, language): - """Sets the language of this DatabaseModifyDto. - - - :param language: The language of this DatabaseModifyDto. # noqa: E501 - :type: str - """ - allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 - if language not in allowed_values: - raise ValueError( - "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 - .format(language, allowed_values) - ) - - self._language = language - - @property - def publication_year(self): - """Gets the publication_year of this DatabaseModifyDto. # noqa: E501 - - database publication year # noqa: E501 - - :return: The publication_year of this DatabaseModifyDto. # noqa: E501 - :rtype: int - """ - return self._publication_year - - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseModifyDto. - - database publication year # noqa: E501 - - :param publication_year: The publication_year of this DatabaseModifyDto. # noqa: E501 - :type: int - """ - if publication_year is None: - raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 - - self._publication_year = publication_year - - @property - def publication_month(self): - """Gets the publication_month of this DatabaseModifyDto. # noqa: E501 - - database publication month # noqa: E501 - - :return: The publication_month of this DatabaseModifyDto. # noqa: E501 - :rtype: int - """ - return self._publication_month - - @publication_month.setter - def publication_month(self, publication_month): - """Sets the publication_month of this DatabaseModifyDto. - - database publication month # noqa: E501 - - :param publication_month: The publication_month of this DatabaseModifyDto. # noqa: E501 - :type: int - """ - - self._publication_month = publication_month - - @property - def publication_day(self): - """Gets the publication_day of this DatabaseModifyDto. # noqa: E501 - - database publication day # noqa: E501 - - :return: The publication_day of this DatabaseModifyDto. # noqa: E501 - :rtype: int - """ - return self._publication_day - - @publication_day.setter - def publication_day(self, publication_day): - """Sets the publication_day of this DatabaseModifyDto. - - database publication day # noqa: E501 - - :param publication_day: The publication_day of this DatabaseModifyDto. # noqa: E501 - :type: int - """ - - self._publication_day = publication_day - - @property - def contact_person(self): - """Gets the contact_person of this DatabaseModifyDto. # noqa: E501 - - - :return: The contact_person of this DatabaseModifyDto. # noqa: E501 - :rtype: str - """ - return self._contact_person - - @contact_person.setter - def contact_person(self, contact_person): - """Sets the contact_person of this DatabaseModifyDto. - - - :param contact_person: The contact_person of this DatabaseModifyDto. # noqa: E501 - :type: str - """ - - self._contact_person = contact_person - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(DatabaseModifyDto, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, DatabaseModifyDto): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/swagger/api/api_database/models/identifier_dto.py b/swagger/api/api_database/models/identifier_dto.py index 72b5f5e29b762116b7c11edd6a70ba39dd500aad..48a741090097925183288eb1aa8b1ba1ee4c4f9c 100644 --- a/swagger/api/api_database/models/identifier_dto.py +++ b/swagger/api/api_database/models/identifier_dto.py @@ -37,7 +37,6 @@ class IdentifierDto(object): 'visibility': 'str', 'doi': 'str', 'publisher': 'str', - 'creator': 'UserDto', 'language': 'str', 'license': 'LicenseDto', 'creators': 'list[CreatorDto]', @@ -66,7 +65,6 @@ class IdentifierDto(object): 'visibility': 'visibility', 'doi': 'doi', 'publisher': 'publisher', - 'creator': 'creator', 'language': 'language', 'license': 'license', 'creators': 'creators', @@ -85,7 +83,7 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._type = None @@ -96,7 +94,6 @@ class IdentifierDto(object): self._visibility = None self._doi = None self._publisher = None - self._creator = None self._language = None self._license = None self._creators = None @@ -127,7 +124,6 @@ class IdentifierDto(object): self.doi = doi if publisher is not None: self.publisher = publisher - self.creator = creator if language is not None: self.language = language if license is not None: @@ -364,29 +360,6 @@ class IdentifierDto(object): self._publisher = publisher - @property - def creator(self): - """Gets the creator of this IdentifierDto. # noqa: E501 - - - :return: The creator of this IdentifierDto. # noqa: E501 - :rtype: UserDto - """ - return self._creator - - @creator.setter - def creator(self, creator): - """Sets the creator of this IdentifierDto. - - - :param creator: The creator of this IdentifierDto. # noqa: E501 - :type: UserDto - """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 - - self._creator = creator - @property def language(self): """Gets the language of this IdentifierDto. # noqa: E501 diff --git a/swagger/api/api_database/models/related_identifier_dto.py b/swagger/api/api_database/models/related_identifier_dto.py index 5742b421d56ec2876f3c4fcf063fb3e9e114b30b..68086cfa172fe57ca59a1ed7f4ec740e22392507 100644 --- a/swagger/api/api_database/models/related_identifier_dto.py +++ b/swagger/api/api_database/models/related_identifier_dto.py @@ -33,7 +33,6 @@ class RelatedIdentifierDto(object): 'type': 'str', 'relation': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'last_modified': 'datetime' } @@ -43,18 +42,16 @@ class RelatedIdentifierDto(object): 'type': 'type', 'relation': 'relation', 'created': 'created', - 'deleted': 'deleted', 'last_modified': 'last_modified' } - def __init__(self, id=None, value=None, type=None, relation=None, created=None, deleted=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None): # noqa: E501 """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._value = None self._type = None self._relation = None self._created = None - self._deleted = None self._last_modified = None self.discriminator = None self.id = id @@ -64,8 +61,6 @@ class RelatedIdentifierDto(object): if relation is not None: self.relation = relation self.created = created - if deleted is not None: - self.deleted = deleted if last_modified is not None: self.last_modified = last_modified @@ -192,27 +187,6 @@ class RelatedIdentifierDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this RelatedIdentifierDto. # noqa: E501 - - - :return: The deleted of this RelatedIdentifierDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this RelatedIdentifierDto. - - - :param deleted: The deleted of this RelatedIdentifierDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def last_modified(self): """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 diff --git a/swagger/api/api_database/models/table_brief_dto.py b/swagger/api/api_database/models/table_brief_dto.py index 168f85b02f7b36375e25f3efa685455c010c72c4..c77a8a31193d3002fe064b09ecc779556eae7496 100644 --- a/swagger/api/api_database/models/table_brief_dto.py +++ b/swagger/api/api_database/models/table_brief_dto.py @@ -30,6 +30,7 @@ class TableBriefDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'description': 'str', 'creator': 'UserBriefDto', 'internal_name': 'str' } @@ -37,19 +38,22 @@ class TableBriefDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'description': 'description', 'creator': 'creator', 'internal_name': 'internal_name' } - def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, description=None, creator=None, internal_name=None): # noqa: E501 """TableBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._description = None self._creator = None self._internal_name = None self.discriminator = None self.id = id self.name = name + self.description = description self.creator = creator self.internal_name = internal_name @@ -99,6 +103,29 @@ class TableBriefDto(object): self._name = name + @property + def description(self): + """Gets the description of this TableBriefDto. # noqa: E501 + + + :return: The description of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableBriefDto. + + + :param description: The description of this TableBriefDto. # noqa: E501 + :type: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + @property def creator(self): """Gets the creator of this TableBriefDto. # noqa: E501 diff --git a/swagger/api/api_database/models/user_brief_dto.py b/swagger/api/api_database/models/user_brief_dto.py index 8803ecc7bd620090e37f9ede772206c9e2d9b35c..151dea2588163232ded8067f494ca9c2a5923f00 100644 --- a/swagger/api/api_database/models/user_brief_dto.py +++ b/swagger/api/api_database/models/user_brief_dto.py @@ -30,12 +30,13 @@ class UserBriefDto(object): swagger_types = { 'id': 'int', 'username': 'str', + 'titles_before': 'str', + 'titles_after': 'str', 'firstname': 'str', 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', - 'titles_before': 'str', - 'titles_after': 'str', + 'roles': 'list[str]', 'theme_dark': 'bool', 'email_verified': 'bool' } @@ -43,31 +44,37 @@ class UserBriefDto(object): attribute_map = { 'id': 'id', 'username': 'username', + 'titles_before': 'titlesBefore', + 'titles_after': 'titlesAfter', 'firstname': 'firstname', 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', - 'titles_before': 'titles_before', - 'titles_after': 'titles_after', - 'theme_dark': 'theme_dark', - 'email_verified': 'email_verified' + 'roles': 'roles', + 'theme_dark': 'themeDark', + 'email_verified': 'emailVerified' } - def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, username=None, titles_before=None, titles_after=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, theme_dark=None, email_verified=None): # noqa: E501 """UserBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._username = None + self._titles_before = None + self._titles_after = None self._firstname = None self._lastname = None self._affiliation = None self._orcid = None - self._titles_before = None - self._titles_after = None + self._roles = None self._theme_dark = None self._email_verified = None self.discriminator = None self.id = id self.username = username + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after if firstname is not None: self.firstname = firstname if lastname is not None: @@ -76,12 +83,11 @@ class UserBriefDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid - if titles_before is not None: - self.titles_before = titles_before - if titles_after is not None: - self.titles_after = titles_after - self.theme_dark = theme_dark - self.email_verified = email_verified + self.roles = roles + if theme_dark is not None: + self.theme_dark = theme_dark + if email_verified is not None: + self.email_verified = email_verified @property def id(self): @@ -131,6 +137,48 @@ class UserBriefDto(object): self._username = username + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + @property def firstname(self): """Gets the firstname of this UserBriefDto. # noqa: E501 @@ -216,46 +264,29 @@ class UserBriefDto(object): self._orcid = orcid @property - def titles_before(self): - """Gets the titles_before of this UserBriefDto. # noqa: E501 + def roles(self): + """Gets the roles of this UserBriefDto. # noqa: E501 + Roles of the user # noqa: E501 - :return: The titles_before of this UserBriefDto. # noqa: E501 - :rtype: str + :return: The roles of this UserBriefDto. # noqa: E501 + :rtype: list[str] """ - return self._titles_before + return self._roles - @titles_before.setter - def titles_before(self, titles_before): - """Sets the titles_before of this UserBriefDto. + @roles.setter + def roles(self, roles): + """Sets the roles of this UserBriefDto. + Roles of the user # noqa: E501 - :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 - :type: str + :param roles: The roles of this UserBriefDto. # noqa: E501 + :type: list[str] """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 - self._titles_before = titles_before - - @property - def titles_after(self): - """Gets the titles_after of this UserBriefDto. # noqa: E501 - - - :return: The titles_after of this UserBriefDto. # noqa: E501 - :rtype: str - """ - return self._titles_after - - @titles_after.setter - def titles_after(self, titles_after): - """Sets the titles_after of this UserBriefDto. - - - :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 - :type: str - """ - - self._titles_after = titles_after + self._roles = roles @property def theme_dark(self): @@ -275,8 +306,6 @@ class UserBriefDto(object): :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 :type: bool """ - if theme_dark is None: - raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 self._theme_dark = theme_dark @@ -298,8 +327,6 @@ class UserBriefDto(object): :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 :type: bool """ - if email_verified is None: - raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 self._email_verified = email_verified diff --git a/swagger/api/api_database/models/user_dto.py b/swagger/api/api_database/models/user_dto.py index 46206a4a60b0d254b5f407d9a758a1ca87199bb0..279a05db9e51ca252b432bf852d9eb6f78019fdd 100644 --- a/swagger/api/api_database/models/user_dto.py +++ b/swagger/api/api_database/models/user_dto.py @@ -35,6 +35,7 @@ class UserDto(object): 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', + 'roles': 'list[str]', 'containers': 'list[ContainerDto]', 'databases': 'list[ContainerDto]', 'identifiers': 'list[ContainerDto]', @@ -53,6 +54,7 @@ class UserDto(object): 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', + 'roles': 'roles', 'containers': 'containers', 'databases': 'databases', 'identifiers': 'identifiers', @@ -63,7 +65,7 @@ class UserDto(object): 'email_verified': 'email_verified' } - def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 """UserDto - a model defined in Swagger""" # noqa: E501 self._id = None self._authorities = None @@ -72,6 +74,7 @@ class UserDto(object): self._lastname = None self._affiliation = None self._orcid = None + self._roles = None self._containers = None self._databases = None self._identifiers = None @@ -93,6 +96,7 @@ class UserDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid + self.roles = roles if containers is not None: self.containers = containers if databases is not None: @@ -260,6 +264,31 @@ class UserDto(object): self._orcid = orcid + @property + def roles(self): + """Gets the roles of this UserDto. # noqa: E501 + + Roles of the user # noqa: E501 + + :return: The roles of this UserDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UserDto. + + Roles of the user # noqa: E501 + + :param roles: The roles of this UserDto. # noqa: E501 + :type: list[str] + """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + + self._roles = roles + @property def containers(self): """Gets the containers of this UserDto. # noqa: E501 diff --git a/swagger/api/api_identifier/__init__.py b/swagger/api/api_identifier/__init__.py index 004d1c92b4090d4278f7b889ddf19bcceed7077e..a763c014bdc945fa0aadbf0d9c84c3c4e2e8b487 100644 --- a/swagger/api/api_identifier/__init__.py +++ b/swagger/api/api_identifier/__init__.py @@ -22,20 +22,10 @@ from api_identifier.api_client import ApiClient from api_identifier.configuration import Configuration # import models into sdk package from api_identifier.models.api_error_dto import ApiErrorDto -from api_identifier.models.container_dto import ContainerDto from api_identifier.models.creator_create_dto import CreatorCreateDto from api_identifier.models.creator_dto import CreatorDto -from api_identifier.models.database_dto import DatabaseDto -from api_identifier.models.granted_authority_dto import GrantedAuthorityDto from api_identifier.models.identifier_create_dto import IdentifierCreateDto from api_identifier.models.identifier_dto import IdentifierDto -from api_identifier.models.image_brief_dto import ImageBriefDto -from api_identifier.models.image_date_dto import ImageDateDto -from api_identifier.models.image_dto import ImageDto -from api_identifier.models.image_env_item_dto import ImageEnvItemDto from api_identifier.models.license_dto import LicenseDto from api_identifier.models.related_identifier_create_dto import RelatedIdentifierCreateDto from api_identifier.models.related_identifier_dto import RelatedIdentifierDto -from api_identifier.models.table_brief_dto import TableBriefDto -from api_identifier.models.user_brief_dto import UserBriefDto -from api_identifier.models.user_dto import UserDto diff --git a/swagger/api/api_identifier/api/identifier_endpoint_api.py b/swagger/api/api_identifier/api/identifier_endpoint_api.py index 7dee02a333d5089b86feecf4bc2c39f81eeb9bcf..0dc412fe3104c353aaffb2b0a83c40131db90cda 100644 --- a/swagger/api/api_identifier/api/identifier_endpoint_api.py +++ b/swagger/api/api_identifier/api/identifier_endpoint_api.py @@ -138,7 +138,7 @@ class IdentifierEndpointApi(object): collection_formats=collection_formats) def delete(self, id, **kwargs): # noqa: E501 - """Delete some identifer # noqa: E501 + """Delete some identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -159,7 +159,7 @@ class IdentifierEndpointApi(object): return data def delete_with_http_info(self, id, **kwargs): # noqa: E501 - """Delete some identifer # noqa: E501 + """Delete some identifier # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -196,10 +196,10 @@ class IdentifierEndpointApi(object): collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'id' in params: - query_params.append(('id', params['id'])) # noqa: E501 header_params = {} @@ -230,99 +230,6 @@ class IdentifierEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def export(self, id, **kwargs): # noqa: E501 - """Export some identifier metadata # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.export(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int id: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.export_with_http_info(id, **kwargs) # noqa: E501 - else: - (data) = self.export_with_http_info(id, **kwargs) # noqa: E501 - return data - - def export_with_http_info(self, id, **kwargs): # noqa: E501 - """Export some identifier metadata # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.export_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int id: (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method export" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `export`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = [] # noqa: E501 - - return self.api_client.call_api( - '/api/identifier/{id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - def list(self, **kwargs): # noqa: E501 """Find identifiers # noqa: E501 @@ -481,10 +388,10 @@ class IdentifierEndpointApi(object): collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'id' in params: - query_params.append(('id', params['id'])) # noqa: E501 header_params = {} diff --git a/swagger/api/api_identifier/models/__init__.py b/swagger/api/api_identifier/models/__init__.py index 10de3f2d883f13ef5e5b73c543d8a8c8b770850d..88b5d876c5be2e158dd6f49eba020905f6b5ef86 100644 --- a/swagger/api/api_identifier/models/__init__.py +++ b/swagger/api/api_identifier/models/__init__.py @@ -15,20 +15,10 @@ from __future__ import absolute_import # import models into model package from api_identifier.models.api_error_dto import ApiErrorDto -from api_identifier.models.container_dto import ContainerDto from api_identifier.models.creator_create_dto import CreatorCreateDto from api_identifier.models.creator_dto import CreatorDto -from api_identifier.models.database_dto import DatabaseDto -from api_identifier.models.granted_authority_dto import GrantedAuthorityDto from api_identifier.models.identifier_create_dto import IdentifierCreateDto from api_identifier.models.identifier_dto import IdentifierDto -from api_identifier.models.image_brief_dto import ImageBriefDto -from api_identifier.models.image_date_dto import ImageDateDto -from api_identifier.models.image_dto import ImageDto -from api_identifier.models.image_env_item_dto import ImageEnvItemDto from api_identifier.models.license_dto import LicenseDto from api_identifier.models.related_identifier_create_dto import RelatedIdentifierCreateDto from api_identifier.models.related_identifier_dto import RelatedIdentifierDto -from api_identifier.models.table_brief_dto import TableBriefDto -from api_identifier.models.user_brief_dto import UserBriefDto -from api_identifier.models.user_dto import UserDto diff --git a/swagger/api/api_identifier/models/creator_create_dto.py b/swagger/api/api_identifier/models/creator_create_dto.py index ff3331393ff708e809b5a21c25ccc0fa6edfa9e8..201d45cf3859eb5eade5fb771641502cd9ca99fa 100644 --- a/swagger/api/api_identifier/models/creator_create_dto.py +++ b/swagger/api/api_identifier/models/creator_create_dto.py @@ -28,51 +28,78 @@ class CreatorCreateDto(object): and the value is json key in definition. """ swagger_types = { - 'name': 'str', + 'firstname': 'str', + 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str' } attribute_map = { - 'name': 'name', + 'firstname': 'firstname', + 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid' } - def __init__(self, name=None, affiliation=None, orcid=None): # noqa: E501 + def __init__(self, firstname=None, lastname=None, affiliation=None, orcid=None): # noqa: E501 """CreatorCreateDto - a model defined in Swagger""" # noqa: E501 - self._name = None + self._firstname = None + self._lastname = None self._affiliation = None self._orcid = None self.discriminator = None - self.name = name + self.firstname = firstname + self.lastname = lastname if affiliation is not None: self.affiliation = affiliation if orcid is not None: self.orcid = orcid @property - def name(self): - """Gets the name of this CreatorCreateDto. # noqa: E501 + def firstname(self): + """Gets the firstname of this CreatorCreateDto. # noqa: E501 - :return: The name of this CreatorCreateDto. # noqa: E501 + :return: The firstname of this CreatorCreateDto. # noqa: E501 :rtype: str """ - return self._name + return self._firstname - @name.setter - def name(self, name): - """Sets the name of this CreatorCreateDto. + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorCreateDto. - :param name: The name of this CreatorCreateDto. # noqa: E501 + :param firstname: The firstname of this CreatorCreateDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 - self._name = name + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorCreateDto. # noqa: E501 + + + :return: The lastname of this CreatorCreateDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorCreateDto. + + + :param lastname: The lastname of this CreatorCreateDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname @property def affiliation(self): diff --git a/swagger/api/api_identifier/models/creator_dto.py b/swagger/api/api_identifier/models/creator_dto.py index ebe85cc6c7b14cdb49c10b1b711a06d148ab9095..59dbc9395e5c0588d75de63456419bbf83fbe169 100644 --- a/swagger/api/api_identifier/models/creator_dto.py +++ b/swagger/api/api_identifier/models/creator_dto.py @@ -29,7 +29,8 @@ class CreatorDto(object): """ swagger_types = { 'id': 'int', - 'name': 'str', + 'firstname': 'str', + 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', 'created': 'datetime', @@ -38,29 +39,33 @@ class CreatorDto(object): attribute_map = { 'id': 'id', - 'name': 'name', + 'firstname': 'firstname', + 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', 'created': 'created', - 'last_modified': 'last_modified' + 'last_modified': 'lastModified' } - def __init__(self, id=None, name=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, firstname=None, lastname=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 """CreatorDto - a model defined in Swagger""" # noqa: E501 self._id = None - self._name = None + self._firstname = None + self._lastname = None self._affiliation = None self._orcid = None self._created = None self._last_modified = None self.discriminator = None self.id = id - self.name = name + self.firstname = firstname + self.lastname = lastname if affiliation is not None: self.affiliation = affiliation if orcid is not None: self.orcid = orcid - self.created = created + if created is not None: + self.created = created if last_modified is not None: self.last_modified = last_modified @@ -88,27 +93,50 @@ class CreatorDto(object): self._id = id @property - def name(self): - """Gets the name of this CreatorDto. # noqa: E501 + def firstname(self): + """Gets the firstname of this CreatorDto. # noqa: E501 - :return: The name of this CreatorDto. # noqa: E501 + :return: The firstname of this CreatorDto. # noqa: E501 :rtype: str """ - return self._name + return self._firstname - @name.setter - def name(self, name): - """Sets the name of this CreatorDto. + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorDto. - :param name: The name of this CreatorDto. # noqa: E501 + :param firstname: The firstname of this CreatorDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 - self._name = name + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorDto. # noqa: E501 + + + :return: The lastname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorDto. + + + :param lastname: The lastname of this CreatorDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname @property def affiliation(self): @@ -170,8 +198,6 @@ class CreatorDto(object): :param created: The created of this CreatorDto. # noqa: E501 :type: datetime """ - if created is None: - raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 self._created = created diff --git a/swagger/api/api_identifier/models/identifier_dto.py b/swagger/api/api_identifier/models/identifier_dto.py index 7928313c8e56d3723ec0717fbd143b71ece18ff4..d6fb3eedd3e51fdf3d9c7a123983205efa39b518 100644 --- a/swagger/api/api_identifier/models/identifier_dto.py +++ b/swagger/api/api_identifier/models/identifier_dto.py @@ -37,7 +37,6 @@ class IdentifierDto(object): 'visibility': 'str', 'doi': 'str', 'publisher': 'str', - 'creator': 'UserDto', 'language': 'str', 'license': 'LicenseDto', 'creators': 'list[CreatorDto]', @@ -66,7 +65,6 @@ class IdentifierDto(object): 'visibility': 'visibility', 'doi': 'doi', 'publisher': 'publisher', - 'creator': 'creator', 'language': 'language', 'license': 'license', 'creators': 'creators', @@ -85,7 +83,7 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._type = None @@ -96,7 +94,6 @@ class IdentifierDto(object): self._visibility = None self._doi = None self._publisher = None - self._creator = None self._language = None self._license = None self._creators = None @@ -127,7 +124,6 @@ class IdentifierDto(object): self.doi = doi if publisher is not None: self.publisher = publisher - self.creator = creator if language is not None: self.language = language if license is not None: @@ -364,29 +360,6 @@ class IdentifierDto(object): self._publisher = publisher - @property - def creator(self): - """Gets the creator of this IdentifierDto. # noqa: E501 - - - :return: The creator of this IdentifierDto. # noqa: E501 - :rtype: UserDto - """ - return self._creator - - @creator.setter - def creator(self, creator): - """Sets the creator of this IdentifierDto. - - - :param creator: The creator of this IdentifierDto. # noqa: E501 - :type: UserDto - """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 - - self._creator = creator - @property def language(self): """Gets the language of this IdentifierDto. # noqa: E501 diff --git a/swagger/api/api_identifier/models/related_identifier_dto.py b/swagger/api/api_identifier/models/related_identifier_dto.py index 2d266227abb8fee7a15dfb0e9b7a86711b25b056..958ece15c9b0c17cd4321a9525597749673f7650 100644 --- a/swagger/api/api_identifier/models/related_identifier_dto.py +++ b/swagger/api/api_identifier/models/related_identifier_dto.py @@ -33,7 +33,6 @@ class RelatedIdentifierDto(object): 'type': 'str', 'relation': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'last_modified': 'datetime' } @@ -43,18 +42,16 @@ class RelatedIdentifierDto(object): 'type': 'type', 'relation': 'relation', 'created': 'created', - 'deleted': 'deleted', 'last_modified': 'last_modified' } - def __init__(self, id=None, value=None, type=None, relation=None, created=None, deleted=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None): # noqa: E501 """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._value = None self._type = None self._relation = None self._created = None - self._deleted = None self._last_modified = None self.discriminator = None self.id = id @@ -64,8 +61,6 @@ class RelatedIdentifierDto(object): if relation is not None: self.relation = relation self.created = created - if deleted is not None: - self.deleted = deleted if last_modified is not None: self.last_modified = last_modified @@ -192,27 +187,6 @@ class RelatedIdentifierDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this RelatedIdentifierDto. # noqa: E501 - - - :return: The deleted of this RelatedIdentifierDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this RelatedIdentifierDto. - - - :param deleted: The deleted of this RelatedIdentifierDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def last_modified(self): """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 diff --git a/swagger/api/api_metadata/models/oai_list_identifiers_parameters.py b/swagger/api/api_metadata/models/oai_list_identifiers_parameters.py index 9d3169865c8f2d53e3b6afe09f14843cb36ea3ac..9afdd185ae784ed6a1d0b26883f43949b25da6d7 100644 --- a/swagger/api/api_metadata/models/oai_list_identifiers_parameters.py +++ b/swagger/api/api_metadata/models/oai_list_identifiers_parameters.py @@ -33,9 +33,9 @@ class OaiListIdentifiersParameters(object): 'until': 'str', 'set': 'str', 'resumption_token': 'str', - 'parameters_string': 'str', 'from_date': 'datetime', - 'until_date': 'datetime' + 'until_date': 'datetime', + 'parameters_string': 'str' } attribute_map = { @@ -44,21 +44,21 @@ class OaiListIdentifiersParameters(object): 'until': 'until', 'set': 'set', 'resumption_token': 'resumptionToken', - 'parameters_string': 'parametersString', 'from_date': 'fromDate', - 'until_date': 'untilDate' + 'until_date': 'untilDate', + 'parameters_string': 'parametersString' } - def __init__(self, metadata_prefix=None, _from=None, until=None, set=None, resumption_token=None, parameters_string=None, from_date=None, until_date=None): # noqa: E501 + def __init__(self, metadata_prefix=None, _from=None, until=None, set=None, resumption_token=None, from_date=None, until_date=None, parameters_string=None): # noqa: E501 """OaiListIdentifiersParameters - a model defined in Swagger""" # noqa: E501 self._metadata_prefix = None self.__from = None self._until = None self._set = None self._resumption_token = None - self._parameters_string = None self._from_date = None self._until_date = None + self._parameters_string = None self.discriminator = None if metadata_prefix is not None: self.metadata_prefix = metadata_prefix @@ -70,12 +70,12 @@ class OaiListIdentifiersParameters(object): self.set = set if resumption_token is not None: self.resumption_token = resumption_token - if parameters_string is not None: - self.parameters_string = parameters_string if from_date is not None: self.from_date = from_date if until_date is not None: self.until_date = until_date + if parameters_string is not None: + self.parameters_string = parameters_string @property def metadata_prefix(self): @@ -182,27 +182,6 @@ class OaiListIdentifiersParameters(object): self._resumption_token = resumption_token - @property - def parameters_string(self): - """Gets the parameters_string of this OaiListIdentifiersParameters. # noqa: E501 - - - :return: The parameters_string of this OaiListIdentifiersParameters. # noqa: E501 - :rtype: str - """ - return self._parameters_string - - @parameters_string.setter - def parameters_string(self, parameters_string): - """Sets the parameters_string of this OaiListIdentifiersParameters. - - - :param parameters_string: The parameters_string of this OaiListIdentifiersParameters. # noqa: E501 - :type: str - """ - - self._parameters_string = parameters_string - @property def from_date(self): """Gets the from_date of this OaiListIdentifiersParameters. # noqa: E501 @@ -245,6 +224,27 @@ class OaiListIdentifiersParameters(object): self._until_date = until_date + @property + def parameters_string(self): + """Gets the parameters_string of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The parameters_string of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._parameters_string + + @parameters_string.setter + def parameters_string(self, parameters_string): + """Sets the parameters_string of this OaiListIdentifiersParameters. + + + :param parameters_string: The parameters_string of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._parameters_string = parameters_string + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/swagger/api/api_query/__init__.py b/swagger/api/api_query/__init__.py index d404e920f66c58cccdfd9db0e0b3cebd75468b1d..7ef9e5c01f93915f95e60a7302d18414df240507 100644 --- a/swagger/api/api_query/__init__.py +++ b/swagger/api/api_query/__init__.py @@ -28,6 +28,7 @@ from api_query.configuration import Configuration from api_query.models.api_error_dto import ApiErrorDto from api_query.models.container_dto import ContainerDto from api_query.models.creator_dto import CreatorDto +from api_query.models.database_access_dto import DatabaseAccessDto from api_query.models.database_dto import DatabaseDto from api_query.models.execute_statement_dto import ExecuteStatementDto from api_query.models.granted_authority_dto import GrantedAuthorityDto diff --git a/swagger/api/api_query/api/query_endpoint_api.py b/swagger/api/api_query/api/query_endpoint_api.py index 1747ab4a2e81fabe39b05fa078729ba13fe08811..9b1345be28b863d9515050b47d612fd0088915e1 100644 --- a/swagger/api/api_query/api/query_endpoint_api.py +++ b/swagger/api/api_query/api/query_endpoint_api.py @@ -146,7 +146,7 @@ class QueryEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/query', 'PUT', + '/api/container/{id}/database/{databaseId}/query', 'POST', path_params, query_params, header_params, @@ -161,49 +161,49 @@ class QueryEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def export1(self, id, database_id, query_id, **kwargs): # noqa: E501 + def export1(self, id, database_id, query_id, accept, **kwargs): # noqa: E501 """Exports some query # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.export1(id, database_id, query_id, async_req=True) + >>> thread = api.export1(id, database_id, query_id, accept, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) :param int query_id: (required) - :param str download: + :param str accept: (required) :return: object If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.export1_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + return self.export1_with_http_info(id, database_id, query_id, accept, **kwargs) # noqa: E501 else: - (data) = self.export1_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + (data) = self.export1_with_http_info(id, database_id, query_id, accept, **kwargs) # noqa: E501 return data - def export1_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 + def export1_with_http_info(self, id, database_id, query_id, accept, **kwargs): # noqa: E501 """Exports some query # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.export1_with_http_info(id, database_id, query_id, async_req=True) + >>> thread = api.export1_with_http_info(id, database_id, query_id, accept, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) :param int query_id: (required) - :param str download: + :param str accept: (required) :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'query_id', 'download'] # noqa: E501 + all_params = ['id', 'database_id', 'query_id', 'accept'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -230,6 +230,10 @@ class QueryEndpointApi(object): if ('query_id' not in params or params['query_id'] is None): raise ValueError("Missing the required parameter `query_id` when calling `export1`") # noqa: E501 + # verify the required parameter 'accept' is set + if ('accept' not in params or + params['accept'] is None): + raise ValueError("Missing the required parameter `accept` when calling `export1`") # noqa: E501 collection_formats = {} @@ -242,10 +246,10 @@ class QueryEndpointApi(object): path_params['queryId'] = params['query_id'] # noqa: E501 query_params = [] - if 'download' in params: - query_params.append(('download', params['download'])) # noqa: E501 header_params = {} + if 'accept' in params: + header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} diff --git a/swagger/api/api_query/api/store_endpoint_api.py b/swagger/api/api_query/api/store_endpoint_api.py index b649aef9251c2e8764e64bd8e21d453f87d0fc46..ef502eba15d9d7bb3992a928e9aba4a5ca9af1ac 100644 --- a/swagger/api/api_query/api/store_endpoint_api.py +++ b/swagger/api/api_query/api/store_endpoint_api.py @@ -32,12 +32,12 @@ class StoreEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def find(self, id, database_id, query_id, **kwargs): # noqa: E501 + def find1(self, id, database_id, query_id, **kwargs): # noqa: E501 """Find some query # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find(id, database_id, query_id, async_req=True) + >>> thread = api.find1(id, database_id, query_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -50,17 +50,17 @@ class StoreEndpointApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.find_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + return self.find1_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 else: - (data) = self.find_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + (data) = self.find1_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 return data - def find_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 + def find1_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 """Find some query # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_with_http_info(id, database_id, query_id, async_req=True) + >>> thread = api.find1_with_http_info(id, database_id, query_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -83,22 +83,22 @@ class StoreEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find" % key + " to method find1" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `find`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `find1`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `find`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `find1`") # noqa: E501 # verify the required parameter 'query_id' is set if ('query_id' not in params or params['query_id'] is None): - raise ValueError("Missing the required parameter `query_id` when calling `find`") # noqa: E501 + raise ValueError("Missing the required parameter `query_id` when calling `find1`") # noqa: E501 collection_formats = {} @@ -141,12 +141,12 @@ class StoreEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all2(self, id, database_id, **kwargs): # noqa: E501 + def find_all1(self, id, database_id, **kwargs): # noqa: E501 """Find queries # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all2(id, database_id, async_req=True) + >>> thread = api.find_all1(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -159,17 +159,17 @@ class StoreEndpointApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.find_all2_with_http_info(id, database_id, **kwargs) # noqa: E501 + return self.find_all1_with_http_info(id, database_id, **kwargs) # noqa: E501 else: - (data) = self.find_all2_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.find_all1_with_http_info(id, database_id, **kwargs) # noqa: E501 return data - def find_all2_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + def find_all1_with_http_info(self, id, database_id, **kwargs): # noqa: E501 """Find queries # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all2_with_http_info(id, database_id, async_req=True) + >>> thread = api.find_all1_with_http_info(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -192,18 +192,18 @@ class StoreEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_all2" % key + " to method find_all1" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `find_all2`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `find_all1`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `find_all2`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `find_all1`") # noqa: E501 collection_formats = {} diff --git a/swagger/api/api_query/api/view_endpoint_api.py b/swagger/api/api_query/api/view_endpoint_api.py index fc42b97b83ea3c970a8d8929084437b120761972..905b8817f9a74a942fe5acc8ebf203cb1f0f69d4 100644 --- a/swagger/api/api_query/api/view_endpoint_api.py +++ b/swagger/api/api_query/api/view_endpoint_api.py @@ -371,45 +371,47 @@ class ViewEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all(self, id, database_id, **kwargs): # noqa: E501 - """Find all views # noqa: E501 + def find(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Find one view # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all(id, database_id, async_req=True) + >>> thread = api.find(id, database_id, view_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :return: list[ViewBriefDto] + :param int view_id: (required) + :return: ViewDto If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + return self.find_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 else: - (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.find_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 return data - def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 - """Find all views # noqa: E501 + def find_with_http_info(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Find one view # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all_with_http_info(id, database_id, async_req=True) + >>> thread = api.find_with_http_info(id, database_id, view_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :return: list[ViewBriefDto] + :param int view_id: (required) + :return: ViewDto If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id'] # noqa: E501 + all_params = ['id', 'database_id', 'view_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -420,18 +422,22 @@ class ViewEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_all" % key + " to method find" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `find_all`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `find`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `find_all`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `find`") # noqa: E501 + # verify the required parameter 'view_id' is set + if ('view_id' not in params or + params['view_id'] is None): + raise ValueError("Missing the required parameter `view_id` when calling `find`") # noqa: E501 collection_formats = {} @@ -440,6 +446,8 @@ class ViewEndpointApi(object): path_params['id'] = params['id'] # noqa: E501 if 'database_id' in params: path_params['databaseId'] = params['database_id'] # noqa: E501 + if 'view_id' in params: + path_params['viewId'] = params['view_id'] # noqa: E501 query_params = [] @@ -457,14 +465,14 @@ class ViewEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/view', 'GET', + '/api/container/{id}/database/{databaseId}/view/{viewId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[ViewBriefDto]', # noqa: E501 + response_type='ViewDto', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -472,47 +480,45 @@ class ViewEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all1(self, id, database_id, view_id, **kwargs): # noqa: E501 - """Find one view # noqa: E501 + def find_all(self, id, database_id, **kwargs): # noqa: E501 + """Find all views # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all1(id, database_id, view_id, async_req=True) + >>> thread = api.find_all(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :param int view_id: (required) - :return: ViewDto + :return: list[ViewBriefDto] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.find_all1_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + return self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 else: - (data) = self.find_all1_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 return data - def find_all1_with_http_info(self, id, database_id, view_id, **kwargs): # noqa: E501 - """Find one view # noqa: E501 + def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """Find all views # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.find_all1_with_http_info(id, database_id, view_id, async_req=True) + >>> thread = api.find_all_with_http_info(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :param int view_id: (required) - :return: ViewDto + :return: list[ViewBriefDto] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'view_id'] # noqa: E501 + all_params = ['id', 'database_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -523,22 +529,18 @@ class ViewEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_all1" % key + " to method find_all" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `find_all1`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `find_all`") # noqa: E501 # verify the required parameter 'database_id' is set if ('database_id' not in params or params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `find_all1`") # noqa: E501 - # verify the required parameter 'view_id' is set - if ('view_id' not in params or - params['view_id'] is None): - raise ValueError("Missing the required parameter `view_id` when calling `find_all1`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `find_all`") # noqa: E501 collection_formats = {} @@ -547,8 +549,6 @@ class ViewEndpointApi(object): path_params['id'] = params['id'] # noqa: E501 if 'database_id' in params: path_params['databaseId'] = params['database_id'] # noqa: E501 - if 'view_id' in params: - path_params['viewId'] = params['view_id'] # noqa: E501 query_params = [] @@ -566,14 +566,14 @@ class ViewEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/view/{viewId}', 'GET', + '/api/container/{id}/database/{databaseId}/view', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ViewDto', # noqa: E501 + response_type='list[ViewBriefDto]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/swagger/api/api_query/models/__init__.py b/swagger/api/api_query/models/__init__.py index 407817fca59c5394cbbda685de5b6772fc3fa14d..b385894b0e16f6d9320b6726295fe83069401660 100644 --- a/swagger/api/api_query/models/__init__.py +++ b/swagger/api/api_query/models/__init__.py @@ -17,6 +17,7 @@ from __future__ import absolute_import from api_query.models.api_error_dto import ApiErrorDto from api_query.models.container_dto import ContainerDto from api_query.models.creator_dto import CreatorDto +from api_query.models.database_access_dto import DatabaseAccessDto from api_query.models.database_dto import DatabaseDto from api_query.models.execute_statement_dto import ExecuteStatementDto from api_query.models.granted_authority_dto import GrantedAuthorityDto diff --git a/swagger/api/api_query/models/container_dto.py b/swagger/api/api_query/models/container_dto.py index 2869b35048a30bc5d5a0afe173526c738885301e..5266d7fbceea825b1d265ed8bc7086be74fdf20f 100644 --- a/swagger/api/api_query/models/container_dto.py +++ b/swagger/api/api_query/models/container_dto.py @@ -32,7 +32,7 @@ class ContainerDto(object): 'hash': 'str', 'name': 'str', 'state': 'str', - 'databases': 'list[DatabaseDto]', + 'database': 'DatabaseDto', 'image': 'ImageBriefDto', 'port': 'int', 'created': 'datetime', @@ -45,7 +45,7 @@ class ContainerDto(object): 'hash': 'hash', 'name': 'name', 'state': 'state', - 'databases': 'databases', + 'database': 'database', 'image': 'image', 'port': 'port', 'created': 'created', @@ -53,13 +53,13 @@ class ContainerDto(object): 'ip_address': 'ip_address' } - def __init__(self, id=None, hash=None, name=None, state=None, databases=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + def __init__(self, id=None, hash=None, name=None, state=None, database=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 """ContainerDto - a model defined in Swagger""" # noqa: E501 self._id = None self._hash = None self._name = None self._state = None - self._databases = None + self._database = None self._image = None self._port = None self._created = None @@ -71,8 +71,8 @@ class ContainerDto(object): self.name = name if state is not None: self.state = state - if databases is not None: - self.databases = databases + if database is not None: + self.database = database if image is not None: self.image = image if port is not None: @@ -179,25 +179,25 @@ class ContainerDto(object): self._state = state @property - def databases(self): - """Gets the databases of this ContainerDto. # noqa: E501 + def database(self): + """Gets the database of this ContainerDto. # noqa: E501 - :return: The databases of this ContainerDto. # noqa: E501 - :rtype: list[DatabaseDto] + :return: The database of this ContainerDto. # noqa: E501 + :rtype: DatabaseDto """ - return self._databases + return self._database - @databases.setter - def databases(self, databases): - """Sets the databases of this ContainerDto. + @database.setter + def database(self, database): + """Sets the database of this ContainerDto. - :param databases: The databases of this ContainerDto. # noqa: E501 - :type: list[DatabaseDto] + :param database: The database of this ContainerDto. # noqa: E501 + :type: DatabaseDto """ - self._databases = databases + self._database = database @property def image(self): diff --git a/swagger/api/api_query/models/creator_dto.py b/swagger/api/api_query/models/creator_dto.py index 073b1f7d018ba23f8545ff95a700a9c7fcdb8d31..5ec83deba71b1c759d1d70a60b0cb8b9765c75d4 100644 --- a/swagger/api/api_query/models/creator_dto.py +++ b/swagger/api/api_query/models/creator_dto.py @@ -29,7 +29,8 @@ class CreatorDto(object): """ swagger_types = { 'id': 'int', - 'name': 'str', + 'firstname': 'str', + 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', 'created': 'datetime', @@ -38,29 +39,33 @@ class CreatorDto(object): attribute_map = { 'id': 'id', - 'name': 'name', + 'firstname': 'firstname', + 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', 'created': 'created', - 'last_modified': 'last_modified' + 'last_modified': 'lastModified' } - def __init__(self, id=None, name=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, firstname=None, lastname=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 """CreatorDto - a model defined in Swagger""" # noqa: E501 self._id = None - self._name = None + self._firstname = None + self._lastname = None self._affiliation = None self._orcid = None self._created = None self._last_modified = None self.discriminator = None self.id = id - self.name = name + self.firstname = firstname + self.lastname = lastname if affiliation is not None: self.affiliation = affiliation if orcid is not None: self.orcid = orcid - self.created = created + if created is not None: + self.created = created if last_modified is not None: self.last_modified = last_modified @@ -88,27 +93,50 @@ class CreatorDto(object): self._id = id @property - def name(self): - """Gets the name of this CreatorDto. # noqa: E501 + def firstname(self): + """Gets the firstname of this CreatorDto. # noqa: E501 - :return: The name of this CreatorDto. # noqa: E501 + :return: The firstname of this CreatorDto. # noqa: E501 :rtype: str """ - return self._name + return self._firstname - @name.setter - def name(self, name): - """Sets the name of this CreatorDto. + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorDto. - :param name: The name of this CreatorDto. # noqa: E501 + :param firstname: The firstname of this CreatorDto. # noqa: E501 :type: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 - self._name = name + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorDto. # noqa: E501 + + + :return: The lastname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorDto. + + + :param lastname: The lastname of this CreatorDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname @property def affiliation(self): @@ -170,8 +198,6 @@ class CreatorDto(object): :param created: The created of this CreatorDto. # noqa: E501 :type: datetime """ - if created is None: - raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 self._created = created diff --git a/swagger/api/api_query/models/database_access_dto.py b/swagger/api/api_query/models/database_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..d30225ed7889febd87073d4bfe2524d6aad83e60 --- /dev/null +++ b/swagger/api/api_query/models/database_access_dto.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Database Repository Query Service API + + Service that manages the queries # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user': 'UserDto', + 'type': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'user': 'user', + 'type': 'type', + 'created': 'created' + } + + def __init__(self, user=None, type=None, created=None): # noqa: E501 + """DatabaseAccessDto - a model defined in Swagger""" # noqa: E501 + self._user = None + self._type = None + self._created = None + self.discriminator = None + self.user = user + self.type = type + if created is not None: + self.created = created + + @property + def user(self): + """Gets the user of this DatabaseAccessDto. # noqa: E501 + + + :return: The user of this DatabaseAccessDto. # noqa: E501 + :rtype: UserDto + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this DatabaseAccessDto. + + + :param user: The user of this DatabaseAccessDto. # noqa: E501 + :type: UserDto + """ + if user is None: + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + @property + def type(self): + """Gets the type of this DatabaseAccessDto. # noqa: E501 + + + :return: The type of this DatabaseAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseAccessDto. + + + :param type: The type of this DatabaseAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def created(self): + """Gets the created of this DatabaseAccessDto. # noqa: E501 + + + :return: The created of this DatabaseAccessDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseAccessDto. + + + :param created: The created of this DatabaseAccessDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_query/models/database_dto.py b/swagger/api/api_query/models/database_dto.py index 4e9ae11005bb4192c9190e04e895e348618b8636..8cd6c077c0bdc6115c38b6f9bc76e95db635c03c 100644 --- a/swagger/api/api_query/models/database_dto.py +++ b/swagger/api/api_query/models/database_dto.py @@ -30,15 +30,15 @@ class DatabaseDto(object): swagger_types = { 'id': 'int', 'name': 'str', - 'exchange': 'str', 'creator': 'UserBriefDto', 'identifier': 'IdentifierDto', 'description': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', + 'accesses': 'list[DatabaseAccessDto]', 'created': 'datetime', - 'deleted': 'datetime', + 'exchange_name': 'str', 'internal_name': 'str', 'is_public': 'bool' } @@ -46,38 +46,37 @@ class DatabaseDto(object): attribute_map = { 'id': 'id', 'name': 'name', - 'exchange': 'exchange', 'creator': 'creator', 'identifier': 'identifier', 'description': 'description', 'tables': 'tables', 'image': 'image', 'container': 'container', + 'accesses': 'accesses', 'created': 'created', - 'deleted': 'deleted', + 'exchange_name': 'exchange_name', 'internal_name': 'internal_name', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, accesses=None, created=None, exchange_name=None, internal_name=None, is_public=None): # noqa: E501 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None - self._exchange = None self._creator = None self._identifier = None self._description = None self._tables = None self._image = None self._container = None + self._accesses = None self._created = None - self._deleted = None + self._exchange_name = None self._internal_name = None self._is_public = None self.discriminator = None self.id = id self.name = name - self.exchange = exchange self.creator = creator if identifier is not None: self.identifier = identifier @@ -89,10 +88,11 @@ class DatabaseDto(object): self.image = image if container is not None: self.container = container + if accesses is not None: + self.accesses = accesses if created is not None: self.created = created - if deleted is not None: - self.deleted = deleted + self.exchange_name = exchange_name self.internal_name = internal_name if is_public is not None: self.is_public = is_public @@ -143,29 +143,6 @@ class DatabaseDto(object): self._name = name - @property - def exchange(self): - """Gets the exchange of this DatabaseDto. # noqa: E501 - - - :return: The exchange of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._exchange - - @exchange.setter - def exchange(self, exchange): - """Sets the exchange of this DatabaseDto. - - - :param exchange: The exchange of this DatabaseDto. # noqa: E501 - :type: str - """ - if exchange is None: - raise ValueError("Invalid value for `exchange`, must not be `None`") # noqa: E501 - - self._exchange = exchange - @property def creator(self): """Gets the creator of this DatabaseDto. # noqa: E501 @@ -294,6 +271,27 @@ class DatabaseDto(object): self._container = container + @property + def accesses(self): + """Gets the accesses of this DatabaseDto. # noqa: E501 + + + :return: The accesses of this DatabaseDto. # noqa: E501 + :rtype: list[DatabaseAccessDto] + """ + return self._accesses + + @accesses.setter + def accesses(self, accesses): + """Sets the accesses of this DatabaseDto. + + + :param accesses: The accesses of this DatabaseDto. # noqa: E501 + :type: list[DatabaseAccessDto] + """ + + self._accesses = accesses + @property def created(self): """Gets the created of this DatabaseDto. # noqa: E501 @@ -316,25 +314,27 @@ class DatabaseDto(object): self._created = created @property - def deleted(self): - """Gets the deleted of this DatabaseDto. # noqa: E501 + def exchange_name(self): + """Gets the exchange_name of this DatabaseDto. # noqa: E501 - :return: The deleted of this DatabaseDto. # noqa: E501 - :rtype: datetime + :return: The exchange_name of this DatabaseDto. # noqa: E501 + :rtype: str """ - return self._deleted + return self._exchange_name - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this DatabaseDto. + @exchange_name.setter + def exchange_name(self, exchange_name): + """Sets the exchange_name of this DatabaseDto. - :param deleted: The deleted of this DatabaseDto. # noqa: E501 - :type: datetime + :param exchange_name: The exchange_name of this DatabaseDto. # noqa: E501 + :type: str """ + if exchange_name is None: + raise ValueError("Invalid value for `exchange_name`, must not be `None`") # noqa: E501 - self._deleted = deleted + self._exchange_name = exchange_name @property def internal_name(self): diff --git a/swagger/api/api_query/models/identifier_dto.py b/swagger/api/api_query/models/identifier_dto.py index f1707672a1149db49681cbeceee1f45621cc0eaa..ca6494e2c1edb83e0a1137c5781c7e943b81c78d 100644 --- a/swagger/api/api_query/models/identifier_dto.py +++ b/swagger/api/api_query/models/identifier_dto.py @@ -37,7 +37,6 @@ class IdentifierDto(object): 'visibility': 'str', 'doi': 'str', 'publisher': 'str', - 'creator': 'UserDto', 'language': 'str', 'license': 'LicenseDto', 'creators': 'list[CreatorDto]', @@ -66,7 +65,6 @@ class IdentifierDto(object): 'visibility': 'visibility', 'doi': 'doi', 'publisher': 'publisher', - 'creator': 'creator', 'language': 'language', 'license': 'license', 'creators': 'creators', @@ -85,7 +83,7 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._type = None @@ -96,7 +94,6 @@ class IdentifierDto(object): self._visibility = None self._doi = None self._publisher = None - self._creator = None self._language = None self._license = None self._creators = None @@ -127,7 +124,6 @@ class IdentifierDto(object): self.doi = doi if publisher is not None: self.publisher = publisher - self.creator = creator if language is not None: self.language = language if license is not None: @@ -364,29 +360,6 @@ class IdentifierDto(object): self._publisher = publisher - @property - def creator(self): - """Gets the creator of this IdentifierDto. # noqa: E501 - - - :return: The creator of this IdentifierDto. # noqa: E501 - :rtype: UserDto - """ - return self._creator - - @creator.setter - def creator(self, creator): - """Sets the creator of this IdentifierDto. - - - :param creator: The creator of this IdentifierDto. # noqa: E501 - :type: UserDto - """ - if creator is None: - raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 - - self._creator = creator - @property def language(self): """Gets the language of this IdentifierDto. # noqa: E501 diff --git a/swagger/api/api_query/models/related_identifier_dto.py b/swagger/api/api_query/models/related_identifier_dto.py index 56722e2955a6884ceaac750b31bf246d87a0a5da..8edb6b15028d93f293bff08129203a5deac336ca 100644 --- a/swagger/api/api_query/models/related_identifier_dto.py +++ b/swagger/api/api_query/models/related_identifier_dto.py @@ -33,7 +33,6 @@ class RelatedIdentifierDto(object): 'type': 'str', 'relation': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'last_modified': 'datetime' } @@ -43,18 +42,16 @@ class RelatedIdentifierDto(object): 'type': 'type', 'relation': 'relation', 'created': 'created', - 'deleted': 'deleted', 'last_modified': 'last_modified' } - def __init__(self, id=None, value=None, type=None, relation=None, created=None, deleted=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None): # noqa: E501 """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None self._value = None self._type = None self._relation = None self._created = None - self._deleted = None self._last_modified = None self.discriminator = None self.id = id @@ -64,8 +61,6 @@ class RelatedIdentifierDto(object): if relation is not None: self.relation = relation self.created = created - if deleted is not None: - self.deleted = deleted if last_modified is not None: self.last_modified = last_modified @@ -192,27 +187,6 @@ class RelatedIdentifierDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this RelatedIdentifierDto. # noqa: E501 - - - :return: The deleted of this RelatedIdentifierDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this RelatedIdentifierDto. - - - :param deleted: The deleted of this RelatedIdentifierDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def last_modified(self): """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 diff --git a/swagger/api/api_query/models/table_brief_dto.py b/swagger/api/api_query/models/table_brief_dto.py index 3d373bbe508fcce09b5401b4654c36b34930c39f..61abfa7ecb9c9d9c6e0a4f2fb7b9f25146deff85 100644 --- a/swagger/api/api_query/models/table_brief_dto.py +++ b/swagger/api/api_query/models/table_brief_dto.py @@ -30,6 +30,7 @@ class TableBriefDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'description': 'str', 'creator': 'UserBriefDto', 'internal_name': 'str' } @@ -37,19 +38,22 @@ class TableBriefDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'description': 'description', 'creator': 'creator', 'internal_name': 'internal_name' } - def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, description=None, creator=None, internal_name=None): # noqa: E501 """TableBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._description = None self._creator = None self._internal_name = None self.discriminator = None self.id = id self.name = name + self.description = description self.creator = creator self.internal_name = internal_name @@ -99,6 +103,29 @@ class TableBriefDto(object): self._name = name + @property + def description(self): + """Gets the description of this TableBriefDto. # noqa: E501 + + + :return: The description of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableBriefDto. + + + :param description: The description of this TableBriefDto. # noqa: E501 + :type: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + @property def creator(self): """Gets the creator of this TableBriefDto. # noqa: E501 diff --git a/swagger/api/api_query/models/user_brief_dto.py b/swagger/api/api_query/models/user_brief_dto.py index c29510792162b1cdc193a1068c52cbdd470949dc..d6e632bda6da835304fa46ec3d4a22b2a9315572 100644 --- a/swagger/api/api_query/models/user_brief_dto.py +++ b/swagger/api/api_query/models/user_brief_dto.py @@ -30,12 +30,13 @@ class UserBriefDto(object): swagger_types = { 'id': 'int', 'username': 'str', + 'titles_before': 'str', + 'titles_after': 'str', 'firstname': 'str', 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', - 'titles_before': 'str', - 'titles_after': 'str', + 'roles': 'list[str]', 'theme_dark': 'bool', 'email_verified': 'bool' } @@ -43,31 +44,37 @@ class UserBriefDto(object): attribute_map = { 'id': 'id', 'username': 'username', + 'titles_before': 'titlesBefore', + 'titles_after': 'titlesAfter', 'firstname': 'firstname', 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', - 'titles_before': 'titles_before', - 'titles_after': 'titles_after', - 'theme_dark': 'theme_dark', - 'email_verified': 'email_verified' + 'roles': 'roles', + 'theme_dark': 'themeDark', + 'email_verified': 'emailVerified' } - def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, username=None, titles_before=None, titles_after=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, theme_dark=None, email_verified=None): # noqa: E501 """UserBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._username = None + self._titles_before = None + self._titles_after = None self._firstname = None self._lastname = None self._affiliation = None self._orcid = None - self._titles_before = None - self._titles_after = None + self._roles = None self._theme_dark = None self._email_verified = None self.discriminator = None self.id = id self.username = username + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after if firstname is not None: self.firstname = firstname if lastname is not None: @@ -76,12 +83,11 @@ class UserBriefDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid - if titles_before is not None: - self.titles_before = titles_before - if titles_after is not None: - self.titles_after = titles_after - self.theme_dark = theme_dark - self.email_verified = email_verified + self.roles = roles + if theme_dark is not None: + self.theme_dark = theme_dark + if email_verified is not None: + self.email_verified = email_verified @property def id(self): @@ -131,6 +137,48 @@ class UserBriefDto(object): self._username = username + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + @property def firstname(self): """Gets the firstname of this UserBriefDto. # noqa: E501 @@ -216,46 +264,29 @@ class UserBriefDto(object): self._orcid = orcid @property - def titles_before(self): - """Gets the titles_before of this UserBriefDto. # noqa: E501 + def roles(self): + """Gets the roles of this UserBriefDto. # noqa: E501 + Roles of the user # noqa: E501 - :return: The titles_before of this UserBriefDto. # noqa: E501 - :rtype: str + :return: The roles of this UserBriefDto. # noqa: E501 + :rtype: list[str] """ - return self._titles_before + return self._roles - @titles_before.setter - def titles_before(self, titles_before): - """Sets the titles_before of this UserBriefDto. + @roles.setter + def roles(self, roles): + """Sets the roles of this UserBriefDto. + Roles of the user # noqa: E501 - :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 - :type: str + :param roles: The roles of this UserBriefDto. # noqa: E501 + :type: list[str] """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 - self._titles_before = titles_before - - @property - def titles_after(self): - """Gets the titles_after of this UserBriefDto. # noqa: E501 - - - :return: The titles_after of this UserBriefDto. # noqa: E501 - :rtype: str - """ - return self._titles_after - - @titles_after.setter - def titles_after(self, titles_after): - """Sets the titles_after of this UserBriefDto. - - - :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 - :type: str - """ - - self._titles_after = titles_after + self._roles = roles @property def theme_dark(self): @@ -275,8 +306,6 @@ class UserBriefDto(object): :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 :type: bool """ - if theme_dark is None: - raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 self._theme_dark = theme_dark @@ -298,8 +327,6 @@ class UserBriefDto(object): :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 :type: bool """ - if email_verified is None: - raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 self._email_verified = email_verified diff --git a/swagger/api/api_query/models/user_dto.py b/swagger/api/api_query/models/user_dto.py index 6c3503411c21a5595d2818e6a107656da6b9e2ce..4caa3496ae68ac2a46c0b1c61db7eba9f705f18d 100644 --- a/swagger/api/api_query/models/user_dto.py +++ b/swagger/api/api_query/models/user_dto.py @@ -35,6 +35,7 @@ class UserDto(object): 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', + 'roles': 'list[str]', 'containers': 'list[ContainerDto]', 'databases': 'list[ContainerDto]', 'identifiers': 'list[ContainerDto]', @@ -53,6 +54,7 @@ class UserDto(object): 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', + 'roles': 'roles', 'containers': 'containers', 'databases': 'databases', 'identifiers': 'identifiers', @@ -63,7 +65,7 @@ class UserDto(object): 'email_verified': 'email_verified' } - def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 """UserDto - a model defined in Swagger""" # noqa: E501 self._id = None self._authorities = None @@ -72,6 +74,7 @@ class UserDto(object): self._lastname = None self._affiliation = None self._orcid = None + self._roles = None self._containers = None self._databases = None self._identifiers = None @@ -93,6 +96,7 @@ class UserDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid + self.roles = roles if containers is not None: self.containers = containers if databases is not None: @@ -260,6 +264,31 @@ class UserDto(object): self._orcid = orcid + @property + def roles(self): + """Gets the roles of this UserDto. # noqa: E501 + + Roles of the user # noqa: E501 + + :return: The roles of this UserDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UserDto. + + Roles of the user # noqa: E501 + + :param roles: The roles of this UserDto. # noqa: E501 + :type: list[str] + """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + + self._roles = roles + @property def containers(self): """Gets the containers of this UserDto. # noqa: E501 diff --git a/swagger/api/api_query/models/view_brief_dto.py b/swagger/api/api_query/models/view_brief_dto.py index 14f4995bd980bba85398086c99d147b0e6736f76..d2bb77d6ea0c92ca980994dd2aa8d4f19a13440e 100644 --- a/swagger/api/api_query/models/view_brief_dto.py +++ b/swagger/api/api_query/models/view_brief_dto.py @@ -31,9 +31,9 @@ class ViewBriefDto(object): 'id': 'int', 'vdbid': 'int', 'name': 'str', + 'internal_name': 'str', 'query': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'is_public': 'bool', 'initial_view': 'bool', 'created_by': 'int', @@ -44,23 +44,23 @@ class ViewBriefDto(object): 'id': 'id', 'vdbid': 'vdbid', 'name': 'name', + 'internal_name': 'internalName', 'query': 'query', 'created': 'created', - 'deleted': 'deleted', 'is_public': 'is_public', 'initial_view': 'initial_view', 'created_by': 'created_by', 'last_modified': 'last_modified' } - def __init__(self, id=None, vdbid=None, name=None, query=None, created=None, deleted=None, is_public=None, initial_view=None, created_by=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, vdbid=None, name=None, internal_name=None, query=None, created=None, is_public=None, initial_view=None, created_by=None, last_modified=None): # noqa: E501 """ViewBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._vdbid = None self._name = None + self._internal_name = None self._query = None self._created = None - self._deleted = None self._is_public = None self._initial_view = None self._created_by = None @@ -68,12 +68,10 @@ class ViewBriefDto(object): self.discriminator = None self.id = id self.vdbid = vdbid - if name is not None: - self.name = name + self.name = name + self.internal_name = internal_name self.query = query self.created = created - if deleted is not None: - self.deleted = deleted if is_public is not None: self.is_public = is_public if initial_view is not None: @@ -146,9 +144,34 @@ class ViewBriefDto(object): :param name: The name of this ViewBriefDto. # noqa: E501 :type: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name + @property + def internal_name(self): + """Gets the internal_name of this ViewBriefDto. # noqa: E501 + + + :return: The internal_name of this ViewBriefDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ViewBriefDto. + + + :param internal_name: The internal_name of this ViewBriefDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + @property def query(self): """Gets the query of this ViewBriefDto. # noqa: E501 @@ -195,27 +218,6 @@ class ViewBriefDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this ViewBriefDto. # noqa: E501 - - - :return: The deleted of this ViewBriefDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this ViewBriefDto. - - - :param deleted: The deleted of this ViewBriefDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def is_public(self): """Gets the is_public of this ViewBriefDto. # noqa: E501 diff --git a/swagger/api/api_query/models/view_dto.py b/swagger/api/api_query/models/view_dto.py index 4b79b5c60a7e090eb3aad23583aa75d314cbf861..9510cd44e8d21313ee71fa8fbef063a444bb2ce8 100644 --- a/swagger/api/api_query/models/view_dto.py +++ b/swagger/api/api_query/models/view_dto.py @@ -33,9 +33,9 @@ class ViewDto(object): 'creator': 'UserDto', 'database': 'DatabaseDto', 'name': 'str', + 'internal_name': 'str', 'query': 'str', 'created': 'datetime', - 'deleted': 'datetime', 'is_public': 'bool', 'initial_view': 'bool', 'last_modified': 'datetime' @@ -47,24 +47,24 @@ class ViewDto(object): 'creator': 'creator', 'database': 'database', 'name': 'name', + 'internal_name': 'internalName', 'query': 'query', 'created': 'created', - 'deleted': 'deleted', 'is_public': 'is_public', 'initial_view': 'initial_view', 'last_modified': 'last_modified' } - def __init__(self, id=None, vdbid=None, creator=None, database=None, name=None, query=None, created=None, deleted=None, is_public=None, initial_view=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, vdbid=None, creator=None, database=None, name=None, internal_name=None, query=None, created=None, is_public=None, initial_view=None, last_modified=None): # noqa: E501 """ViewDto - a model defined in Swagger""" # noqa: E501 self._id = None self._vdbid = None self._creator = None self._database = None self._name = None + self._internal_name = None self._query = None self._created = None - self._deleted = None self._is_public = None self._initial_view = None self._last_modified = None @@ -74,10 +74,9 @@ class ViewDto(object): self.creator = creator self.database = database self.name = name + self.internal_name = internal_name self.query = query self.created = created - if deleted is not None: - self.deleted = deleted if is_public is not None: self.is_public = is_public if initial_view is not None: @@ -200,6 +199,29 @@ class ViewDto(object): self._name = name + @property + def internal_name(self): + """Gets the internal_name of this ViewDto. # noqa: E501 + + + :return: The internal_name of this ViewDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ViewDto. + + + :param internal_name: The internal_name of this ViewDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + @property def query(self): """Gets the query of this ViewDto. # noqa: E501 @@ -246,27 +268,6 @@ class ViewDto(object): self._created = created - @property - def deleted(self): - """Gets the deleted of this ViewDto. # noqa: E501 - - - :return: The deleted of this ViewDto. # noqa: E501 - :rtype: datetime - """ - return self._deleted - - @deleted.setter - def deleted(self, deleted): - """Sets the deleted of this ViewDto. - - - :param deleted: The deleted of this ViewDto. # noqa: E501 - :type: datetime - """ - - self._deleted = deleted - @property def is_public(self): """Gets the is_public of this ViewDto. # noqa: E501 diff --git a/swagger/api/api_semantics/__init__.py b/swagger/api/api_semantics/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2fd0d7f36342ec06b06ee087aca0e94801ca64a5 --- /dev/null +++ b/swagger/api/api_semantics/__init__.py @@ -0,0 +1,26 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from api_semantics.api.concepts_endpoint_api import ConceptsEndpointApi +from api_semantics.api.ontologies_endpoint_api import OntologiesEndpointApi +from api_semantics.api.units_endpoint_api import UnitsEndpointApi +# import ApiClient +from api_semantics.api_client import ApiClient +from api_semantics.configuration import Configuration +# import models into sdk package +from api_semantics.models.semantics_concept_body import SemanticsConceptBody +from api_semantics.models.semantics_unit_body import SemanticsUnitBody diff --git a/swagger/api/api_semantics/api/__init__.py b/swagger/api/api_semantics/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ac02c2709eec9d1c38feb888c0bb3ef2d8af7e3d --- /dev/null +++ b/swagger/api/api_semantics/api/__init__.py @@ -0,0 +1,8 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_semantics.api.concepts_endpoint_api import ConceptsEndpointApi +from api_semantics.api.ontologies_endpoint_api import OntologiesEndpointApi +from api_semantics.api.units_endpoint_api import UnitsEndpointApi diff --git a/swagger/api/api_semantics/api/concepts_endpoint_api.py b/swagger/api/api_semantics/api/concepts_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..bcd90eecfb3d9b83a18e292b3d482c79f6cc9beb --- /dev/null +++ b/swagger/api/api_semantics/api/concepts_endpoint_api.py @@ -0,0 +1,302 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_semantics.api_client import ApiClient + + +class ConceptsEndpointApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def api_semantics_concept_concept_validate_get(self, unit, **kwargs): # noqa: E501 + """Validate concepts # noqa: E501 + + This is a simple API for validating concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_concept_concept_validate_get(unit, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str unit: Validates concepts against om-2. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_concept_concept_validate_get_with_http_info(unit, **kwargs) # noqa: E501 + else: + (data) = self.api_semantics_concept_concept_validate_get_with_http_info(unit, **kwargs) # noqa: E501 + return data + + def api_semantics_concept_concept_validate_get_with_http_info(self, unit, **kwargs): # noqa: E501 + """Validate concepts # noqa: E501 + + This is a simple API for validating concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_concept_concept_validate_get_with_http_info(unit, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str unit: Validates concepts against om-2. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['unit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_concept_concept_validate_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'unit' is set + if ('unit' not in params or + params['unit'] is None): + raise ValueError("Missing the required parameter `unit` when calling `api_semantics_concept_concept_validate_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'unit' in params: + path_params['unit'] = params['unit'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/concept/{concept}/validate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def api_semantics_concept_get(self, **kwargs): # noqa: E501 + """Suggest a concept # noqa: E501 + + This is a simple API which returns a list of suggested concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_concept_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str q: The query to retrieve a fitting concept + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_concept_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_semantics_concept_get_with_http_info(**kwargs) # noqa: E501 + return data + + def api_semantics_concept_get_with_http_info(self, **kwargs): # noqa: E501 + """Suggest a concept # noqa: E501 + + This is a simple API which returns a list of suggested concepts. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_concept_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str q: The query to retrieve a fitting concept + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['q'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_concept_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'q' in params: + query_params.append(('q', params['q'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/concept', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def api_semantics_concept_post(self, **kwargs): # noqa: E501 + """Save concept to MDB # noqa: E501 + + This is a simple API for saving concept # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_concept_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SemanticsConceptBody body: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_concept_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_semantics_concept_post_with_http_info(**kwargs) # noqa: E501 + return data + + def api_semantics_concept_post_with_http_info(self, **kwargs): # noqa: E501 + """Save concept to MDB # noqa: E501 + + This is a simple API for saving concept # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_concept_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SemanticsConceptBody body: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_concept_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/concept', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/swagger/api/api_semantics/api/ontologies_endpoint_api.py b/swagger/api/api_semantics/api/ontologies_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..733081dc3380bfe596095687319b9bcc3215935a --- /dev/null +++ b/swagger/api/api_semantics/api/ontologies_endpoint_api.py @@ -0,0 +1,207 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_semantics.api_client import ApiClient + + +class OntologiesEndpointApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def api_semantics_ontology_get(self, **kwargs): # noqa: E501 + """List ontologies # noqa: E501 + + This is a simple API for listing all ontologies (.nt, .ttl files) used in DB-Repo. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_ontology_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_ontology_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_semantics_ontology_get_with_http_info(**kwargs) # noqa: E501 + return data + + def api_semantics_ontology_get_with_http_info(self, **kwargs): # noqa: E501 + """List ontologies # noqa: E501 + + This is a simple API for listing all ontologies (.nt, .ttl files) used in DB-Repo. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_ontology_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_ontology_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/ontology', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def api_semantics_ontology_name_get(self, o_name, **kwargs): # noqa: E501 + """Get ontology # noqa: E501 + + This is a simple API for getting a certain ontologies (.nt, .ttl files) stored in DB-Repo. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_ontology_name_get(o_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str o_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_ontology_name_get_with_http_info(o_name, **kwargs) # noqa: E501 + else: + (data) = self.api_semantics_ontology_name_get_with_http_info(o_name, **kwargs) # noqa: E501 + return data + + def api_semantics_ontology_name_get_with_http_info(self, o_name, **kwargs): # noqa: E501 + """Get ontology # noqa: E501 + + This is a simple API for getting a certain ontologies (.nt, .ttl files) stored in DB-Repo. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_ontology_name_get_with_http_info(o_name, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str o_name: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['o_name'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_ontology_name_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'o_name' is set + if ('o_name' not in params or + params['o_name'] is None): + raise ValueError("Missing the required parameter `o_name` when calling `api_semantics_ontology_name_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'o_name' in params: + path_params['o_name'] = params['o_name'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/ontology/{name}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/swagger/api/api_semantics/api/units_endpoint_api.py b/swagger/api/api_semantics/api/units_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..6a4ad395f92e75887f1c194bf4d0fd114110b428 --- /dev/null +++ b/swagger/api/api_semantics/api/units_endpoint_api.py @@ -0,0 +1,302 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_semantics.api_client import ApiClient + + +class UnitsEndpointApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def api_semantics_unit_get(self, **kwargs): # noqa: E501 + """Suggest a unit # noqa: E501 + + This is a simple API which returns a list of suggested units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_unit_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str q: The query to retrieve a fitting unit + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_unit_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_semantics_unit_get_with_http_info(**kwargs) # noqa: E501 + return data + + def api_semantics_unit_get_with_http_info(self, **kwargs): # noqa: E501 + """Suggest a unit # noqa: E501 + + This is a simple API which returns a list of suggested units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_unit_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str q: The query to retrieve a fitting unit + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['q'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_unit_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'q' in params: + query_params.append(('q', params['q'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/unit', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def api_semantics_unit_post(self, **kwargs): # noqa: E501 + """Save unit to MDB # noqa: E501 + + This is a simple API for saving units # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_unit_post(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SemanticsUnitBody body: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_unit_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_semantics_unit_post_with_http_info(**kwargs) # noqa: E501 + return data + + def api_semantics_unit_post_with_http_info(self, **kwargs): # noqa: E501 + """Save unit to MDB # noqa: E501 + + This is a simple API for saving units # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_unit_post_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param SemanticsUnitBody body: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_unit_post" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/unit', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def api_semantics_unit_unit_validate_get(self, unit, **kwargs): # noqa: E501 + """Validate units # noqa: E501 + + This is a simple API for validating units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_unit_unit_validate_get(unit, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str unit: Validates unit against om-2. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.api_semantics_unit_unit_validate_get_with_http_info(unit, **kwargs) # noqa: E501 + else: + (data) = self.api_semantics_unit_unit_validate_get_with_http_info(unit, **kwargs) # noqa: E501 + return data + + def api_semantics_unit_unit_validate_get_with_http_info(self, unit, **kwargs): # noqa: E501 + """Validate units # noqa: E501 + + This is a simple API for validating units. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.api_semantics_unit_unit_validate_get_with_http_info(unit, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str unit: Validates unit against om-2. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['unit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method api_semantics_unit_unit_validate_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'unit' is set + if ('unit' not in params or + params['unit'] is None): + raise ValueError("Missing the required parameter `unit` when calling `api_semantics_unit_unit_validate_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'unit' in params: + path_params['unit'] = params['unit'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/semantics/unit/{unit}/validate', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/swagger/api/api_semantics/api_client.py b/swagger/api/api_semantics/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..c0954e8474c8ce786804a9d8c610a34e2ecf672b --- /dev/null +++ b/swagger/api/api_semantics/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from api_semantics.configuration import Configuration +import api_semantics.models +from api_semantics import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(api_semantics.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/swagger/api/api_semantics/configuration.py b/swagger/api/api_semantics/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..da8ea3f7bba864df282a5d32fcd0ef626fdbd25e --- /dev/null +++ b/swagger/api/api_semantics/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """Constructor""" + # Default Base url + self.host = "http://localhost:9095" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("api_semantics") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.1.0-alpha\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/swagger/api/api_semantics/models/__init__.py b/swagger/api/api_semantics/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..914eef95b9f257d82d8f5eb4b052e07116c16750 --- /dev/null +++ b/swagger/api/api_semantics/models/__init__.py @@ -0,0 +1,18 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from api_semantics.models.semantics_concept_body import SemanticsConceptBody +from api_semantics.models.semantics_unit_body import SemanticsUnitBody diff --git a/swagger/api/api_semantics/models/semantics_concept_body.py b/swagger/api/api_semantics/models/semantics_concept_body.py new file mode 100644 index 0000000000000000000000000000000000000000..8aa8897cdbb75671d2a300ddcf0475fa7bbe57c0 --- /dev/null +++ b/swagger/api/api_semantics/models/semantics_concept_body.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SemanticsConceptBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'uri': 'str' + } + + attribute_map = { + 'name': 'name', + 'uri': 'uri' + } + + def __init__(self, name=None, uri=None): # noqa: E501 + """SemanticsConceptBody - a model defined in Swagger""" # noqa: E501 + self._name = None + self._uri = None + self.discriminator = None + self.name = name + self.uri = uri + + @property + def name(self): + """Gets the name of this SemanticsConceptBody. # noqa: E501 + + + :return: The name of this SemanticsConceptBody. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SemanticsConceptBody. + + + :param name: The name of this SemanticsConceptBody. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def uri(self): + """Gets the uri of this SemanticsConceptBody. # noqa: E501 + + + :return: The uri of this SemanticsConceptBody. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this SemanticsConceptBody. + + + :param uri: The uri of this SemanticsConceptBody. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SemanticsConceptBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SemanticsConceptBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_semantics/models/semantics_unit_body.py b/swagger/api/api_semantics/models/semantics_unit_body.py new file mode 100644 index 0000000000000000000000000000000000000000..2a0352de91e79a296439b1347c0296f41e72925a --- /dev/null +++ b/swagger/api/api_semantics/models/semantics_unit_body.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SemanticsUnitBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'name': 'str', + 'uri': 'str' + } + + attribute_map = { + 'name': 'name', + 'uri': 'uri' + } + + def __init__(self, name=None, uri=None): # noqa: E501 + """SemanticsUnitBody - a model defined in Swagger""" # noqa: E501 + self._name = None + self._uri = None + self.discriminator = None + self.name = name + self.uri = uri + + @property + def name(self): + """Gets the name of this SemanticsUnitBody. # noqa: E501 + + + :return: The name of this SemanticsUnitBody. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this SemanticsUnitBody. + + + :param name: The name of this SemanticsUnitBody. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def uri(self): + """Gets the uri of this SemanticsUnitBody. # noqa: E501 + + + :return: The uri of this SemanticsUnitBody. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this SemanticsUnitBody. + + + :param uri: The uri of this SemanticsUnitBody. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(SemanticsUnitBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SemanticsUnitBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_semantics/rest.py b/swagger/api/api_semantics/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..efb6c10cefe1553b4c71f91eff7705515f1adedc --- /dev/null +++ b/swagger/api/api_semantics/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Unit / Ontology Service API + + Service for assigning concepts to database tables and columns. # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/swagger/api/api_table/__init__.py b/swagger/api/api_table/__init__.py index 37441edea5b7655b2a5337e45897d5860cd36e48..de199b56804f1fd61893258137a4ead0b36d59c4 100644 --- a/swagger/api/api_table/__init__.py +++ b/swagger/api/api_table/__init__.py @@ -15,6 +15,8 @@ from __future__ import absolute_import # import apis into sdk package +from api_table.api.access_endpoint_api import AccessEndpointApi +from api_table.api.table_column_endpoint_api import TableColumnEndpointApi from api_table.api.table_endpoint_api import TableEndpointApi # import ApiClient from api_table.api_client import ApiClient @@ -23,9 +25,23 @@ from api_table.configuration import Configuration from api_table.models.api_error_dto import ApiErrorDto from api_table.models.column_create_dto import ColumnCreateDto from api_table.models.column_dto import ColumnDto +from api_table.models.column_semantics_update_dto import ColumnSemanticsUpdateDto from api_table.models.concept_dto import ConceptDto +from api_table.models.container_dto import ContainerDto +from api_table.models.creator_dto import CreatorDto +from api_table.models.database_access_dto import DatabaseAccessDto +from api_table.models.database_dto import DatabaseDto +from api_table.models.granted_authority_dto import GrantedAuthorityDto +from api_table.models.identifier_dto import IdentifierDto +from api_table.models.image_brief_dto import ImageBriefDto from api_table.models.image_date_dto import ImageDateDto +from api_table.models.image_dto import ImageDto +from api_table.models.image_env_item_dto import ImageEnvItemDto +from api_table.models.license_dto import LicenseDto +from api_table.models.related_identifier_dto import RelatedIdentifierDto from api_table.models.table_brief_dto import TableBriefDto from api_table.models.table_create_dto import TableCreateDto from api_table.models.table_dto import TableDto +from api_table.models.unit_dto import UnitDto from api_table.models.user_brief_dto import UserBriefDto +from api_table.models.user_dto import UserDto diff --git a/swagger/api/api_table/api/__init__.py b/swagger/api/api_table/api/__init__.py index 7ac1b66c4f54b7eab1ebc4b1898d33e21f56cb61..6e8ca670559a25990e9ba53cc409c8de64bfddd1 100644 --- a/swagger/api/api_table/api/__init__.py +++ b/swagger/api/api_table/api/__init__.py @@ -3,4 +3,6 @@ from __future__ import absolute_import # flake8: noqa # import apis into api package +from api_table.api.access_endpoint_api import AccessEndpointApi +from api_table.api.table_column_endpoint_api import TableColumnEndpointApi from api_table.api.table_endpoint_api import TableEndpointApi diff --git a/swagger/api/api_table/api/access_endpoint_api.py b/swagger/api/api_table/api/access_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..d70b44db66ef235c9b4b366fd842a3afaff1e87e --- /dev/null +++ b/swagger/api/api_table/api/access_endpoint_api.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_table.api_client import ApiClient + + +class AccessEndpointApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def check_access(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Check access to some table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.check_access(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: DatabaseAccessDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.check_access_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + else: + (data) = self.check_access_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + return data + + def check_access_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Check access to some table # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.check_access_with_http_info(id, database_id, table_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :return: DatabaseAccessDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'table_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method check_access" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `check_access`") # noqa: E501 + # verify the required parameter 'database_id' is set + if ('database_id' not in params or + params['database_id'] is None): + raise ValueError("Missing the required parameter `database_id` when calling `check_access`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `check_access`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'database_id' in params: + path_params['databaseId'] = params['database_id'] # noqa: E501 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/access', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DatabaseAccessDto', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/swagger/api/api_table/api/table_column_endpoint_api.py b/swagger/api/api_table/api/table_column_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..153184e608ab5e787838383f3a1c79fdeddbb8d5 --- /dev/null +++ b/swagger/api/api_table/api/table_column_endpoint_api.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_table.api_client import ApiClient + + +class TableColumnEndpointApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def update(self, body, id, database_id, table_id, column_id, **kwargs): # noqa: E501 + """Update a table column semantic mapping # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update(body, id, database_id, table_id, column_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ColumnSemanticsUpdateDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param int column_id: (required) + :return: ColumnDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_with_http_info(body, id, database_id, table_id, column_id, **kwargs) # noqa: E501 + else: + (data) = self.update_with_http_info(body, id, database_id, table_id, column_id, **kwargs) # noqa: E501 + return data + + def update_with_http_info(self, body, id, database_id, table_id, column_id, **kwargs): # noqa: E501 + """Update a table column semantic mapping # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_with_http_info(body, id, database_id, table_id, column_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param ColumnSemanticsUpdateDto body: (required) + :param int id: (required) + :param int database_id: (required) + :param int table_id: (required) + :param int column_id: (required) + :return: ColumnDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body', 'id', 'database_id', 'table_id', 'column_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `update`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update`") # noqa: E501 + # verify the required parameter 'database_id' is set + if ('database_id' not in params or + params['database_id'] is None): + raise ValueError("Missing the required parameter `database_id` when calling `update`") # noqa: E501 + # verify the required parameter 'table_id' is set + if ('table_id' not in params or + params['table_id'] is None): + raise ValueError("Missing the required parameter `table_id` when calling `update`") # noqa: E501 + # verify the required parameter 'column_id' is set + if ('column_id' not in params or + params['column_id'] is None): + raise ValueError("Missing the required parameter `column_id` when calling `update`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'database_id' in params: + path_params['databaseId'] = params['database_id'] # noqa: E501 + if 'table_id' in params: + path_params['tableId'] = params['table_id'] # noqa: E501 + if 'column_id' in params: + path_params['columnId'] = params['column_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['bearerAuth'] # noqa: E501 + + return self.api_client.call_api( + '/api/container/{id}/database/{databaseId}/table/{tableId}/column/{columnId}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ColumnDto', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/swagger/api/api_table/api/table_endpoint_api.py b/swagger/api/api_table/api/table_endpoint_api.py index 03c13a37d72e0187e4a1994b400a5f45c34712b5..2af77e82d307c419a42e28147aaed751caab03a8 100644 --- a/swagger/api/api_table/api/table_endpoint_api.py +++ b/swagger/api/api_table/api/table_endpoint_api.py @@ -463,112 +463,3 @@ class TableEndpointApi(object): _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - - def update(self, id, database_id, table_id, **kwargs): # noqa: E501 - """Update a table # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update(id, database_id, table_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int id: (required) - :param int database_id: (required) - :param int table_id: (required) - :return: TableBriefDto - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 - else: - (data) = self.update_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 - return data - - def update_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 - """Update a table # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_with_http_info(id, database_id, table_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int id: (required) - :param int database_id: (required) - :param int table_id: (required) - :return: TableBriefDto - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['id', 'database_id', 'table_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `update`") # noqa: E501 - # verify the required parameter 'database_id' is set - if ('database_id' not in params or - params['database_id'] is None): - raise ValueError("Missing the required parameter `database_id` when calling `update`") # noqa: E501 - # verify the required parameter 'table_id' is set - if ('table_id' not in params or - params['table_id'] is None): - raise ValueError("Missing the required parameter `table_id` when calling `update`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 - if 'database_id' in params: - path_params['databaseId'] = params['database_id'] # noqa: E501 - if 'table_id' in params: - path_params['tableId'] = params['table_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['*/*']) # noqa: E501 - - # Authentication setting - auth_settings = ['bearerAuth'] # noqa: E501 - - return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='TableBriefDto', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/swagger/api/api_table/models/__init__.py b/swagger/api/api_table/models/__init__.py index 65818bef09589a604af11a71cac062d8ca9b09de..73aa50cf18424720854cb89815be50b848f9a96b 100644 --- a/swagger/api/api_table/models/__init__.py +++ b/swagger/api/api_table/models/__init__.py @@ -17,9 +17,23 @@ from __future__ import absolute_import from api_table.models.api_error_dto import ApiErrorDto from api_table.models.column_create_dto import ColumnCreateDto from api_table.models.column_dto import ColumnDto +from api_table.models.column_semantics_update_dto import ColumnSemanticsUpdateDto from api_table.models.concept_dto import ConceptDto +from api_table.models.container_dto import ContainerDto +from api_table.models.creator_dto import CreatorDto +from api_table.models.database_access_dto import DatabaseAccessDto +from api_table.models.database_dto import DatabaseDto +from api_table.models.granted_authority_dto import GrantedAuthorityDto +from api_table.models.identifier_dto import IdentifierDto +from api_table.models.image_brief_dto import ImageBriefDto from api_table.models.image_date_dto import ImageDateDto +from api_table.models.image_dto import ImageDto +from api_table.models.image_env_item_dto import ImageEnvItemDto +from api_table.models.license_dto import LicenseDto +from api_table.models.related_identifier_dto import RelatedIdentifierDto from api_table.models.table_brief_dto import TableBriefDto from api_table.models.table_create_dto import TableCreateDto from api_table.models.table_dto import TableDto +from api_table.models.unit_dto import UnitDto from api_table.models.user_brief_dto import UserBriefDto +from api_table.models.user_dto import UserDto diff --git a/swagger/api/api_table/models/column_create_dto.py b/swagger/api/api_table/models/column_create_dto.py index 5c14839dd9683c72ffe8de93612c9c5944a723e0..9c78cb1c5ca816b1f67968768fde109813a35d31 100644 --- a/swagger/api/api_table/models/column_create_dto.py +++ b/swagger/api/api_table/models/column_create_dto.py @@ -184,6 +184,7 @@ class ColumnCreateDto(object): def references(self): """Gets the references of this ColumnCreateDto. # noqa: E501 + foreign key reference, only considered when foreignKey != null # noqa: E501 :return: The references of this ColumnCreateDto. # noqa: E501 :rtype: str @@ -194,6 +195,7 @@ class ColumnCreateDto(object): def references(self, references): """Sets the references of this ColumnCreateDto. + foreign key reference, only considered when foreignKey != null # noqa: E501 :param references: The references of this ColumnCreateDto. # noqa: E501 :type: str @@ -251,6 +253,7 @@ class ColumnCreateDto(object): def check_expression(self): """Gets the check_expression of this ColumnCreateDto. # noqa: E501 + check constraint # noqa: E501 :return: The check_expression of this ColumnCreateDto. # noqa: E501 :rtype: str @@ -261,6 +264,7 @@ class ColumnCreateDto(object): def check_expression(self, check_expression): """Sets the check_expression of this ColumnCreateDto. + check constraint # noqa: E501 :param check_expression: The check_expression of this ColumnCreateDto. # noqa: E501 :type: str @@ -293,6 +297,7 @@ class ColumnCreateDto(object): def enum_values(self): """Gets the enum_values of this ColumnCreateDto. # noqa: E501 + enum values, only considered when type = ENUM # noqa: E501 :return: The enum_values of this ColumnCreateDto. # noqa: E501 :rtype: list[str] @@ -303,6 +308,7 @@ class ColumnCreateDto(object): def enum_values(self, enum_values): """Sets the enum_values of this ColumnCreateDto. + enum values, only considered when type = ENUM # noqa: E501 :param enum_values: The enum_values of this ColumnCreateDto. # noqa: E501 :type: list[str] diff --git a/swagger/api/api_table/models/column_dto.py b/swagger/api/api_table/models/column_dto.py index 08c3ab7a70536b6fec106d21b598225f2da9369e..588a3b0db58ed8441d020d6869154ce61792a436 100644 --- a/swagger/api/api_table/models/column_dto.py +++ b/swagger/api/api_table/models/column_dto.py @@ -30,6 +30,8 @@ class ColumnDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'concept': 'ConceptDto', + 'unit': 'UnitDto', 'unique': 'bool', 'references': 'str', 'internal_name': 'str', @@ -37,7 +39,6 @@ class ColumnDto(object): 'auto_generated': 'bool', 'is_primary_key': 'bool', 'column_type': 'str', - 'column_concept': 'ConceptDto', 'is_null_allowed': 'bool', 'check_expression': 'str', 'foreign_key': 'str', @@ -47,6 +48,8 @@ class ColumnDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'concept': 'concept', + 'unit': 'unit', 'unique': 'unique', 'references': 'references', 'internal_name': 'internal_name', @@ -54,17 +57,18 @@ class ColumnDto(object): 'auto_generated': 'auto_generated', 'is_primary_key': 'is_primary_key', 'column_type': 'column_type', - 'column_concept': 'column_concept', 'is_null_allowed': 'is_null_allowed', 'check_expression': 'check_expression', 'foreign_key': 'foreign_key', 'enum_values': 'enum_values' } - def __init__(self, id=None, name=None, unique=None, references=None, internal_name=None, date_format=None, auto_generated=None, is_primary_key=None, column_type=None, column_concept=None, is_null_allowed=None, check_expression=None, foreign_key=None, enum_values=None): # noqa: E501 + def __init__(self, id=None, name=None, concept=None, unit=None, unique=None, references=None, internal_name=None, date_format=None, auto_generated=None, is_primary_key=None, column_type=None, is_null_allowed=None, check_expression=None, foreign_key=None, enum_values=None): # noqa: E501 """ColumnDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._concept = None + self._unit = None self._unique = None self._references = None self._internal_name = None @@ -72,7 +76,6 @@ class ColumnDto(object): self._auto_generated = None self._is_primary_key = None self._column_type = None - self._column_concept = None self._is_null_allowed = None self._check_expression = None self._foreign_key = None @@ -80,6 +83,10 @@ class ColumnDto(object): self.discriminator = None self.id = id self.name = name + if concept is not None: + self.concept = concept + if unit is not None: + self.unit = unit self.unique = unique if references is not None: self.references = references @@ -89,8 +96,6 @@ class ColumnDto(object): self.auto_generated = auto_generated self.is_primary_key = is_primary_key self.column_type = column_type - if column_concept is not None: - self.column_concept = column_concept self.is_null_allowed = is_null_allowed if check_expression is not None: self.check_expression = check_expression @@ -145,6 +150,48 @@ class ColumnDto(object): self._name = name + @property + def concept(self): + """Gets the concept of this ColumnDto. # noqa: E501 + + + :return: The concept of this ColumnDto. # noqa: E501 + :rtype: ConceptDto + """ + return self._concept + + @concept.setter + def concept(self, concept): + """Sets the concept of this ColumnDto. + + + :param concept: The concept of this ColumnDto. # noqa: E501 + :type: ConceptDto + """ + + self._concept = concept + + @property + def unit(self): + """Gets the unit of this ColumnDto. # noqa: E501 + + + :return: The unit of this ColumnDto. # noqa: E501 + :rtype: UnitDto + """ + return self._unit + + @unit.setter + def unit(self, unit): + """Sets the unit of this ColumnDto. + + + :param unit: The unit of this ColumnDto. # noqa: E501 + :type: UnitDto + """ + + self._unit = unit + @property def unique(self): """Gets the unique of this ColumnDto. # noqa: E501 @@ -308,27 +355,6 @@ class ColumnDto(object): self._column_type = column_type - @property - def column_concept(self): - """Gets the column_concept of this ColumnDto. # noqa: E501 - - - :return: The column_concept of this ColumnDto. # noqa: E501 - :rtype: ConceptDto - """ - return self._column_concept - - @column_concept.setter - def column_concept(self, column_concept): - """Sets the column_concept of this ColumnDto. - - - :param column_concept: The column_concept of this ColumnDto. # noqa: E501 - :type: ConceptDto - """ - - self._column_concept = column_concept - @property def is_null_allowed(self): """Gets the is_null_allowed of this ColumnDto. # noqa: E501 diff --git a/swagger/api/api_table/models/column_semantics_update_dto.py b/swagger/api/api_table/models/column_semantics_update_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..498a41b492e798f5256c0f2f8f8c68e326b17366 --- /dev/null +++ b/swagger/api/api_table/models/column_semantics_update_dto.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ColumnSemanticsUpdateDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'concept_uri': 'str', + 'unit_uri': 'str' + } + + attribute_map = { + 'concept_uri': 'concept_uri', + 'unit_uri': 'unit_uri' + } + + def __init__(self, concept_uri=None, unit_uri=None): # noqa: E501 + """ColumnSemanticsUpdateDto - a model defined in Swagger""" # noqa: E501 + self._concept_uri = None + self._unit_uri = None + self.discriminator = None + if concept_uri is not None: + self.concept_uri = concept_uri + if unit_uri is not None: + self.unit_uri = unit_uri + + @property + def concept_uri(self): + """Gets the concept_uri of this ColumnSemanticsUpdateDto. # noqa: E501 + + + :return: The concept_uri of this ColumnSemanticsUpdateDto. # noqa: E501 + :rtype: str + """ + return self._concept_uri + + @concept_uri.setter + def concept_uri(self, concept_uri): + """Sets the concept_uri of this ColumnSemanticsUpdateDto. + + + :param concept_uri: The concept_uri of this ColumnSemanticsUpdateDto. # noqa: E501 + :type: str + """ + + self._concept_uri = concept_uri + + @property + def unit_uri(self): + """Gets the unit_uri of this ColumnSemanticsUpdateDto. # noqa: E501 + + + :return: The unit_uri of this ColumnSemanticsUpdateDto. # noqa: E501 + :rtype: str + """ + return self._unit_uri + + @unit_uri.setter + def unit_uri(self, unit_uri): + """Sets the unit_uri of this ColumnSemanticsUpdateDto. + + + :param unit_uri: The unit_uri of this ColumnSemanticsUpdateDto. # noqa: E501 + :type: str + """ + + self._unit_uri = unit_uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ColumnSemanticsUpdateDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ColumnSemanticsUpdateDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/container_dto.py b/swagger/api/api_table/models/container_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c27399c6f6acbf16d89ac86e27af4036638696da --- /dev/null +++ b/swagger/api/api_table/models/container_dto.py @@ -0,0 +1,355 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ContainerDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'hash': 'str', + 'name': 'str', + 'state': 'str', + 'database': 'DatabaseDto', + 'image': 'ImageBriefDto', + 'port': 'int', + 'created': 'datetime', + 'internal_name': 'str', + 'ip_address': 'str' + } + + attribute_map = { + 'id': 'id', + 'hash': 'hash', + 'name': 'name', + 'state': 'state', + 'database': 'database', + 'image': 'image', + 'port': 'port', + 'created': 'created', + 'internal_name': 'internal_name', + 'ip_address': 'ip_address' + } + + def __init__(self, id=None, hash=None, name=None, state=None, database=None, image=None, port=None, created=None, internal_name=None, ip_address=None): # noqa: E501 + """ContainerDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._hash = None + self._name = None + self._state = None + self._database = None + self._image = None + self._port = None + self._created = None + self._internal_name = None + self._ip_address = None + self.discriminator = None + self.id = id + self.hash = hash + self.name = name + if state is not None: + self.state = state + if database is not None: + self.database = database + if image is not None: + self.image = image + if port is not None: + self.port = port + self.created = created + self.internal_name = internal_name + if ip_address is not None: + self.ip_address = ip_address + + @property + def id(self): + """Gets the id of this ContainerDto. # noqa: E501 + + + :return: The id of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ContainerDto. + + + :param id: The id of this ContainerDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def hash(self): + """Gets the hash of this ContainerDto. # noqa: E501 + + + :return: The hash of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ContainerDto. + + + :param hash: The hash of this ContainerDto. # noqa: E501 + :type: str + """ + if hash is None: + raise ValueError("Invalid value for `hash`, must not be `None`") # noqa: E501 + + self._hash = hash + + @property + def name(self): + """Gets the name of this ContainerDto. # noqa: E501 + + + :return: The name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ContainerDto. + + + :param name: The name of this ContainerDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def state(self): + """Gets the state of this ContainerDto. # noqa: E501 + + + :return: The state of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this ContainerDto. + + + :param state: The state of this ContainerDto. # noqa: E501 + :type: str + """ + allowed_values = ["created", "restarting", "running", "paused", "exited", "dead"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + @property + def database(self): + """Gets the database of this ContainerDto. # noqa: E501 + + + :return: The database of this ContainerDto. # noqa: E501 + :rtype: DatabaseDto + """ + return self._database + + @database.setter + def database(self, database): + """Sets the database of this ContainerDto. + + + :param database: The database of this ContainerDto. # noqa: E501 + :type: DatabaseDto + """ + + self._database = database + + @property + def image(self): + """Gets the image of this ContainerDto. # noqa: E501 + + + :return: The image of this ContainerDto. # noqa: E501 + :rtype: ImageBriefDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this ContainerDto. + + + :param image: The image of this ContainerDto. # noqa: E501 + :type: ImageBriefDto + """ + + self._image = image + + @property + def port(self): + """Gets the port of this ContainerDto. # noqa: E501 + + + :return: The port of this ContainerDto. # noqa: E501 + :rtype: int + """ + return self._port + + @port.setter + def port(self, port): + """Sets the port of this ContainerDto. + + + :param port: The port of this ContainerDto. # noqa: E501 + :type: int + """ + + self._port = port + + @property + def created(self): + """Gets the created of this ContainerDto. # noqa: E501 + + + :return: The created of this ContainerDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this ContainerDto. + + + :param created: The created of this ContainerDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def internal_name(self): + """Gets the internal_name of this ContainerDto. # noqa: E501 + + + :return: The internal_name of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this ContainerDto. + + + :param internal_name: The internal_name of this ContainerDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def ip_address(self): + """Gets the ip_address of this ContainerDto. # noqa: E501 + + + :return: The ip_address of this ContainerDto. # noqa: E501 + :rtype: str + """ + return self._ip_address + + @ip_address.setter + def ip_address(self, ip_address): + """Sets the ip_address of this ContainerDto. + + + :param ip_address: The ip_address of this ContainerDto. # noqa: E501 + :type: str + """ + + self._ip_address = ip_address + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ContainerDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ContainerDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/creator_dto.py b/swagger/api/api_table/models/creator_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..1e4eeae207032132abe794903eb7637f0573a9b8 --- /dev/null +++ b/swagger/api/api_table/models/creator_dto.py @@ -0,0 +1,269 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CreatorDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'created': 'created', + 'last_modified': 'lastModified' + } + + def __init__(self, id=None, firstname=None, lastname=None, affiliation=None, orcid=None, created=None, last_modified=None): # noqa: E501 + """CreatorDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.firstname = firstname + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + if created is not None: + self.created = created + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this CreatorDto. # noqa: E501 + + + :return: The id of this CreatorDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CreatorDto. + + + :param id: The id of this CreatorDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def firstname(self): + """Gets the firstname of this CreatorDto. # noqa: E501 + + + :return: The firstname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this CreatorDto. + + + :param firstname: The firstname of this CreatorDto. # noqa: E501 + :type: str + """ + if firstname is None: + raise ValueError("Invalid value for `firstname`, must not be `None`") # noqa: E501 + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this CreatorDto. # noqa: E501 + + + :return: The lastname of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this CreatorDto. + + + :param lastname: The lastname of this CreatorDto. # noqa: E501 + :type: str + """ + if lastname is None: + raise ValueError("Invalid value for `lastname`, must not be `None`") # noqa: E501 + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this CreatorDto. # noqa: E501 + + + :return: The affiliation of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this CreatorDto. + + + :param affiliation: The affiliation of this CreatorDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this CreatorDto. # noqa: E501 + + + :return: The orcid of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this CreatorDto. + + + :param orcid: The orcid of this CreatorDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def created(self): + """Gets the created of this CreatorDto. # noqa: E501 + + + :return: The created of this CreatorDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this CreatorDto. + + + :param created: The created of this CreatorDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def last_modified(self): + """Gets the last_modified of this CreatorDto. # noqa: E501 + + + :return: The last_modified of this CreatorDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this CreatorDto. + + + :param last_modified: The last_modified of this CreatorDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreatorDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreatorDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/database_access_dto.py b/swagger/api/api_table/models/database_access_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..cbd5673f8ce2a8e84f25f3b94e1b7c5f26a01db8 --- /dev/null +++ b/swagger/api/api_table/models/database_access_dto.py @@ -0,0 +1,170 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseAccessDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'user': 'UserDto', + 'type': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'user': 'user', + 'type': 'type', + 'created': 'created' + } + + def __init__(self, user=None, type=None, created=None): # noqa: E501 + """DatabaseAccessDto - a model defined in Swagger""" # noqa: E501 + self._user = None + self._type = None + self._created = None + self.discriminator = None + self.user = user + self.type = type + if created is not None: + self.created = created + + @property + def user(self): + """Gets the user of this DatabaseAccessDto. # noqa: E501 + + + :return: The user of this DatabaseAccessDto. # noqa: E501 + :rtype: UserDto + """ + return self._user + + @user.setter + def user(self, user): + """Sets the user of this DatabaseAccessDto. + + + :param user: The user of this DatabaseAccessDto. # noqa: E501 + :type: UserDto + """ + if user is None: + raise ValueError("Invalid value for `user`, must not be `None`") # noqa: E501 + + self._user = user + + @property + def type(self): + """Gets the type of this DatabaseAccessDto. # noqa: E501 + + + :return: The type of this DatabaseAccessDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DatabaseAccessDto. + + + :param type: The type of this DatabaseAccessDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["read", "write_own", "write_all"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def created(self): + """Gets the created of this DatabaseAccessDto. # noqa: E501 + + + :return: The created of this DatabaseAccessDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseAccessDto. + + + :param created: The created of this DatabaseAccessDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseAccessDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseAccessDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/database_dto.py b/swagger/api/api_table/models/database_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..a88de9afa7a935ddff6b0d7941042263199b85c8 --- /dev/null +++ b/swagger/api/api_table/models/database_dto.py @@ -0,0 +1,427 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DatabaseDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'name': 'str', + 'creator': 'UserBriefDto', + 'identifier': 'IdentifierDto', + 'description': 'str', + 'tables': 'list[TableBriefDto]', + 'image': 'ImageDto', + 'container': 'ContainerDto', + 'accesses': 'list[DatabaseAccessDto]', + 'created': 'datetime', + 'exchange_name': 'str', + 'internal_name': 'str', + 'is_public': 'bool' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'creator': 'creator', + 'identifier': 'identifier', + 'description': 'description', + 'tables': 'tables', + 'image': 'image', + 'container': 'container', + 'accesses': 'accesses', + 'created': 'created', + 'exchange_name': 'exchange_name', + 'internal_name': 'internal_name', + 'is_public': 'is_public' + } + + def __init__(self, id=None, name=None, creator=None, identifier=None, description=None, tables=None, image=None, container=None, accesses=None, created=None, exchange_name=None, internal_name=None, is_public=None): # noqa: E501 + """DatabaseDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._creator = None + self._identifier = None + self._description = None + self._tables = None + self._image = None + self._container = None + self._accesses = None + self._created = None + self._exchange_name = None + self._internal_name = None + self._is_public = None + self.discriminator = None + self.id = id + self.name = name + self.creator = creator + if identifier is not None: + self.identifier = identifier + if description is not None: + self.description = description + if tables is not None: + self.tables = tables + if image is not None: + self.image = image + if container is not None: + self.container = container + if accesses is not None: + self.accesses = accesses + if created is not None: + self.created = created + self.exchange_name = exchange_name + self.internal_name = internal_name + if is_public is not None: + self.is_public = is_public + + @property + def id(self): + """Gets the id of this DatabaseDto. # noqa: E501 + + + :return: The id of this DatabaseDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DatabaseDto. + + + :param id: The id of this DatabaseDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self): + """Gets the name of this DatabaseDto. # noqa: E501 + + + :return: The name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DatabaseDto. + + + :param name: The name of this DatabaseDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def creator(self): + """Gets the creator of this DatabaseDto. # noqa: E501 + + + :return: The creator of this DatabaseDto. # noqa: E501 + :rtype: UserBriefDto + """ + return self._creator + + @creator.setter + def creator(self, creator): + """Sets the creator of this DatabaseDto. + + + :param creator: The creator of this DatabaseDto. # noqa: E501 + :type: UserBriefDto + """ + if creator is None: + raise ValueError("Invalid value for `creator`, must not be `None`") # noqa: E501 + + self._creator = creator + + @property + def identifier(self): + """Gets the identifier of this DatabaseDto. # noqa: E501 + + + :return: The identifier of this DatabaseDto. # noqa: E501 + :rtype: IdentifierDto + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseDto. + + + :param identifier: The identifier of this DatabaseDto. # noqa: E501 + :type: IdentifierDto + """ + + self._identifier = identifier + + @property + def description(self): + """Gets the description of this DatabaseDto. # noqa: E501 + + + :return: The description of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this DatabaseDto. + + + :param description: The description of this DatabaseDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def tables(self): + """Gets the tables of this DatabaseDto. # noqa: E501 + + + :return: The tables of this DatabaseDto. # noqa: E501 + :rtype: list[TableBriefDto] + """ + return self._tables + + @tables.setter + def tables(self, tables): + """Sets the tables of this DatabaseDto. + + + :param tables: The tables of this DatabaseDto. # noqa: E501 + :type: list[TableBriefDto] + """ + + self._tables = tables + + @property + def image(self): + """Gets the image of this DatabaseDto. # noqa: E501 + + + :return: The image of this DatabaseDto. # noqa: E501 + :rtype: ImageDto + """ + return self._image + + @image.setter + def image(self, image): + """Sets the image of this DatabaseDto. + + + :param image: The image of this DatabaseDto. # noqa: E501 + :type: ImageDto + """ + + self._image = image + + @property + def container(self): + """Gets the container of this DatabaseDto. # noqa: E501 + + + :return: The container of this DatabaseDto. # noqa: E501 + :rtype: ContainerDto + """ + return self._container + + @container.setter + def container(self, container): + """Sets the container of this DatabaseDto. + + + :param container: The container of this DatabaseDto. # noqa: E501 + :type: ContainerDto + """ + + self._container = container + + @property + def accesses(self): + """Gets the accesses of this DatabaseDto. # noqa: E501 + + + :return: The accesses of this DatabaseDto. # noqa: E501 + :rtype: list[DatabaseAccessDto] + """ + return self._accesses + + @accesses.setter + def accesses(self, accesses): + """Sets the accesses of this DatabaseDto. + + + :param accesses: The accesses of this DatabaseDto. # noqa: E501 + :type: list[DatabaseAccessDto] + """ + + self._accesses = accesses + + @property + def created(self): + """Gets the created of this DatabaseDto. # noqa: E501 + + + :return: The created of this DatabaseDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this DatabaseDto. + + + :param created: The created of this DatabaseDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def exchange_name(self): + """Gets the exchange_name of this DatabaseDto. # noqa: E501 + + + :return: The exchange_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._exchange_name + + @exchange_name.setter + def exchange_name(self, exchange_name): + """Sets the exchange_name of this DatabaseDto. + + + :param exchange_name: The exchange_name of this DatabaseDto. # noqa: E501 + :type: str + """ + if exchange_name is None: + raise ValueError("Invalid value for `exchange_name`, must not be `None`") # noqa: E501 + + self._exchange_name = exchange_name + + @property + def internal_name(self): + """Gets the internal_name of this DatabaseDto. # noqa: E501 + + + :return: The internal_name of this DatabaseDto. # noqa: E501 + :rtype: str + """ + return self._internal_name + + @internal_name.setter + def internal_name(self, internal_name): + """Sets the internal_name of this DatabaseDto. + + + :param internal_name: The internal_name of this DatabaseDto. # noqa: E501 + :type: str + """ + if internal_name is None: + raise ValueError("Invalid value for `internal_name`, must not be `None`") # noqa: E501 + + self._internal_name = internal_name + + @property + def is_public(self): + """Gets the is_public of this DatabaseDto. # noqa: E501 + + + :return: The is_public of this DatabaseDto. # noqa: E501 + :rtype: bool + """ + return self._is_public + + @is_public.setter + def is_public(self, is_public): + """Sets the is_public of this DatabaseDto. + + + :param is_public: The is_public of this DatabaseDto. # noqa: E501 + :type: bool + """ + + self._is_public = is_public + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DatabaseDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DatabaseDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/granted_authority_dto.py b/swagger/api/api_table/models/granted_authority_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c52fdbe55002c9d0c9662eecdb335c20dca41a10 --- /dev/null +++ b/swagger/api/api_table/models/granted_authority_dto.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GrantedAuthorityDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'authority': 'str' + } + + attribute_map = { + 'authority': 'authority' + } + + def __init__(self, authority=None): # noqa: E501 + """GrantedAuthorityDto - a model defined in Swagger""" # noqa: E501 + self._authority = None + self.discriminator = None + if authority is not None: + self.authority = authority + + @property + def authority(self): + """Gets the authority of this GrantedAuthorityDto. # noqa: E501 + + + :return: The authority of this GrantedAuthorityDto. # noqa: E501 + :rtype: str + """ + return self._authority + + @authority.setter + def authority(self, authority): + """Sets the authority of this GrantedAuthorityDto. + + + :param authority: The authority of this GrantedAuthorityDto. # noqa: E501 + :type: str + """ + + self._authority = authority + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GrantedAuthorityDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GrantedAuthorityDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/identifier_dto.py b/swagger/api/api_table/models/identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..2869cb2e91471a1a3db6db3b9f4735e9e4338b83 --- /dev/null +++ b/swagger/api/api_table/models/identifier_dto.py @@ -0,0 +1,767 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IdentifierDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'type': 'str', + 'title': 'str', + 'description': 'str', + 'query': 'str', + 'execution': 'datetime', + 'visibility': 'str', + 'doi': 'str', + 'publisher': 'str', + 'language': 'str', + 'license': 'LicenseDto', + 'creators': 'list[CreatorDto]', + 'created': 'datetime', + 'container_id': 'int', + 'database_id': 'int', + 'query_id': 'int', + 'query_normalized': 'str', + 'related': 'list[RelatedIdentifierDto]', + 'query_hash': 'str', + 'result_hash': 'str', + 'result_number': 'int', + 'publication_day': 'int', + 'publication_month': 'int', + 'publication_year': 'int', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'title': 'title', + 'description': 'description', + 'query': 'query', + 'execution': 'execution', + 'visibility': 'visibility', + 'doi': 'doi', + 'publisher': 'publisher', + 'language': 'language', + 'license': 'license', + 'creators': 'creators', + 'created': 'created', + 'container_id': 'container id', + 'database_id': 'database id', + 'query_id': 'query id', + 'query_normalized': 'query_normalized', + 'related': 'related', + 'query_hash': 'query_hash', + 'result_hash': 'result_hash', + 'result_number': 'result_number', + 'publication_day': 'publication_day', + 'publication_month': 'publication_month', + 'publication_year': 'publication_year', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, type=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, created=None, container_id=None, database_id=None, query_id=None, query_normalized=None, related=None, query_hash=None, result_hash=None, result_number=None, publication_day=None, publication_month=None, publication_year=None, last_modified=None): # noqa: E501 + """IdentifierDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self._title = None + self._description = None + self._query = None + self._execution = None + self._visibility = None + self._doi = None + self._publisher = None + self._language = None + self._license = None + self._creators = None + self._created = None + self._container_id = None + self._database_id = None + self._query_id = None + self._query_normalized = None + self._related = None + self._query_hash = None + self._result_hash = None + self._result_number = None + self._publication_day = None + self._publication_month = None + self._publication_year = None + self._last_modified = None + self.discriminator = None + if id is not None: + self.id = id + self.type = type + self.title = title + if description is not None: + self.description = description + self.query = query + self.execution = execution + self.visibility = visibility + if doi is not None: + self.doi = doi + if publisher is not None: + self.publisher = publisher + if language is not None: + self.language = language + if license is not None: + self.license = license + self.creators = creators + if created is not None: + self.created = created + self.container_id = container_id + self.database_id = database_id + if query_id is not None: + self.query_id = query_id + self.query_normalized = query_normalized + if related is not None: + self.related = related + self.query_hash = query_hash + self.result_hash = result_hash + self.result_number = result_number + if publication_day is not None: + self.publication_day = publication_day + if publication_month is not None: + self.publication_month = publication_month + self.publication_year = publication_year + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this IdentifierDto. # noqa: E501 + + + :return: The id of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IdentifierDto. + + + :param id: The id of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def type(self): + """Gets the type of this IdentifierDto. # noqa: E501 + + + :return: The type of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this IdentifierDto. + + + :param type: The type of this IdentifierDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["database", "subset"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def title(self): + """Gets the title of this IdentifierDto. # noqa: E501 + + + :return: The title of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this IdentifierDto. + + + :param title: The title of this IdentifierDto. # noqa: E501 + :type: str + """ + if title is None: + raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501 + + self._title = title + + @property + def description(self): + """Gets the description of this IdentifierDto. # noqa: E501 + + + :return: The description of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this IdentifierDto. + + + :param description: The description of this IdentifierDto. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def query(self): + """Gets the query of this IdentifierDto. # noqa: E501 + + + :return: The query of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._query + + @query.setter + def query(self, query): + """Sets the query of this IdentifierDto. + + + :param query: The query of this IdentifierDto. # noqa: E501 + :type: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def execution(self): + """Gets the execution of this IdentifierDto. # noqa: E501 + + + :return: The execution of this IdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._execution + + @execution.setter + def execution(self, execution): + """Sets the execution of this IdentifierDto. + + + :param execution: The execution of this IdentifierDto. # noqa: E501 + :type: datetime + """ + if execution is None: + raise ValueError("Invalid value for `execution`, must not be `None`") # noqa: E501 + + self._execution = execution + + @property + def visibility(self): + """Gets the visibility of this IdentifierDto. # noqa: E501 + + + :return: The visibility of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._visibility + + @visibility.setter + def visibility(self, visibility): + """Sets the visibility of this IdentifierDto. + + + :param visibility: The visibility of this IdentifierDto. # noqa: E501 + :type: str + """ + if visibility is None: + raise ValueError("Invalid value for `visibility`, must not be `None`") # noqa: E501 + allowed_values = ["everyone", "trusted", "self"] # noqa: E501 + if visibility not in allowed_values: + raise ValueError( + "Invalid value for `visibility` ({0}), must be one of {1}" # noqa: E501 + .format(visibility, allowed_values) + ) + + self._visibility = visibility + + @property + def doi(self): + """Gets the doi of this IdentifierDto. # noqa: E501 + + + :return: The doi of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._doi + + @doi.setter + def doi(self, doi): + """Sets the doi of this IdentifierDto. + + + :param doi: The doi of this IdentifierDto. # noqa: E501 + :type: str + """ + + self._doi = doi + + @property + def publisher(self): + """Gets the publisher of this IdentifierDto. # noqa: E501 + + + :return: The publisher of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._publisher + + @publisher.setter + def publisher(self, publisher): + """Sets the publisher of this IdentifierDto. + + + :param publisher: The publisher of this IdentifierDto. # noqa: E501 + :type: str + """ + + self._publisher = publisher + + @property + def language(self): + """Gets the language of this IdentifierDto. # noqa: E501 + + + :return: The language of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this IdentifierDto. + + + :param language: The language of this IdentifierDto. # noqa: E501 + :type: str + """ + allowed_values = ["ab", "aa", "af", "ak", "sq", "am", "ar", "an", "hy", "as", "av", "ae", "ay", "az", "bm", "ba", "eu", "be", "bn", "bh", "bi", "bs", "br", "bg", "my", "ca", "km", "ch", "ce", "ny", "zh", "cu", "cv", "kw", "co", "cr", "hr", "cs", "da", "dv", "nl", "dz", "en", "eo", "et", "ee", "fo", "fj", "fi", "fr", "ff", "gd", "gl", "lg", "ka", "de", "ki", "el", "kl", "gn", "gu", "ht", "ha", "he", "hz", "hi", "ho", "hu", "is", "io", "ig", "id", "ia", "ie", "iu", "ik", "ga", "it", "ja", "jv", "kn", "kr", "ks", "kk", "rw", "kv", "kg", "ko", "kj", "ku", "ky", "lo", "la", "lv", "lb", "li", "ln", "lt", "lu", "mk", "mg", "ms", "ml", "mt", "gv", "mi", "mr", "mh", "ro", "mn", "na", "nv", "nd", "ng", "ne", "se", "no", "nb", "nn", "ii", "oc", "oj", "or", "om", "os", "pi", "pa", "ps", "fa", "pl", "pt", "qu", "rm", "rn", "ru", "sm", "sg", "sa", "sc", "sr", "sn", "sd", "si", "sk", "sl", "so", "st", "nr", "es", "su", "sw", "ss", "sv", "tl", "ty", "tg", "ta", "tt", "te", "th", "bo", "ti", "to", "ts", "tn", "tr", "tk", "tw", "ug", "uk", "ur", "uz", "ve", "vi", "vo", "wa", "cy", "fy", "wo", "xh", "yi", "yo", "za", "zu"] # noqa: E501 + if language not in allowed_values: + raise ValueError( + "Invalid value for `language` ({0}), must be one of {1}" # noqa: E501 + .format(language, allowed_values) + ) + + self._language = language + + @property + def license(self): + """Gets the license of this IdentifierDto. # noqa: E501 + + + :return: The license of this IdentifierDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this IdentifierDto. + + + :param license: The license of this IdentifierDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + + @property + def creators(self): + """Gets the creators of this IdentifierDto. # noqa: E501 + + + :return: The creators of this IdentifierDto. # noqa: E501 + :rtype: list[CreatorDto] + """ + return self._creators + + @creators.setter + def creators(self, creators): + """Sets the creators of this IdentifierDto. + + + :param creators: The creators of this IdentifierDto. # noqa: E501 + :type: list[CreatorDto] + """ + if creators is None: + raise ValueError("Invalid value for `creators`, must not be `None`") # noqa: E501 + + self._creators = creators + + @property + def created(self): + """Gets the created of this IdentifierDto. # noqa: E501 + + + :return: The created of this IdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this IdentifierDto. + + + :param created: The created of this IdentifierDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def container_id(self): + """Gets the container_id of this IdentifierDto. # noqa: E501 + + + :return: The container_id of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._container_id + + @container_id.setter + def container_id(self, container_id): + """Sets the container_id of this IdentifierDto. + + + :param container_id: The container_id of this IdentifierDto. # noqa: E501 + :type: int + """ + if container_id is None: + raise ValueError("Invalid value for `container_id`, must not be `None`") # noqa: E501 + + self._container_id = container_id + + @property + def database_id(self): + """Gets the database_id of this IdentifierDto. # noqa: E501 + + + :return: The database_id of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._database_id + + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this IdentifierDto. + + + :param database_id: The database_id of this IdentifierDto. # noqa: E501 + :type: int + """ + if database_id is None: + raise ValueError("Invalid value for `database_id`, must not be `None`") # noqa: E501 + + self._database_id = database_id + + @property + def query_id(self): + """Gets the query_id of this IdentifierDto. # noqa: E501 + + + :return: The query_id of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._query_id + + @query_id.setter + def query_id(self, query_id): + """Sets the query_id of this IdentifierDto. + + + :param query_id: The query_id of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._query_id = query_id + + @property + def query_normalized(self): + """Gets the query_normalized of this IdentifierDto. # noqa: E501 + + + :return: The query_normalized of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._query_normalized + + @query_normalized.setter + def query_normalized(self, query_normalized): + """Sets the query_normalized of this IdentifierDto. + + + :param query_normalized: The query_normalized of this IdentifierDto. # noqa: E501 + :type: str + """ + if query_normalized is None: + raise ValueError("Invalid value for `query_normalized`, must not be `None`") # noqa: E501 + + self._query_normalized = query_normalized + + @property + def related(self): + """Gets the related of this IdentifierDto. # noqa: E501 + + + :return: The related of this IdentifierDto. # noqa: E501 + :rtype: list[RelatedIdentifierDto] + """ + return self._related + + @related.setter + def related(self, related): + """Sets the related of this IdentifierDto. + + + :param related: The related of this IdentifierDto. # noqa: E501 + :type: list[RelatedIdentifierDto] + """ + + self._related = related + + @property + def query_hash(self): + """Gets the query_hash of this IdentifierDto. # noqa: E501 + + query hash in sha512 # noqa: E501 + + :return: The query_hash of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._query_hash + + @query_hash.setter + def query_hash(self, query_hash): + """Sets the query_hash of this IdentifierDto. + + query hash in sha512 # noqa: E501 + + :param query_hash: The query_hash of this IdentifierDto. # noqa: E501 + :type: str + """ + if query_hash is None: + raise ValueError("Invalid value for `query_hash`, must not be `None`") # noqa: E501 + + self._query_hash = query_hash + + @property + def result_hash(self): + """Gets the result_hash of this IdentifierDto. # noqa: E501 + + + :return: The result_hash of this IdentifierDto. # noqa: E501 + :rtype: str + """ + return self._result_hash + + @result_hash.setter + def result_hash(self, result_hash): + """Sets the result_hash of this IdentifierDto. + + + :param result_hash: The result_hash of this IdentifierDto. # noqa: E501 + :type: str + """ + if result_hash is None: + raise ValueError("Invalid value for `result_hash`, must not be `None`") # noqa: E501 + + self._result_hash = result_hash + + @property + def result_number(self): + """Gets the result_number of this IdentifierDto. # noqa: E501 + + + :return: The result_number of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._result_number + + @result_number.setter + def result_number(self, result_number): + """Sets the result_number of this IdentifierDto. + + + :param result_number: The result_number of this IdentifierDto. # noqa: E501 + :type: int + """ + if result_number is None: + raise ValueError("Invalid value for `result_number`, must not be `None`") # noqa: E501 + + self._result_number = result_number + + @property + def publication_day(self): + """Gets the publication_day of this IdentifierDto. # noqa: E501 + + + :return: The publication_day of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_day + + @publication_day.setter + def publication_day(self, publication_day): + """Sets the publication_day of this IdentifierDto. + + + :param publication_day: The publication_day of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._publication_day = publication_day + + @property + def publication_month(self): + """Gets the publication_month of this IdentifierDto. # noqa: E501 + + + :return: The publication_month of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_month + + @publication_month.setter + def publication_month(self, publication_month): + """Sets the publication_month of this IdentifierDto. + + + :param publication_month: The publication_month of this IdentifierDto. # noqa: E501 + :type: int + """ + + self._publication_month = publication_month + + @property + def publication_year(self): + """Gets the publication_year of this IdentifierDto. # noqa: E501 + + + :return: The publication_year of this IdentifierDto. # noqa: E501 + :rtype: int + """ + return self._publication_year + + @publication_year.setter + def publication_year(self, publication_year): + """Sets the publication_year of this IdentifierDto. + + + :param publication_year: The publication_year of this IdentifierDto. # noqa: E501 + :type: int + """ + if publication_year is None: + raise ValueError("Invalid value for `publication_year`, must not be `None`") # noqa: E501 + + self._publication_year = publication_year + + @property + def last_modified(self): + """Gets the last_modified of this IdentifierDto. # noqa: E501 + + + :return: The last_modified of this IdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this IdentifierDto. + + + :param last_modified: The last_modified of this IdentifierDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IdentifierDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IdentifierDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/image_brief_dto.py b/swagger/api/api_table/models/image_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f2968cd2019a2d6891b2739ad5840b6b76298b4a --- /dev/null +++ b/swagger/api/api_table/models/image_brief_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImageBriefDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag' + } + + def __init__(self, id=None, repository=None, tag=None): # noqa: E501 + """ImageBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + + @property + def id(self): + """Gets the id of this ImageBriefDto. # noqa: E501 + + + :return: The id of this ImageBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageBriefDto. + + + :param id: The id of this ImageBriefDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageBriefDto. # noqa: E501 + + + :return: The repository of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageBriefDto. + + + :param repository: The repository of this ImageBriefDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageBriefDto. # noqa: E501 + + + :return: The tag of this ImageBriefDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageBriefDto. + + + :param tag: The tag of this ImageBriefDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImageBriefDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImageBriefDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/image_dto.py b/swagger/api/api_table/models/image_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f8f1b0c80eab40d740586078568fada15ec0ef49 --- /dev/null +++ b/swagger/api/api_table/models/image_dto.py @@ -0,0 +1,404 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImageDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'repository': 'str', + 'tag': 'str', + 'dialect': 'str', + 'hash': 'str', + 'compiled': 'datetime', + 'size': 'int', + 'environment': 'list[ImageEnvItemDto]', + 'driver_class': 'str', + 'date_formats': 'list[ImageDateDto]', + 'jdbc_method': 'str', + 'default_port': 'int' + } + + attribute_map = { + 'id': 'id', + 'repository': 'repository', + 'tag': 'tag', + 'dialect': 'dialect', + 'hash': 'hash', + 'compiled': 'compiled', + 'size': 'size', + 'environment': 'environment', + 'driver_class': 'driver_class', + 'date_formats': 'date_formats', + 'jdbc_method': 'jdbc_method', + 'default_port': 'default_port' + } + + def __init__(self, id=None, repository=None, tag=None, dialect=None, hash=None, compiled=None, size=None, environment=None, driver_class=None, date_formats=None, jdbc_method=None, default_port=None): # noqa: E501 + """ImageDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._repository = None + self._tag = None + self._dialect = None + self._hash = None + self._compiled = None + self._size = None + self._environment = None + self._driver_class = None + self._date_formats = None + self._jdbc_method = None + self._default_port = None + self.discriminator = None + self.id = id + self.repository = repository + self.tag = tag + self.dialect = dialect + if hash is not None: + self.hash = hash + if compiled is not None: + self.compiled = compiled + if size is not None: + self.size = size + self.environment = environment + self.driver_class = driver_class + if date_formats is not None: + self.date_formats = date_formats + self.jdbc_method = jdbc_method + self.default_port = default_port + + @property + def id(self): + """Gets the id of this ImageDto. # noqa: E501 + + + :return: The id of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ImageDto. + + + :param id: The id of this ImageDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def repository(self): + """Gets the repository of this ImageDto. # noqa: E501 + + + :return: The repository of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._repository + + @repository.setter + def repository(self, repository): + """Sets the repository of this ImageDto. + + + :param repository: The repository of this ImageDto. # noqa: E501 + :type: str + """ + if repository is None: + raise ValueError("Invalid value for `repository`, must not be `None`") # noqa: E501 + + self._repository = repository + + @property + def tag(self): + """Gets the tag of this ImageDto. # noqa: E501 + + + :return: The tag of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this ImageDto. + + + :param tag: The tag of this ImageDto. # noqa: E501 + :type: str + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + + @property + def dialect(self): + """Gets the dialect of this ImageDto. # noqa: E501 + + + :return: The dialect of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._dialect + + @dialect.setter + def dialect(self, dialect): + """Sets the dialect of this ImageDto. + + + :param dialect: The dialect of this ImageDto. # noqa: E501 + :type: str + """ + if dialect is None: + raise ValueError("Invalid value for `dialect`, must not be `None`") # noqa: E501 + + self._dialect = dialect + + @property + def hash(self): + """Gets the hash of this ImageDto. # noqa: E501 + + + :return: The hash of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._hash + + @hash.setter + def hash(self, hash): + """Sets the hash of this ImageDto. + + + :param hash: The hash of this ImageDto. # noqa: E501 + :type: str + """ + + self._hash = hash + + @property + def compiled(self): + """Gets the compiled of this ImageDto. # noqa: E501 + + + :return: The compiled of this ImageDto. # noqa: E501 + :rtype: datetime + """ + return self._compiled + + @compiled.setter + def compiled(self, compiled): + """Sets the compiled of this ImageDto. + + + :param compiled: The compiled of this ImageDto. # noqa: E501 + :type: datetime + """ + + self._compiled = compiled + + @property + def size(self): + """Gets the size of this ImageDto. # noqa: E501 + + + :return: The size of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this ImageDto. + + + :param size: The size of this ImageDto. # noqa: E501 + :type: int + """ + + self._size = size + + @property + def environment(self): + """Gets the environment of this ImageDto. # noqa: E501 + + + :return: The environment of this ImageDto. # noqa: E501 + :rtype: list[ImageEnvItemDto] + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this ImageDto. + + + :param environment: The environment of this ImageDto. # noqa: E501 + :type: list[ImageEnvItemDto] + """ + if environment is None: + raise ValueError("Invalid value for `environment`, must not be `None`") # noqa: E501 + + self._environment = environment + + @property + def driver_class(self): + """Gets the driver_class of this ImageDto. # noqa: E501 + + + :return: The driver_class of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._driver_class + + @driver_class.setter + def driver_class(self, driver_class): + """Sets the driver_class of this ImageDto. + + + :param driver_class: The driver_class of this ImageDto. # noqa: E501 + :type: str + """ + if driver_class is None: + raise ValueError("Invalid value for `driver_class`, must not be `None`") # noqa: E501 + + self._driver_class = driver_class + + @property + def date_formats(self): + """Gets the date_formats of this ImageDto. # noqa: E501 + + + :return: The date_formats of this ImageDto. # noqa: E501 + :rtype: list[ImageDateDto] + """ + return self._date_formats + + @date_formats.setter + def date_formats(self, date_formats): + """Sets the date_formats of this ImageDto. + + + :param date_formats: The date_formats of this ImageDto. # noqa: E501 + :type: list[ImageDateDto] + """ + + self._date_formats = date_formats + + @property + def jdbc_method(self): + """Gets the jdbc_method of this ImageDto. # noqa: E501 + + + :return: The jdbc_method of this ImageDto. # noqa: E501 + :rtype: str + """ + return self._jdbc_method + + @jdbc_method.setter + def jdbc_method(self, jdbc_method): + """Sets the jdbc_method of this ImageDto. + + + :param jdbc_method: The jdbc_method of this ImageDto. # noqa: E501 + :type: str + """ + if jdbc_method is None: + raise ValueError("Invalid value for `jdbc_method`, must not be `None`") # noqa: E501 + + self._jdbc_method = jdbc_method + + @property + def default_port(self): + """Gets the default_port of this ImageDto. # noqa: E501 + + + :return: The default_port of this ImageDto. # noqa: E501 + :rtype: int + """ + return self._default_port + + @default_port.setter + def default_port(self, default_port): + """Sets the default_port of this ImageDto. + + + :param default_port: The default_port of this ImageDto. # noqa: E501 + :type: int + """ + if default_port is None: + raise ValueError("Invalid value for `default_port`, must not be `None`") # noqa: E501 + + self._default_port = default_port + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImageDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImageDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/image_env_item_dto.py b/swagger/api/api_table/models/image_env_item_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f590642a18218c87978e2537acf780b1081f5d37 --- /dev/null +++ b/swagger/api/api_table/models/image_env_item_dto.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ImageEnvItemDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'iid': 'int', + 'key': 'str', + 'value': 'str', + 'type': 'str' + } + + attribute_map = { + 'iid': 'iid', + 'key': 'key', + 'value': 'value', + 'type': 'type' + } + + def __init__(self, iid=None, key=None, value=None, type=None): # noqa: E501 + """ImageEnvItemDto - a model defined in Swagger""" # noqa: E501 + self._iid = None + self._key = None + self._value = None + self._type = None + self.discriminator = None + self.iid = iid + self.key = key + self.value = value + self.type = type + + @property + def iid(self): + """Gets the iid of this ImageEnvItemDto. # noqa: E501 + + + :return: The iid of this ImageEnvItemDto. # noqa: E501 + :rtype: int + """ + return self._iid + + @iid.setter + def iid(self, iid): + """Sets the iid of this ImageEnvItemDto. + + + :param iid: The iid of this ImageEnvItemDto. # noqa: E501 + :type: int + """ + if iid is None: + raise ValueError("Invalid value for `iid`, must not be `None`") # noqa: E501 + + self._iid = iid + + @property + def key(self): + """Gets the key of this ImageEnvItemDto. # noqa: E501 + + + :return: The key of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this ImageEnvItemDto. + + + :param key: The key of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this ImageEnvItemDto. # noqa: E501 + + + :return: The value of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ImageEnvItemDto. + + + :param value: The value of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this ImageEnvItemDto. # noqa: E501 + + + :return: The type of this ImageEnvItemDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ImageEnvItemDto. + + + :param type: The type of this ImageEnvItemDto. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["username", "password", "privileged_username", "privileged_password"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ImageEnvItemDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ImageEnvItemDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/license_dto.py b/swagger/api/api_table/models/license_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..77cfc3e08b2ebd527a86175beb16566203e8425a --- /dev/null +++ b/swagger/api/api_table/models/license_dto.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class LicenseDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'identifier': 'str', + 'uri': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'uri': 'uri' + } + + def __init__(self, identifier=None, uri=None): # noqa: E501 + """LicenseDto - a model defined in Swagger""" # noqa: E501 + self._identifier = None + self._uri = None + self.discriminator = None + self.identifier = identifier + self.uri = uri + + @property + def identifier(self): + """Gets the identifier of this LicenseDto. # noqa: E501 + + + :return: The identifier of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this LicenseDto. + + + :param identifier: The identifier of this LicenseDto. # noqa: E501 + :type: str + """ + if identifier is None: + raise ValueError("Invalid value for `identifier`, must not be `None`") # noqa: E501 + + self._identifier = identifier + + @property + def uri(self): + """Gets the uri of this LicenseDto. # noqa: E501 + + + :return: The uri of this LicenseDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this LicenseDto. + + + :param uri: The uri of this LicenseDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(LicenseDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, LicenseDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/related_identifier_dto.py b/swagger/api/api_table/models/related_identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..27b0667a2acf48d1c314a52e6e8784b669a65bd2 --- /dev/null +++ b/swagger/api/api_table/models/related_identifier_dto.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RelatedIdentifierDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'value': 'str', + 'type': 'str', + 'relation': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'value': 'value', + 'type': 'type', + 'relation': 'relation', + 'created': 'created', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, value=None, type=None, relation=None, created=None, last_modified=None): # noqa: E501 + """RelatedIdentifierDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._value = None + self._type = None + self._relation = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.value = value + if type is not None: + self.type = type + if relation is not None: + self.relation = relation + self.created = created + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this RelatedIdentifierDto. # noqa: E501 + + + :return: The id of this RelatedIdentifierDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this RelatedIdentifierDto. + + + :param id: The id of this RelatedIdentifierDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def value(self): + """Gets the value of this RelatedIdentifierDto. # noqa: E501 + + + :return: The value of this RelatedIdentifierDto. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this RelatedIdentifierDto. + + + :param value: The value of this RelatedIdentifierDto. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + @property + def type(self): + """Gets the type of this RelatedIdentifierDto. # noqa: E501 + + + :return: The type of this RelatedIdentifierDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this RelatedIdentifierDto. + + + :param type: The type of this RelatedIdentifierDto. # noqa: E501 + :type: str + """ + allowed_values = ["DOI", "URL", "URN", "ARK", "arXiv", "bibcode", "EAN13", "EISSN", "Handle", "IGSN", "ISBN", "ISTC", "LISSN", "LSID", "PMID", "PURL", "UPC", "w3id"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def relation(self): + """Gets the relation of this RelatedIdentifierDto. # noqa: E501 + + + :return: The relation of this RelatedIdentifierDto. # noqa: E501 + :rtype: str + """ + return self._relation + + @relation.setter + def relation(self, relation): + """Sets the relation of this RelatedIdentifierDto. + + + :param relation: The relation of this RelatedIdentifierDto. # noqa: E501 + :type: str + """ + allowed_values = ["IsCitedBy", "Cites", "IsSupplementTo", "IsSupplementedBy", "IsContinuedBy", "Continues", "IsDescribedBy", "Describes", "HasMetadata", "IsMetadataFor", "HasVersion", "IsVersionOf", "IsNewVersionOf", "IsPreviousVersionOf", "IsPartOf", "HasPart", "IsPublishedIn", "IsReferencedBy", "References", "IsDocumentedBy", "Documents", "IsCompiledBy", "Compiles", "IsVariantFormOf", "IsOriginalFormOf", "IsIdenticalTo", "IsReviewedBy", "Reviews", "IsDerivedFrom", "IsSourceOf", "IsRequiredBy", "Requires", "IsObsoletedBy", "Obsoletes"] # noqa: E501 + if relation not in allowed_values: + raise ValueError( + "Invalid value for `relation` ({0}), must be one of {1}" # noqa: E501 + .format(relation, allowed_values) + ) + + self._relation = relation + + @property + def created(self): + """Gets the created of this RelatedIdentifierDto. # noqa: E501 + + + :return: The created of this RelatedIdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this RelatedIdentifierDto. + + + :param created: The created of this RelatedIdentifierDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + @property + def last_modified(self): + """Gets the last_modified of this RelatedIdentifierDto. # noqa: E501 + + + :return: The last_modified of this RelatedIdentifierDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this RelatedIdentifierDto. + + + :param last_modified: The last_modified of this RelatedIdentifierDto. # noqa: E501 + :type: datetime + """ + + self._last_modified = last_modified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(RelatedIdentifierDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, RelatedIdentifierDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/table_brief_dto.py b/swagger/api/api_table/models/table_brief_dto.py index a811499bd935581d4021a5783ffd3c5490a9907c..41b26e79c7af6ca61f453839ad468bc60710870d 100644 --- a/swagger/api/api_table/models/table_brief_dto.py +++ b/swagger/api/api_table/models/table_brief_dto.py @@ -30,6 +30,7 @@ class TableBriefDto(object): swagger_types = { 'id': 'int', 'name': 'str', + 'description': 'str', 'creator': 'UserBriefDto', 'internal_name': 'str' } @@ -37,19 +38,22 @@ class TableBriefDto(object): attribute_map = { 'id': 'id', 'name': 'name', + 'description': 'description', 'creator': 'creator', 'internal_name': 'internal_name' } - def __init__(self, id=None, name=None, creator=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, description=None, creator=None, internal_name=None): # noqa: E501 """TableBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None + self._description = None self._creator = None self._internal_name = None self.discriminator = None self.id = id self.name = name + self.description = description self.creator = creator self.internal_name = internal_name @@ -99,6 +103,29 @@ class TableBriefDto(object): self._name = name + @property + def description(self): + """Gets the description of this TableBriefDto. # noqa: E501 + + + :return: The description of this TableBriefDto. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this TableBriefDto. + + + :param description: The description of this TableBriefDto. # noqa: E501 + :type: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description + @property def creator(self): """Gets the creator of this TableBriefDto. # noqa: E501 diff --git a/swagger/api/api_table/models/table_dto.py b/swagger/api/api_table/models/table_dto.py index 00af01d052aaddfcda9f0b561dd283325fcd43bd..5f33cb5825dcba1c6b32c05b63fccc4cdd0eea20 100644 --- a/swagger/api/api_table/models/table_dto.py +++ b/swagger/api/api_table/models/table_dto.py @@ -31,44 +31,48 @@ class TableDto(object): 'id': 'int', 'name': 'str', 'creator': 'UserBriefDto', - 'topic': 'str', 'description': 'str', 'created': 'datetime', 'columns': 'list[ColumnDto]', - 'internal_name': 'str' + 'internal_name': 'str', + 'queue_name': 'str', + 'routing_key': 'str' } attribute_map = { 'id': 'id', 'name': 'name', 'creator': 'creator', - 'topic': 'topic', 'description': 'description', 'created': 'created', 'columns': 'columns', - 'internal_name': 'internal_name' + 'internal_name': 'internal_name', + 'queue_name': 'queue_name', + 'routing_key': 'routing_key' } - def __init__(self, id=None, name=None, creator=None, topic=None, description=None, created=None, columns=None, internal_name=None): # noqa: E501 + def __init__(self, id=None, name=None, creator=None, description=None, created=None, columns=None, internal_name=None, queue_name=None, routing_key=None): # noqa: E501 """TableDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._creator = None - self._topic = None self._description = None self._created = None self._columns = None self._internal_name = None + self._queue_name = None + self._routing_key = None self.discriminator = None self.id = id self.name = name self.creator = creator - self.topic = topic self.description = description if created is not None: self.created = created self.columns = columns self.internal_name = internal_name + self.queue_name = queue_name + self.routing_key = routing_key @property def id(self): @@ -139,29 +143,6 @@ class TableDto(object): self._creator = creator - @property - def topic(self): - """Gets the topic of this TableDto. # noqa: E501 - - - :return: The topic of this TableDto. # noqa: E501 - :rtype: str - """ - return self._topic - - @topic.setter - def topic(self, topic): - """Sets the topic of this TableDto. - - - :param topic: The topic of this TableDto. # noqa: E501 - :type: str - """ - if topic is None: - raise ValueError("Invalid value for `topic`, must not be `None`") # noqa: E501 - - self._topic = topic - @property def description(self): """Gets the description of this TableDto. # noqa: E501 @@ -252,6 +233,52 @@ class TableDto(object): self._internal_name = internal_name + @property + def queue_name(self): + """Gets the queue_name of this TableDto. # noqa: E501 + + + :return: The queue_name of this TableDto. # noqa: E501 + :rtype: str + """ + return self._queue_name + + @queue_name.setter + def queue_name(self, queue_name): + """Sets the queue_name of this TableDto. + + + :param queue_name: The queue_name of this TableDto. # noqa: E501 + :type: str + """ + if queue_name is None: + raise ValueError("Invalid value for `queue_name`, must not be `None`") # noqa: E501 + + self._queue_name = queue_name + + @property + def routing_key(self): + """Gets the routing_key of this TableDto. # noqa: E501 + + + :return: The routing_key of this TableDto. # noqa: E501 + :rtype: str + """ + return self._routing_key + + @routing_key.setter + def routing_key(self, routing_key): + """Sets the routing_key of this TableDto. + + + :param routing_key: The routing_key of this TableDto. # noqa: E501 + :type: str + """ + if routing_key is None: + raise ValueError("Invalid value for `routing_key`, must not be `None`") # noqa: E501 + + self._routing_key = routing_key + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/swagger/api/api_table/models/unit_dto.py b/swagger/api/api_table/models/unit_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f097faa08e877f94da53278f1c8ae01f89639bc9 --- /dev/null +++ b/swagger/api/api_table/models/unit_dto.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnitDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'uri': 'str', + 'name': 'str', + 'created': 'datetime' + } + + attribute_map = { + 'uri': 'uri', + 'name': 'name', + 'created': 'created' + } + + def __init__(self, uri=None, name=None, created=None): # noqa: E501 + """UnitDto - a model defined in Swagger""" # noqa: E501 + self._uri = None + self._name = None + self._created = None + self.discriminator = None + self.uri = uri + self.name = name + self.created = created + + @property + def uri(self): + """Gets the uri of this UnitDto. # noqa: E501 + + + :return: The uri of this UnitDto. # noqa: E501 + :rtype: str + """ + return self._uri + + @uri.setter + def uri(self, uri): + """Sets the uri of this UnitDto. + + + :param uri: The uri of this UnitDto. # noqa: E501 + :type: str + """ + if uri is None: + raise ValueError("Invalid value for `uri`, must not be `None`") # noqa: E501 + + self._uri = uri + + @property + def name(self): + """Gets the name of this UnitDto. # noqa: E501 + + + :return: The name of this UnitDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this UnitDto. + + + :param name: The name of this UnitDto. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def created(self): + """Gets the created of this UnitDto. # noqa: E501 + + + :return: The created of this UnitDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this UnitDto. + + + :param created: The created of this UnitDto. # noqa: E501 + :type: datetime + """ + if created is None: + raise ValueError("Invalid value for `created`, must not be `None`") # noqa: E501 + + self._created = created + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UnitDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnitDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/api/api_table/models/user_brief_dto.py b/swagger/api/api_table/models/user_brief_dto.py index ed701ff11ae01e4d93dab071529b088e3c330ae9..5a8df14940041702715a6af17c13bfc930792b8e 100644 --- a/swagger/api/api_table/models/user_brief_dto.py +++ b/swagger/api/api_table/models/user_brief_dto.py @@ -30,12 +30,13 @@ class UserBriefDto(object): swagger_types = { 'id': 'int', 'username': 'str', + 'titles_before': 'str', + 'titles_after': 'str', 'firstname': 'str', 'lastname': 'str', 'affiliation': 'str', 'orcid': 'str', - 'titles_before': 'str', - 'titles_after': 'str', + 'roles': 'list[str]', 'theme_dark': 'bool', 'email_verified': 'bool' } @@ -43,31 +44,37 @@ class UserBriefDto(object): attribute_map = { 'id': 'id', 'username': 'username', + 'titles_before': 'titlesBefore', + 'titles_after': 'titlesAfter', 'firstname': 'firstname', 'lastname': 'lastname', 'affiliation': 'affiliation', 'orcid': 'orcid', - 'titles_before': 'titles_before', - 'titles_after': 'titles_after', - 'theme_dark': 'theme_dark', - 'email_verified': 'email_verified' + 'roles': 'roles', + 'theme_dark': 'themeDark', + 'email_verified': 'emailVerified' } - def __init__(self, id=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + def __init__(self, id=None, username=None, titles_before=None, titles_after=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, theme_dark=None, email_verified=None): # noqa: E501 """UserBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._username = None + self._titles_before = None + self._titles_after = None self._firstname = None self._lastname = None self._affiliation = None self._orcid = None - self._titles_before = None - self._titles_after = None + self._roles = None self._theme_dark = None self._email_verified = None self.discriminator = None self.id = id self.username = username + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after if firstname is not None: self.firstname = firstname if lastname is not None: @@ -76,12 +83,11 @@ class UserBriefDto(object): self.affiliation = affiliation if orcid is not None: self.orcid = orcid - if titles_before is not None: - self.titles_before = titles_before - if titles_after is not None: - self.titles_after = titles_after - self.theme_dark = theme_dark - self.email_verified = email_verified + self.roles = roles + if theme_dark is not None: + self.theme_dark = theme_dark + if email_verified is not None: + self.email_verified = email_verified @property def id(self): @@ -131,6 +137,48 @@ class UserBriefDto(object): self._username = username + @property + def titles_before(self): + """Gets the titles_before of this UserBriefDto. # noqa: E501 + + + :return: The titles_before of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserBriefDto. + + + :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserBriefDto. # noqa: E501 + + + :return: The titles_after of this UserBriefDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserBriefDto. + + + :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + @property def firstname(self): """Gets the firstname of this UserBriefDto. # noqa: E501 @@ -216,46 +264,29 @@ class UserBriefDto(object): self._orcid = orcid @property - def titles_before(self): - """Gets the titles_before of this UserBriefDto. # noqa: E501 + def roles(self): + """Gets the roles of this UserBriefDto. # noqa: E501 + Roles of the user # noqa: E501 - :return: The titles_before of this UserBriefDto. # noqa: E501 - :rtype: str + :return: The roles of this UserBriefDto. # noqa: E501 + :rtype: list[str] """ - return self._titles_before + return self._roles - @titles_before.setter - def titles_before(self, titles_before): - """Sets the titles_before of this UserBriefDto. + @roles.setter + def roles(self, roles): + """Sets the roles of this UserBriefDto. + Roles of the user # noqa: E501 - :param titles_before: The titles_before of this UserBriefDto. # noqa: E501 - :type: str + :param roles: The roles of this UserBriefDto. # noqa: E501 + :type: list[str] """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 - self._titles_before = titles_before - - @property - def titles_after(self): - """Gets the titles_after of this UserBriefDto. # noqa: E501 - - - :return: The titles_after of this UserBriefDto. # noqa: E501 - :rtype: str - """ - return self._titles_after - - @titles_after.setter - def titles_after(self, titles_after): - """Sets the titles_after of this UserBriefDto. - - - :param titles_after: The titles_after of this UserBriefDto. # noqa: E501 - :type: str - """ - - self._titles_after = titles_after + self._roles = roles @property def theme_dark(self): @@ -275,8 +306,6 @@ class UserBriefDto(object): :param theme_dark: The theme_dark of this UserBriefDto. # noqa: E501 :type: bool """ - if theme_dark is None: - raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 self._theme_dark = theme_dark @@ -298,8 +327,6 @@ class UserBriefDto(object): :param email_verified: The email_verified of this UserBriefDto. # noqa: E501 :type: bool """ - if email_verified is None: - raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 self._email_verified = email_verified diff --git a/swagger/api/api_table/models/user_dto.py b/swagger/api/api_table/models/user_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..99f248e34706ed3e1682448728ed824003340a4b --- /dev/null +++ b/swagger/api/api_table/models/user_dto.py @@ -0,0 +1,510 @@ +# coding: utf-8 + +""" + Database Repository Table Service API + + Service that manages the tables # noqa: E501 + + OpenAPI spec version: 1.1.0-alpha + Contact: andreas.rauber@tuwien.ac.at + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UserDto(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'int', + 'authorities': 'list[GrantedAuthorityDto]', + 'username': 'str', + 'firstname': 'str', + 'lastname': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'roles': 'list[str]', + 'containers': 'list[ContainerDto]', + 'databases': 'list[ContainerDto]', + 'identifiers': 'list[ContainerDto]', + 'email': 'str', + 'titles_before': 'str', + 'titles_after': 'str', + 'theme_dark': 'bool', + 'email_verified': 'bool' + } + + attribute_map = { + 'id': 'id', + 'authorities': 'authorities', + 'username': 'username', + 'firstname': 'firstname', + 'lastname': 'lastname', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'roles': 'roles', + 'containers': 'containers', + 'databases': 'databases', + 'identifiers': 'identifiers', + 'email': 'email', + 'titles_before': 'titles_before', + 'titles_after': 'titles_after', + 'theme_dark': 'theme_dark', + 'email_verified': 'email_verified' + } + + def __init__(self, id=None, authorities=None, username=None, firstname=None, lastname=None, affiliation=None, orcid=None, roles=None, containers=None, databases=None, identifiers=None, email=None, titles_before=None, titles_after=None, theme_dark=None, email_verified=None): # noqa: E501 + """UserDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._authorities = None + self._username = None + self._firstname = None + self._lastname = None + self._affiliation = None + self._orcid = None + self._roles = None + self._containers = None + self._databases = None + self._identifiers = None + self._email = None + self._titles_before = None + self._titles_after = None + self._theme_dark = None + self._email_verified = None + self.discriminator = None + self.id = id + if authorities is not None: + self.authorities = authorities + self.username = username + if firstname is not None: + self.firstname = firstname + if lastname is not None: + self.lastname = lastname + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + self.roles = roles + if containers is not None: + self.containers = containers + if databases is not None: + self.databases = databases + if identifiers is not None: + self.identifiers = identifiers + self.email = email + if titles_before is not None: + self.titles_before = titles_before + if titles_after is not None: + self.titles_after = titles_after + self.theme_dark = theme_dark + self.email_verified = email_verified + + @property + def id(self): + """Gets the id of this UserDto. # noqa: E501 + + + :return: The id of this UserDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UserDto. + + + :param id: The id of this UserDto. # noqa: E501 + :type: int + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def authorities(self): + """Gets the authorities of this UserDto. # noqa: E501 + + + :return: The authorities of this UserDto. # noqa: E501 + :rtype: list[GrantedAuthorityDto] + """ + return self._authorities + + @authorities.setter + def authorities(self, authorities): + """Sets the authorities of this UserDto. + + + :param authorities: The authorities of this UserDto. # noqa: E501 + :type: list[GrantedAuthorityDto] + """ + + self._authorities = authorities + + @property + def username(self): + """Gets the username of this UserDto. # noqa: E501 + + Only contains lowercase characters # noqa: E501 + + :return: The username of this UserDto. # noqa: E501 + :rtype: str + """ + return self._username + + @username.setter + def username(self, username): + """Sets the username of this UserDto. + + Only contains lowercase characters # noqa: E501 + + :param username: The username of this UserDto. # noqa: E501 + :type: str + """ + if username is None: + raise ValueError("Invalid value for `username`, must not be `None`") # noqa: E501 + + self._username = username + + @property + def firstname(self): + """Gets the firstname of this UserDto. # noqa: E501 + + + :return: The firstname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._firstname + + @firstname.setter + def firstname(self, firstname): + """Sets the firstname of this UserDto. + + + :param firstname: The firstname of this UserDto. # noqa: E501 + :type: str + """ + + self._firstname = firstname + + @property + def lastname(self): + """Gets the lastname of this UserDto. # noqa: E501 + + + :return: The lastname of this UserDto. # noqa: E501 + :rtype: str + """ + return self._lastname + + @lastname.setter + def lastname(self, lastname): + """Sets the lastname of this UserDto. + + + :param lastname: The lastname of this UserDto. # noqa: E501 + :type: str + """ + + self._lastname = lastname + + @property + def affiliation(self): + """Gets the affiliation of this UserDto. # noqa: E501 + + + :return: The affiliation of this UserDto. # noqa: E501 + :rtype: str + """ + return self._affiliation + + @affiliation.setter + def affiliation(self, affiliation): + """Sets the affiliation of this UserDto. + + + :param affiliation: The affiliation of this UserDto. # noqa: E501 + :type: str + """ + + self._affiliation = affiliation + + @property + def orcid(self): + """Gets the orcid of this UserDto. # noqa: E501 + + + :return: The orcid of this UserDto. # noqa: E501 + :rtype: str + """ + return self._orcid + + @orcid.setter + def orcid(self, orcid): + """Sets the orcid of this UserDto. + + + :param orcid: The orcid of this UserDto. # noqa: E501 + :type: str + """ + + self._orcid = orcid + + @property + def roles(self): + """Gets the roles of this UserDto. # noqa: E501 + + Roles of the user # noqa: E501 + + :return: The roles of this UserDto. # noqa: E501 + :rtype: list[str] + """ + return self._roles + + @roles.setter + def roles(self, roles): + """Sets the roles of this UserDto. + + Roles of the user # noqa: E501 + + :param roles: The roles of this UserDto. # noqa: E501 + :type: list[str] + """ + if roles is None: + raise ValueError("Invalid value for `roles`, must not be `None`") # noqa: E501 + + self._roles = roles + + @property + def containers(self): + """Gets the containers of this UserDto. # noqa: E501 + + + :return: The containers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._containers + + @containers.setter + def containers(self, containers): + """Sets the containers of this UserDto. + + + :param containers: The containers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._containers = containers + + @property + def databases(self): + """Gets the databases of this UserDto. # noqa: E501 + + + :return: The databases of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._databases + + @databases.setter + def databases(self, databases): + """Sets the databases of this UserDto. + + + :param databases: The databases of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._databases = databases + + @property + def identifiers(self): + """Gets the identifiers of this UserDto. # noqa: E501 + + + :return: The identifiers of this UserDto. # noqa: E501 + :rtype: list[ContainerDto] + """ + return self._identifiers + + @identifiers.setter + def identifiers(self, identifiers): + """Sets the identifiers of this UserDto. + + + :param identifiers: The identifiers of this UserDto. # noqa: E501 + :type: list[ContainerDto] + """ + + self._identifiers = identifiers + + @property + def email(self): + """Gets the email of this UserDto. # noqa: E501 + + + :return: The email of this UserDto. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this UserDto. + + + :param email: The email of this UserDto. # noqa: E501 + :type: str + """ + if email is None: + raise ValueError("Invalid value for `email`, must not be `None`") # noqa: E501 + + self._email = email + + @property + def titles_before(self): + """Gets the titles_before of this UserDto. # noqa: E501 + + + :return: The titles_before of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_before + + @titles_before.setter + def titles_before(self, titles_before): + """Sets the titles_before of this UserDto. + + + :param titles_before: The titles_before of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_before = titles_before + + @property + def titles_after(self): + """Gets the titles_after of this UserDto. # noqa: E501 + + + :return: The titles_after of this UserDto. # noqa: E501 + :rtype: str + """ + return self._titles_after + + @titles_after.setter + def titles_after(self, titles_after): + """Sets the titles_after of this UserDto. + + + :param titles_after: The titles_after of this UserDto. # noqa: E501 + :type: str + """ + + self._titles_after = titles_after + + @property + def theme_dark(self): + """Gets the theme_dark of this UserDto. # noqa: E501 + + + :return: The theme_dark of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._theme_dark + + @theme_dark.setter + def theme_dark(self, theme_dark): + """Sets the theme_dark of this UserDto. + + + :param theme_dark: The theme_dark of this UserDto. # noqa: E501 + :type: bool + """ + if theme_dark is None: + raise ValueError("Invalid value for `theme_dark`, must not be `None`") # noqa: E501 + + self._theme_dark = theme_dark + + @property + def email_verified(self): + """Gets the email_verified of this UserDto. # noqa: E501 + + + :return: The email_verified of this UserDto. # noqa: E501 + :rtype: bool + """ + return self._email_verified + + @email_verified.setter + def email_verified(self, email_verified): + """Sets the email_verified of this UserDto. + + + :param email_verified: The email_verified of this UserDto. # noqa: E501 + :type: bool + """ + if email_verified is None: + raise ValueError("Invalid value for `email_verified`, must not be `None`") # noqa: E501 + + self._email_verified = email_verified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UserDto, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserDto): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/swagger/authentication/api.yaml b/swagger/authentication/api.yaml index 85eeb5d071670b32cebb81e3b0deef9de9338972..a7026565a9f9d60fbb1c4b1c40b3927c5043e38e 100644 --- a/swagger/authentication/api.yaml +++ b/swagger/authentication/api.yaml @@ -1378,18 +1378,19 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - /api/user/token/{hash}: + /api/user/token/{id}: delete: tags: - token-endpoint summary: Delete developer token operationId: delete parameters: - - name: hash + - name: id in: path required: true schema: - type: string + type: integer + format: int64 responses: "417": description: Expectation Failed @@ -1579,10 +1580,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -1599,17 +1598,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -1619,13 +1621,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -1637,9 +1656,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -1655,12 +1671,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -1676,7 +1696,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -1725,8 +1744,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -2175,15 +2192,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -2195,6 +2210,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -2202,9 +2220,8 @@ components: example: air_quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -2215,6 +2232,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -2227,22 +2248,24 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true UserDto: required: - email - email_verified - id + - roles - theme_dark - username type: object @@ -2270,6 +2293,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: @@ -2333,6 +2364,10 @@ components: type: array items: type: string + enum: + - researcher + - developer + - data_steward UserPasswordDto: required: - password @@ -2392,9 +2427,6 @@ components: expires: type: string format: date-time - deleted: - type: string - format: date-time token: type: string example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c @@ -2454,9 +2486,6 @@ components: expires: type: string format: date-time - deleted: - type: string - format: date-time token_hash: type: string example: 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 diff --git a/swagger/container/api.yaml b/swagger/container/api.yaml index 6ab5dce17180f908e7706825f0829a6652e4ef76..b39513d6e8648674fd876385bccaf9a0cc171c5c 100644 --- a/swagger/container/api.yaml +++ b/swagger/container/api.yaml @@ -776,9 +776,8 @@ components: example: air-quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -789,6 +788,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -801,17 +804,18 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true ImageCreateDto: required: - default_port @@ -900,10 +904,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -920,17 +922,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -940,13 +945,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -958,9 +980,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -976,12 +995,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -997,7 +1020,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -1046,8 +1068,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -1376,15 +1396,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -1396,6 +1414,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -1406,6 +1427,7 @@ components: - email - email_verified - id + - roles - theme_dark - username type: object @@ -1433,6 +1455,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: diff --git a/swagger/database/api.yaml b/swagger/database/api.yaml index e22dc884054fceb7dff912cf1d9a05693a7aeaa6..dddf38b757e84f91609c04ae10e82f229587cba0 100644 --- a/swagger/database/api.yaml +++ b/swagger/database/api.yaml @@ -72,24 +72,197 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/DatabaseDto' + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/access/{username}: + put: + tags: + - access-endpoint + summary: Modify access to some database + operationId: update + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + - name: username + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseModifyAccessDto' + required: true + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "417": description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - $ref: '#/components/schemas/DatabaseDto' + type: object + security: + - bearerAuth: [] + delete: + tags: + - access-endpoint + summary: Revoke access to some database + operationId: update_1 + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + - name: username + in: path + required: true + schema: + type: string + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: object security: - bearerAuth: [] /api/container/{id}/database: @@ -136,8 +309,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -148,6 +321,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -205,24 +384,187 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/DatabaseBriefDto' + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/access: + get: + tags: + - access-endpoint + summary: Check access to some database + operationId: find + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/DatabaseAccessDto' + security: + - bearerAuth: [] + post: + tags: + - access-endpoint + summary: Give access to some database + operationId: create_1 + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseGiveAccessDto' + required: true + responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "417": description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - $ref: '#/components/schemas/DatabaseBriefDto' + type: object security: - bearerAuth: [] /api/container/{id}/database/{databaseId}: @@ -275,8 +617,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -287,6 +629,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -344,8 +692,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -356,6 +704,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -408,8 +762,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway + "403": + description: Forbidden content: '*/*': schema: @@ -420,6 +774,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "502": + description: Bad Gateway + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -551,10 +911,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -571,17 +929,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -591,13 +952,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -609,9 +987,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -627,12 +1002,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -648,7 +1027,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -697,8 +1075,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -1147,15 +1523,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -1167,6 +1541,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -1174,9 +1551,8 @@ components: example: air_quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -1187,6 +1563,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -1199,22 +1579,24 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true UserDto: required: - email - email_verified - id + - roles - theme_dark - username type: object @@ -1242,6 +1624,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: @@ -1268,6 +1658,17 @@ components: email_verified: type: boolean example: true + DatabaseModifyAccessDto: + required: + - type + type: object + properties: + type: + type: string + enum: + - read + - write_own + - write_all DatabaseCreateDto: required: - is_public @@ -1321,7 +1722,7 @@ components: type: string example: Air Quality in Austria identifier: - $ref: '#/components/schemas/IdentifierBriefDto' + $ref: '#/components/schemas/IdentifierDto' engine: type: string example: mariadb:10.5 @@ -1335,43 +1736,20 @@ components: is_public: type: boolean example: true - IdentifierBriefDto: + DatabaseGiveAccessDto: required: - - container id - - database id - - title - type + - username type: object properties: - id: - type: integer - format: int64 - title: + username: type: string - example: "Airquality Stephansplatz, Vienna, Austria" type: type: string enum: - - database - - subset - created: - type: string - format: date-time - container id: - type: integer - format: int64 - example: 1 - database id: - type: integer - format: int64 - example: 1 - query id: - type: integer - format: int64 - example: 1 - last_modified: - type: string - format: date-time + - read + - write_own + - write_all securitySchemes: bearerAuth: type: http diff --git a/swagger/generate.sh b/swagger/generate.sh index 90e7d22861056c698288cb500f703c16d5fa8269..e3c3f2209edd7a94a666bf92ce922e7fe438ca00 100755 --- a/swagger/generate.sh +++ b/swagger/generate.sh @@ -2,7 +2,7 @@ declare -A services services[5000]=analyse -services[5010]=units +services[5010]=semantics services[9091]=container services[9092]=database services[9093]=query @@ -13,7 +13,7 @@ services[9099]=metadata function retrieve () { echo "... retrieve api" - if [[ "$2" == units ]] || [[ "$2" == analyse ]]; then + if [[ "$2" == semantics ]] || [[ "$2" == analyse ]]; then wget "http://localhost:$1/api-$2.json" -O "./api-$2.yaml" -q else wget "http://localhost:$1/v3/api-docs.yaml" -O "./api-$2.yaml" -q @@ -27,15 +27,11 @@ function generate () { function remove () { echo "... removing old python api" - #rm -rf "${HOME}/Projects/fda-services/.gitlab/api_$1" - #rm -rf "${HOME}/Projects/fda-services/.demo/api_$1" rm -rf "./api/api_$1" } function copy () { echo "... copying python api" - #cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.gitlab/api_$1" - #cp -r "./api-$1/swagger_client" "${HOME}/Projects/fda-services/.demo/api_$1" cp -r "./api-$1/swagger_client" "./api/api_$1" cp "./api-$1.yaml" "./$1/api.yaml" cp -r ../dist/* "./$1" @@ -43,10 +39,6 @@ function copy () { function replace () { echo "... replacing swagger client package name and gateway" - #find "${HOME}/Projects/fda-services/.gitlab/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; - #find "${HOME}/Projects/fda-services/.gitlab/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; - #find "${HOME}/Projects/fda-services/.demo/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; - #find "${HOME}/Projects/fda-services/.demo/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; find "./api/api_$2" -type f -exec sed -i -e "s/swagger_client/api_$2/g" {} \; find "./api/api_$2" -type f -exec sed -i -e "s/self.host = .*/self.host = \"http:\/\/localhost:9095\"/g" {} \; } diff --git a/swagger/identifier/api.yaml b/swagger/identifier/api.yaml index 120e774b525f97f349e563b828bb73b73a14c1f8..8aedd6ba273aef6e32b0c08bbd04d84a0c8e662e 100644 --- a/swagger/identifier/api.yaml +++ b/swagger/identifier/api.yaml @@ -17,62 +17,6 @@ servers: description: Generated server url paths: /api/identifier/{id}: - get: - tags: - - identifier-endpoint - summary: Export some identifier metadata - operationId: export - parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 - responses: - "404": - description: Not Found - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "400": - description: Bad Request - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "200": - description: OK - content: - '*/*': - schema: - type: string - format: binary put: tags: - identifier-endpoint @@ -80,7 +24,7 @@ paths: operationId: update parameters: - name: id - in: query + in: path required: true schema: type: integer @@ -139,11 +83,11 @@ paths: delete: tags: - identifier-endpoint - summary: Delete some identifer + summary: Delete some identifier operationId: delete parameters: - name: id - in: query + in: path required: true schema: type: integer @@ -467,65 +411,22 @@ components: code: type: string example: error.container.notfound - ContainerDto: - required: - - created - - hash - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - hash: - type: string - example: f829dd8a884182d0da846f365dee1221fd16610a14c81b8f9f295ff162749e50 - name: - type: string - example: Air Quality - state: - type: string - example: running - enum: - - created - - restarting - - running - - paused - - exited - - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' - image: - $ref: '#/components/schemas/ImageBriefDto' - port: - type: integer - format: int32 - created: - type: string - format: date-time - example: 2021-03-12T15:26:21.678396092Z - internal_name: - type: string - example: air-quality - ip_address: - type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: type: string - example: "Carberry, Josiah" + example: Josiah + lastname: + type: string + example: Carberry affiliation: type: string example: Wesleyan University @@ -535,64 +436,12 @@ components: created: type: string format: date-time - last_modified: + lastModified: type: string format: date-time - DatabaseDto: - required: - - creator - - exchange - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: Air Quality - exchange: - type: string - example: air_quality - creator: - $ref: '#/components/schemas/UserBriefDto' - identifier: - $ref: '#/components/schemas/IdentifierDto' - description: - type: string - example: Weather Australia 2009-2021 - tables: - type: array - items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' - created: - type: string - format: date-time - deleted: - type: string - format: date-time - internal_name: - type: string - example: weather_australia - is_public: - type: boolean - example: true - GrantedAuthorityDto: - type: object - properties: - authority: - type: string - example: ROLE_RESEARCHER IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -641,8 +490,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -883,126 +730,6 @@ components: last_modified: type: string format: date-time - ImageBriefDto: - required: - - id - - repository - - tag - type: object - properties: - id: - type: integer - format: int64 - repository: - type: string - example: mariadb - tag: - type: string - example: "10.5" - ImageDateDto: - required: - - database_format - - example - - has_time - - id - - unix_format - type: object - properties: - id: - type: integer - format: int64 - example: - type: string - example: 30.01.2022 - database_format: - type: string - example: '%d.%c.%Y' - unix_format: - type: string - example: dd.MM.YYYY - has_time: - type: boolean - example: false - created_at: - type: string - format: date-time - ImageDto: - required: - - default_port - - dialect - - driver_class - - environment - - id - - jdbc_method - - repository - - tag - type: object - properties: - id: - type: integer - format: int64 - repository: - type: string - example: mariadb - tag: - type: string - example: "10.5" - dialect: - type: string - example: org.hibernate.dialect.MariaDBDialect - hash: - type: string - example: sha256:c5ec7353d87dfc35067e7bffeb25d6a0d52dad41e8b7357213e3b12d6e7ff78e - compiled: - type: string - format: date-time - example: 2021-03-12T15:26:21.678396092Z - size: - type: integer - example: 314295447 - environment: - type: array - items: - $ref: '#/components/schemas/ImageEnvItemDto' - driver_class: - type: string - example: org.mariadb.jdbc.Driver - date_formats: - type: array - items: - $ref: '#/components/schemas/ImageDateDto' - jdbc_method: - type: string - example: mariadb - default_port: - type: integer - format: int32 - example: 3306 - ImageEnvItemDto: - required: - - iid - - key - - type - - value - type: object - properties: - iid: - type: integer - format: int64 - key: - type: string - example: MARIADB_ROOT_PASSWORD - value: - type: string - example: mariadb - type: - type: string - example: PRIVILEGED_PASSWORD - enum: - - username - - password - - privileged_username - - privileged_password LicenseDto: required: - identifier @@ -1091,135 +818,21 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time - TableBriefDto: - required: - - creator - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: Air Quality - creator: - $ref: '#/components/schemas/UserBriefDto' - internal_name: - type: string - example: air_quality - UserBriefDto: - required: - - email_verified - - id - - theme_dark - - username - type: object - properties: - id: - type: integer - format: int64 - username: - type: string - description: Only contains lowercase characters - example: user - firstname: - type: string - example: Josiah - lastname: - type: string - example: Carberry - affiliation: - type: string - example: Brown University - orcid: - type: string - example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: - type: boolean - example: true - email_verified: - type: boolean - example: true - UserDto: + CreatorCreateDto: required: - - email - - email_verified - - id - - theme_dark - - username + - firstname + - lastname type: object properties: - id: - type: integer - format: int64 - authorities: - type: array - items: - $ref: '#/components/schemas/GrantedAuthorityDto' - username: - type: string - description: Only contains lowercase characters - example: jcarberry firstname: type: string example: Josiah lastname: type: string example: Carberry - affiliation: - type: string - example: Brown University - orcid: - type: string - example: 0000-0002-1825-0097 - containers: - type: array - items: - $ref: '#/components/schemas/ContainerDto' - databases: - type: array - items: - $ref: '#/components/schemas/ContainerDto' - identifiers: - type: array - items: - $ref: '#/components/schemas/ContainerDto' - email: - type: string - example: jcarberry@brown.edu - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: - type: boolean - example: true - email_verified: - type: boolean - example: true - CreatorCreateDto: - required: - - name - type: object - properties: - name: - type: string - example: "Carberry, Josiah" affiliation: type: string example: Wesleyan University diff --git a/swagger/metadata/api.yaml b/swagger/metadata/api.yaml index cfae26f6afcd8cb5a9da489c97eb0bbdb0bf18e8..464eeaa7c19d1402a59f00be03dfab3440704112 100644 --- a/swagger/metadata/api.yaml +++ b/swagger/metadata/api.yaml @@ -149,11 +149,11 @@ components: type: string resumptionToken: type: string - parametersString: - type: string fromDate: type: string format: date-time untilDate: type: string format: date-time + parametersString: + type: string diff --git a/swagger/query/api.yaml b/swagger/query/api.yaml index a215efed2ff48a042cba6cbe17c2a38b2e2de861..78da736748dd3f2063b66594ef30b604efe79527 100644 --- a/swagger/query/api.yaml +++ b/swagger/query/api.yaml @@ -42,8 +42,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -66,6 +66,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -119,8 +125,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -143,6 +149,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -228,8 +240,8 @@ paths: schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -252,6 +264,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -309,8 +327,8 @@ paths: $ref: '#/components/schemas/TableCsvUpdateDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -333,6 +351,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -386,8 +410,8 @@ paths: $ref: '#/components/schemas/TableCsvDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -410,6 +434,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -463,8 +493,8 @@ paths: $ref: '#/components/schemas/TableCsvDeleteDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -487,6 +517,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -565,8 +601,8 @@ paths: schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -589,6 +625,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -615,12 +657,12 @@ paths: $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query: + /api/container/{id}/database/{databaseId}/query/{queryId}: get: tags: - store-endpoint - summary: Find queries - operationId: findAll_2 + summary: Find some query + operationId: find_1 parameters: - name: id in: path @@ -634,14 +676,15 @@ paths: schema: type: integer format: int64 - - name: persisted - in: query - required: false + - name: queryId + in: path + required: true schema: - type: boolean + type: integer + format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -664,6 +707,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -687,16 +736,14 @@ paths: content: '*/*': schema: - type: array - items: - $ref: '#/components/schemas/QueryBriefDto' + $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] put: tags: - - query-endpoint - summary: Execute query - operationId: execute + - store-endpoint + summary: Persist some query + operationId: persist parameters: - name: id in: path @@ -710,40 +757,15 @@ paths: schema: type: integer format: int64 - - name: page - in: query - required: false - schema: - type: integer - format: int64 - - name: size - in: query - required: false + - name: queryId + in: path + required: true schema: type: integer format: int64 - - name: sortDirection - in: query - required: false - schema: - type: string - enum: - - asc - - desc - - name: sortColumn - in: query - required: false - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExecuteStatementDto' - required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -766,6 +788,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -789,15 +817,15 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryResultDto' + $ref: '#/components/schemas/QueryDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query/{queryId}: + /api/container/{id}/database/{databaseId}/view: get: tags: - - store-endpoint - summary: Find some query - operationId: find + - view-endpoint + summary: Find all views + operationId: findAll parameters: - name: id in: path @@ -811,15 +839,9 @@ paths: schema: type: integer format: int64 - - name: queryId - in: path - required: true - schema: - type: integer - format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -842,6 +864,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -865,14 +893,16 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryDto' + type: array + items: + $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] - put: + post: tags: - - store-endpoint - summary: Persist some query - operationId: persist + - view-endpoint + summary: Create a view + operationId: create parameters: - name: id in: path @@ -886,15 +916,15 @@ paths: schema: type: integer format: int64 - - name: queryId - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ViewCreateDto' required: true - schema: - type: integer - format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -917,6 +947,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -940,15 +976,15 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/QueryDto' + $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/view: - get: + /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: + post: tags: - - view-endpoint - summary: Find all views - operationId: findAll + - table-data-endpoint + summary: Insert data from csv + operationId: importCsv parameters: - name: id in: path @@ -962,9 +998,21 @@ paths: schema: type: integer format: int64 + - name: tableId + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ImportDto' + required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -987,6 +1035,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1007,19 +1061,14 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/ViewBriefDto' security: - bearerAuth: [] - post: + /api/container/{id}/database/{databaseId}/query: + get: tags: - - view-endpoint - summary: Create a view - operationId: create + - store-endpoint + summary: Find queries + operationId: findAll_1 parameters: - name: id in: path @@ -1033,15 +1082,14 @@ paths: schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ViewCreateDto' - required: true + - name: persisted + in: query + required: false + schema: + type: boolean responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1064,6 +1112,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1087,15 +1141,16 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/ViewBriefDto' + type: array + items: + $ref: '#/components/schemas/QueryBriefDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: post: tags: - - table-data-endpoint - summary: Insert data from csv - operationId: importCsv + - query-endpoint + summary: Execute query + operationId: execute parameters: - name: id in: path @@ -1109,21 +1164,40 @@ paths: schema: type: integer format: int64 - - name: tableId - in: path - required: true + - name: page + in: query + required: false schema: type: integer format: int64 + - name: size + in: query + required: false + schema: + type: integer + format: int64 + - name: sortDirection + in: query + required: false + schema: + type: string + enum: + - asc + - desc + - name: sortColumn + in: query + required: false + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/ImportDto' + $ref: '#/components/schemas/ExecuteStatementDto' required: true responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1146,6 +1220,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1166,6 +1246,10 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] /api/container/{id}/database/{databaseId}/view/{viewId}: @@ -1173,7 +1257,7 @@ paths: tags: - view-endpoint summary: Find one view - operationId: findAll_1 + operationId: find parameters: - name: id in: path @@ -1194,8 +1278,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1218,6 +1302,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1269,8 +1359,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1293,6 +1383,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1357,8 +1453,8 @@ paths: type: integer format: int64 responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1381,6 +1477,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1439,8 +1541,8 @@ paths: type: string format: date-time responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1463,6 +1565,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1515,14 +1623,14 @@ paths: schema: type: integer format: int64 - - name: download - in: query - required: false + - name: Accept + in: header + required: true schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1545,6 +1653,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1622,8 +1736,8 @@ paths: schema: type: string responses: - "409": - description: Conflict + "504": + description: Gateway Timeout content: '*/*': schema: @@ -1646,6 +1760,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: @@ -1808,14 +1928,6 @@ components: type: object additionalProperties: type: object - ExecuteStatementDto: - required: - - statement - type: object - properties: - statement: - type: string - example: SELECT `id` FROM `air_quality` ContainerDto: required: - created @@ -1844,10 +1956,8 @@ components: - paused - exited - dead - databases: - type: array - items: - $ref: '#/components/schemas/DatabaseDto' + database: + $ref: '#/components/schemas/DatabaseDto' image: $ref: '#/components/schemas/ImageBriefDto' port: @@ -1864,17 +1974,20 @@ components: type: string CreatorDto: required: - - created + - firstname - id - - name + - lastname type: object properties: id: type: integer format: int64 - name: + firstname: + type: string + example: Josiah + lastname: type: string - example: "Carberry, Josiah" + example: Carberry affiliation: type: string example: Wesleyan University @@ -1884,13 +1997,30 @@ components: created: type: string format: date-time - last_modified: + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: type: string format: date-time DatabaseDto: required: - creator - - exchange + - exchange_name - id - internal_name - name @@ -1902,9 +2032,6 @@ components: name: type: string example: Air Quality - exchange: - type: string - example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' identifier: @@ -1920,12 +2047,16 @@ components: $ref: '#/components/schemas/ImageDto' container: $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' created: type: string format: date-time - deleted: + exchange_name: type: string - format: date-time + example: dbrepo/4/4 internal_name: type: string example: weather_australia @@ -1941,7 +2072,6 @@ components: IdentifierDto: required: - container id - - creator - creators - database id - execution @@ -1990,8 +2120,6 @@ components: publisher: type: string example: TU Wien - creator: - $ref: '#/components/schemas/UserDto' language: type: string enum: @@ -2494,15 +2622,13 @@ components: created: type: string format: date-time - deleted: - type: string - format: date-time last_modified: type: string format: date-time TableBriefDto: required: - creator + - description - id - internal_name - name @@ -2514,6 +2640,9 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' internal_name: @@ -2521,9 +2650,8 @@ components: example: air_quality UserBriefDto: required: - - email_verified - id - - theme_dark + - roles - username type: object properties: @@ -2534,6 +2662,10 @@ components: type: string description: Only contains lowercase characters example: user + titlesBefore: + type: string + titlesAfter: + type: string firstname: type: string example: Josiah @@ -2546,22 +2678,24 @@ components: orcid: type: string example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: type: boolean - example: true - email_verified: + emailVerified: type: boolean - example: true UserDto: required: - email - email_verified - id + - roles - theme_dark - username type: object @@ -2589,6 +2723,14 @@ components: orcid: type: string example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" containers: type: array items: @@ -2636,6 +2778,8 @@ components: - created - created_by - id + - internalName + - name - query - vdbid type: object @@ -2649,15 +2793,15 @@ components: name: type: string example: Air Quality + internalName: + type: string + example: air_quality query: type: string example: SELECT `id` FROM `air_quality` ORDER BY `value` DESC created: type: string format: date-time - deleted: - type: string - format: date-time is_public: type: boolean example: true @@ -2706,12 +2850,21 @@ components: null_element: type: string example: NA + ExecuteStatementDto: + required: + - statement + type: object + properties: + statement: + type: string + example: SELECT `id` FROM `air_quality` ViewDto: required: - created - creator - database - id + - internalName - name - query - vdbid @@ -2730,15 +2883,15 @@ components: name: type: string example: Air Quality + internalName: + type: string + example: air_quality query: type: string example: SELECT `id` FROM `air_quality` ORDER BY `value` DESC created: type: string format: date-time - deleted: - type: string - format: date-time is_public: type: boolean example: true diff --git a/swagger/semantics/api.yaml b/swagger/semantics/api.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e813438f15157b3a207c52d54551e19f07318975 --- /dev/null +++ b/swagger/semantics/api.yaml @@ -0,0 +1 @@ +{"definitions":{},"info":{"contact":{"email":"andreas.rauber@tuwien.ac.at","name":"Prof. Andreas Rauber"},"description":"Service for assigning concepts to database tables and columns.","license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"},"title":"Database Repository Unit / Ontology Service API","version":"1.1.0-alpha"},"openapi":"3.0.0","paths":{"/api/semantics/concept":{"get":{"consumes":["application/json"],"description":"This is a simple API which returns a list of suggested concepts.","parameters":[{"description":"The query to retrieve a fitting concept","in":"query","name":"q","schema":{"type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Suggest a concept","tags":["concepts-endpoint"]},"post":{"consumes":["application/json"],"description":"This is a simple API for saving concept","produces":["application/json"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"example":"metre","type":"string"},"uri":{"example":"http://www.ontology-of-units-of-measure.org/resource/om-2/metre","type":"string"}},"required":["uri","name"],"type":"object"}}}},"responses":{"200":{"description":"OK"},"201":{"description":"Created"},"405":{"description":"Invalid input"},"409":{"description":"Concept already present"}},"summary":"Save concept to MDB","tags":["concepts-endpoint"]}},"/api/semantics/concept/{concept}/validate":{"get":{"consumes":["application/json"],"description":"This is a simple API for validating concepts.","parameters":[{"description":"Validates concepts against om-2.","in":"path","name":"unit","required":true,"schema":{"example":"distance","type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Validate concepts","tags":["concepts-endpoint"]}},"/api/semantics/ontology":{"get":{"consumes":["application/json"],"description":"This is a simple API for listing all ontologies (.nt, .ttl files) used in DB-Repo.","produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"List ontologies","tags":["ontologies-endpoint"]}},"/api/semantics/ontology/{name}":{"get":{"consumes":["application/json"],"description":"This is a simple API for getting a certain ontologies (.nt, .ttl files) stored in DB-Repo.","parameters":[{"in":"path","name":"o_name","required":true,"schema":{"example":"VOCAB_QUDT-UNITS-ALL-v2.1","type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"},"405":{"description":"Invalid input"}},"summary":"Get ontology","tags":["ontologies-endpoint"]}},"/api/semantics/unit":{"get":{"consumes":["application/json"],"description":"This is a simple API which returns a list of suggested units.","parameters":[{"description":"The query to retrieve a fitting unit","in":"query","name":"q","schema":{"type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Suggest a unit","tags":["units-endpoint"]},"post":{"consumes":["application/json"],"description":"This is a simple API for saving units","produces":["application/json"],"requestBody":{"content":{"application/json":{"schema":{"properties":{"name":{"example":"second","type":"string"},"uri":{"example":"http://www.ontology-of-units-of-measure.org/resource/om-2/second-Time","type":"string"}},"required":["uri","name"],"type":"object"}}}},"responses":{"200":{"description":"OK"},"201":{"description":"Created"},"405":{"description":"Invalid input"},"409":{"description":"Concept already present"}},"summary":"Save unit to MDB","tags":["units-endpoint"]}},"/api/semantics/unit/{unit}/validate":{"get":{"consumes":["application/json"],"description":"This is a simple API for validating units.","parameters":[{"description":"Validates unit against om-2.","in":"path","name":"unit","required":true,"schema":{"example":"metre","type":"string"}}],"produces":["application/json"],"responses":{"200":{"description":"OK"},"405":{"description":"Invalid input"}},"summary":"Validate units","tags":["units-endpoint"]}}},"servers":[{"description":"Generated server url","url":"http://localhost:5010"},{"description":"DBRepo Production Server","url":"https://dbrepo1.ec.tuwien.ac.at/api/units"}]} diff --git a/swagger/table/api.yaml b/swagger/table/api.yaml index 1624286e82cd5b8b59b7c5712bbc71f165e6f818..372f3dc894dd7b08838d0da1a7ba98b6eadd5a47 100644 --- a/swagger/table/api.yaml +++ b/swagger/table/api.yaml @@ -16,12 +16,12 @@ servers: - url: http://localhost:9094 description: Generated server url paths: - /api/container/{id}/database/{databaseId}/table/{tableId}: - get: + /api/container/{id}/database/{databaseId}/table/{tableId}/column/{columnId}: + put: tags: - - table-endpoint - summary: Get information about table - operationId: findById + - table-column-endpoint + summary: Update a table column semantic mapping + operationId: update parameters: - name: id in: path @@ -41,6 +41,18 @@ paths: schema: type: integer format: int64 + - name: columnId + in: path + required: true + schema: + type: integer + format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ColumnSemanticsUpdateDto' + required: true responses: "400": description: Bad Request @@ -77,14 +89,15 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/TableDto' + $ref: '#/components/schemas/ColumnDto' security: - bearerAuth: [] - put: + /api/container/{id}/database/{databaseId}/table: + get: tags: - table-endpoint - summary: Update a table - operationId: update + summary: List all tables + operationId: list parameters: - name: id in: path @@ -98,12 +111,71 @@ paths: schema: type: integer format: int64 - - name: tableId + responses: + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/TableBriefDto' + security: + - bearerAuth: [] + post: + tags: + - table-endpoint + summary: Create a table + operationId: create + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId in: path required: true schema: type: integer format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TableCreateDto' + required: true responses: "400": description: Bad Request @@ -143,11 +215,12 @@ paths: $ref: '#/components/schemas/TableBriefDto' security: - bearerAuth: [] - delete: + /api/container/{id}/database/{databaseId}/table/{tableId}: + get: tags: - table-endpoint - summary: Delete a table - operationId: delete + summary: Get information about table + operationId: findById parameters: - name: id in: path @@ -200,14 +273,17 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/TableDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table: - get: + delete: tags: - table-endpoint - summary: List all tables - operationId: list + summary: Delete a table + operationId: delete parameters: - name: id in: path @@ -221,6 +297,12 @@ paths: schema: type: integer format: int64 + - name: tableId + in: path + required: true + schema: + type: integer + format: int64 responses: "400": description: Bad Request @@ -254,19 +336,14 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/TableBriefDto' security: - bearerAuth: [] - post: + /api/container/{id}/database/{databaseId}/table/{tableId}/access: + get: tags: - - table-endpoint - summary: Create a table - operationId: create + - access-endpoint + summary: Check access to some table + operationId: checkAccess parameters: - name: id in: path @@ -280,12 +357,12 @@ paths: schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TableCreateDto' + - name: tableId + in: path required: true + schema: + type: integer + format: int64 responses: "400": description: Bad Request @@ -322,7 +399,7 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/TableBriefDto' + $ref: '#/components/schemas/DatabaseAccessDto' security: - bearerAuth: [] components: @@ -412,128 +489,13 @@ components: code: type: string example: error.container.notfound - TableBriefDto: - required: - - creator - - id - - internal_name - - name - type: object - properties: - id: - type: integer - format: int64 - name: - type: string - example: Air Quality - creator: - $ref: '#/components/schemas/UserBriefDto' - internal_name: - type: string - example: air_quality - UserBriefDto: - required: - - email_verified - - id - - theme_dark - - username - type: object - properties: - id: - type: integer - format: int64 - username: - type: string - description: Only contains lowercase characters - example: user - firstname: - type: string - example: Josiah - lastname: - type: string - example: Carberry - affiliation: - type: string - example: Brown University - orcid: - type: string - example: 0000-0002-1825-0097 - titles_before: - type: string - example: Prof. - titles_after: - type: string - theme_dark: - type: boolean - example: true - email_verified: - type: boolean - example: true - ColumnCreateDto: - required: - - name - - null_allowed - - primary_key - - type - - unique - type: object - properties: - name: - type: string - example: Date - type: - type: string - example: string - enum: - - enum - - number - - decimal - - string - - text - - boolean - - date - - timestamp - - blob - dfid: - type: integer - description: date format id - format: int64 - unique: - type: boolean - example: false - references: - type: string - primary_key: - type: boolean - example: false - null_allowed: - type: boolean - example: true - check_expression: - type: string - foreign_key: - type: string - enum_values: - type: array - items: - type: string - TableCreateDto: - required: - - columns - - description - - name + ColumnSemanticsUpdateDto: type: object properties: - name: + concept_uri: type: string - example: Air Quality - description: + unit_uri: type: string - example: Air Quality in Austria - columns: - type: array - items: - $ref: '#/components/schemas/ColumnCreateDto' ColumnDto: required: - auto_generated @@ -552,6 +514,10 @@ components: name: type: string example: Date + concept: + $ref: '#/components/schemas/ConceptDto' + unit: + $ref: '#/components/schemas/UnitDto' unique: type: boolean example: true @@ -581,8 +547,6 @@ components: - date - timestamp - blob - column_concept: - $ref: '#/components/schemas/ConceptDto' is_null_allowed: type: boolean example: false @@ -635,15 +599,98 @@ components: created_at: type: string format: date-time - TableDto: + UnitDto: required: - - columns - - creator - - description - - id + - created + - name + - uri + type: object + properties: + uri: + type: string + name: + type: string + created: + type: string + format: date-time + ColumnCreateDto: + required: + - name + - null_allowed + - primary_key + - type + - unique + type: object + properties: + name: + type: string + example: Date + type: + type: string + example: string + enum: + - enum + - number + - decimal + - string + - text + - boolean + - date + - timestamp + - blob + dfid: + type: integer + description: date format id + format: int64 + unique: + type: boolean + example: false + references: + type: string + description: "foreign key reference, only considered when foreignKey !=\ + \ null" + primary_key: + type: boolean + example: false + null_allowed: + type: boolean + example: true + check_expression: + type: string + description: check constraint + example: id > 0 + foreign_key: + type: string + enum_values: + type: array + description: "enum values, only considered when type = ENUM" + items: + type: string + description: "enum values, only considered when type = ENUM" + TableCreateDto: + required: + - columns + - description + - name + type: object + properties: + name: + type: string + example: Air Quality + description: + type: string + example: Air Quality in Austria + columns: + type: array + items: + $ref: '#/components/schemas/ColumnCreateDto' + TableBriefDto: + required: + - creator + - description + - id - internal_name - name - - topic type: object properties: id: @@ -652,11 +699,76 @@ components: name: type: string example: Air Quality + description: + type: string + example: Air Quality in Austria creator: $ref: '#/components/schemas/UserBriefDto' - topic: + internal_name: type: string example: air_quality + UserBriefDto: + required: + - id + - roles + - username + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + description: Only contains lowercase characters + example: user + titlesBefore: + type: string + titlesAfter: + type: string + firstname: + type: string + example: Josiah + lastname: + type: string + example: Carberry + affiliation: + type: string + example: Brown University + orcid: + type: string + example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + themeDark: + type: boolean + emailVerified: + type: boolean + TableDto: + required: + - columns + - creator + - description + - id + - internal_name + - name + - queue_name + - routing_key + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: Air Quality + creator: + $ref: '#/components/schemas/UserBriefDto' description: type: string example: Air Quality in Austria @@ -670,6 +782,695 @@ components: internal_name: type: string example: air_quality + queue_name: + type: string + example: dbrepo/4/4/2 + routing_key: + type: string + example: dbrepo/4/4/2/1 + ContainerDto: + required: + - created + - hash + - id + - internal_name + - name + type: object + properties: + id: + type: integer + format: int64 + hash: + type: string + example: f829dd8a884182d0da846f365dee1221fd16610a14c81b8f9f295ff162749e50 + name: + type: string + example: Air Quality + state: + type: string + example: running + enum: + - created + - restarting + - running + - paused + - exited + - dead + database: + $ref: '#/components/schemas/DatabaseDto' + image: + $ref: '#/components/schemas/ImageBriefDto' + port: + type: integer + format: int32 + created: + type: string + format: date-time + example: 2021-03-12T15:26:21.678396092Z + internal_name: + type: string + example: air-quality + ip_address: + type: string + CreatorDto: + required: + - firstname + - id + - lastname + type: object + properties: + id: + type: integer + format: int64 + firstname: + type: string + example: Josiah + lastname: + type: string + example: Carberry + affiliation: + type: string + example: Wesleyan University + orcid: + type: string + example: 0000-0002-1825-0097 + created: + type: string + format: date-time + lastModified: + type: string + format: date-time + DatabaseAccessDto: + required: + - type + - user + type: object + properties: + user: + $ref: '#/components/schemas/UserDto' + type: + type: string + enum: + - read + - write_own + - write_all + created: + type: string + format: date-time + DatabaseDto: + required: + - creator + - exchange_name + - id + - internal_name + - name + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: Air Quality + creator: + $ref: '#/components/schemas/UserBriefDto' + identifier: + $ref: '#/components/schemas/IdentifierDto' + description: + type: string + example: Weather Australia 2009-2021 + tables: + type: array + items: + $ref: '#/components/schemas/TableBriefDto' + image: + $ref: '#/components/schemas/ImageDto' + container: + $ref: '#/components/schemas/ContainerDto' + accesses: + type: array + items: + $ref: '#/components/schemas/DatabaseAccessDto' + created: + type: string + format: date-time + exchange_name: + type: string + example: dbrepo/4/4 + internal_name: + type: string + example: weather_australia + is_public: + type: boolean + example: true + GrantedAuthorityDto: + type: object + properties: + authority: + type: string + example: ROLE_RESEARCHER + IdentifierDto: + required: + - container id + - creators + - database id + - execution + - publication_year + - query + - query_hash + - query_normalized + - result_hash + - result_number + - title + - type + - visibility + type: object + properties: + id: + type: integer + format: int64 + type: + type: string + enum: + - database + - subset + title: + type: string + example: "Airquality Stephansplatz, Vienna, Austria" + description: + type: string + example: "Air quality reports at Stephansplatz, Vienna" + query: + type: string + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + execution: + type: string + format: date-time + visibility: + type: string + example: everyone + enum: + - everyone + - trusted + - self + doi: + type: string + example: 10.1038/nphys1170 + publisher: + type: string + example: TU Wien + language: + type: string + enum: + - ab + - aa + - af + - ak + - sq + - am + - ar + - an + - hy + - as + - av + - ae + - ay + - az + - bm + - ba + - eu + - be + - bn + - bh + - bi + - bs + - br + - bg + - my + - ca + - km + - ch + - ce + - ny + - zh + - cu + - cv + - kw + - co + - cr + - hr + - cs + - da + - dv + - nl + - dz + - en + - eo + - et + - ee + - fo + - fj + - fi + - fr + - ff + - gd + - gl + - lg + - ka + - de + - ki + - el + - kl + - gn + - gu + - ht + - ha + - he + - hz + - hi + - ho + - hu + - is + - io + - ig + - id + - ia + - ie + - iu + - ik + - ga + - it + - ja + - jv + - kn + - kr + - ks + - kk + - rw + - kv + - kg + - ko + - kj + - ku + - ky + - lo + - la + - lv + - lb + - li + - ln + - lt + - lu + - mk + - mg + - ms + - ml + - mt + - gv + - mi + - mr + - mh + - ro + - mn + - na + - nv + - nd + - ng + - ne + - se + - "no" + - nb + - nn + - ii + - oc + - oj + - or + - om + - os + - pi + - pa + - ps + - fa + - pl + - pt + - qu + - rm + - rn + - ru + - sm + - sg + - sa + - sc + - sr + - sn + - sd + - si + - sk + - sl + - so + - st + - nr + - es + - su + - sw + - ss + - sv + - tl + - ty + - tg + - ta + - tt + - te + - th + - bo + - ti + - to + - ts + - tn + - tr + - tk + - tw + - ug + - uk + - ur + - uz + - ve + - vi + - vo + - wa + - cy + - fy + - wo + - xh + - yi + - yo + - za + - zu + license: + $ref: '#/components/schemas/LicenseDto' + creators: + type: array + items: + $ref: '#/components/schemas/CreatorDto' + created: + type: string + format: date-time + container id: + type: integer + format: int64 + example: 1 + database id: + type: integer + format: int64 + example: 1 + query id: + type: integer + format: int64 + example: 1 + query_normalized: + type: string + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + related: + type: array + items: + $ref: '#/components/schemas/RelatedIdentifierDto' + query_hash: + type: string + description: query hash in sha512 + result_hash: + type: string + result_number: + type: integer + format: int64 + example: 1 + publication_day: + type: integer + format: int32 + example: 15 + publication_month: + type: integer + format: int32 + example: 12 + publication_year: + type: integer + format: int32 + example: 2022 + last_modified: + type: string + format: date-time + ImageBriefDto: + required: + - id + - repository + - tag + type: object + properties: + id: + type: integer + format: int64 + repository: + type: string + example: mariadb + tag: + type: string + example: "10.5" + ImageDto: + required: + - default_port + - dialect + - driver_class + - environment + - id + - jdbc_method + - repository + - tag + type: object + properties: + id: + type: integer + format: int64 + repository: + type: string + example: mariadb + tag: + type: string + example: "10.5" + dialect: + type: string + example: org.hibernate.dialect.MariaDBDialect + hash: + type: string + example: sha256:c5ec7353d87dfc35067e7bffeb25d6a0d52dad41e8b7357213e3b12d6e7ff78e + compiled: + type: string + format: date-time + example: 2021-03-12T15:26:21.678396092Z + size: + type: integer + example: 314295447 + environment: + type: array + items: + $ref: '#/components/schemas/ImageEnvItemDto' + driver_class: + type: string + example: org.mariadb.jdbc.Driver + date_formats: + type: array + items: + $ref: '#/components/schemas/ImageDateDto' + jdbc_method: + type: string + example: mariadb + default_port: + type: integer + format: int32 + example: 3306 + ImageEnvItemDto: + required: + - iid + - key + - type + - value + type: object + properties: + iid: + type: integer + format: int64 + key: + type: string + example: MARIADB_ROOT_PASSWORD + value: + type: string + example: mariadb + type: + type: string + example: PRIVILEGED_PASSWORD + enum: + - username + - password + - privileged_username + - privileged_password + LicenseDto: + required: + - identifier + - uri + type: object + properties: + identifier: + type: string + example: MIT + uri: + type: string + example: https://opensource.org/licenses/MIT + RelatedIdentifierDto: + required: + - created + - id + - value + type: object + properties: + id: + type: integer + format: int64 + value: + type: string + example: 10.70124/dc4zh-9ce78 + type: + type: string + example: DOI + enum: + - DOI + - URL + - URN + - ARK + - arXiv + - bibcode + - EAN13 + - EISSN + - Handle + - IGSN + - ISBN + - ISTC + - LISSN + - LSID + - PMID + - PURL + - UPC + - w3id + relation: + type: string + example: Cites + enum: + - IsCitedBy + - Cites + - IsSupplementTo + - IsSupplementedBy + - IsContinuedBy + - Continues + - IsDescribedBy + - Describes + - HasMetadata + - IsMetadataFor + - HasVersion + - IsVersionOf + - IsNewVersionOf + - IsPreviousVersionOf + - IsPartOf + - HasPart + - IsPublishedIn + - IsReferencedBy + - References + - IsDocumentedBy + - Documents + - IsCompiledBy + - Compiles + - IsVariantFormOf + - IsOriginalFormOf + - IsIdenticalTo + - IsReviewedBy + - Reviews + - IsDerivedFrom + - IsSourceOf + - IsRequiredBy + - Requires + - IsObsoletedBy + - Obsoletes + created: + type: string + format: date-time + last_modified: + type: string + format: date-time + UserDto: + required: + - email + - email_verified + - id + - roles + - theme_dark + - username + type: object + properties: + id: + type: integer + format: int64 + authorities: + type: array + items: + $ref: '#/components/schemas/GrantedAuthorityDto' + username: + type: string + description: Only contains lowercase characters + example: jcarberry + firstname: + type: string + example: Josiah + lastname: + type: string + example: Carberry + affiliation: + type: string + example: Brown University + orcid: + type: string + example: 0000-0002-1825-0097 + roles: + type: array + description: Roles of the user + example: "[ROLE_RESEARCHER]" + items: + type: string + description: Roles of the user + example: "[ROLE_RESEARCHER]" + containers: + type: array + items: + $ref: '#/components/schemas/ContainerDto' + databases: + type: array + items: + $ref: '#/components/schemas/ContainerDto' + identifiers: + type: array + items: + $ref: '#/components/schemas/ContainerDto' + email: + type: string + example: jcarberry@brown.edu + titles_before: + type: string + example: Prof. + titles_after: + type: string + theme_dark: + type: boolean + example: true + email_verified: + type: boolean + example: true securitySchemes: bearerAuth: type: http