diff --git a/Makefile b/Makefile index fc078403586caacbb21d84f6208681756a86c0f0..a22eb6efea38863cfcaa9ffc0e2875edbfc6f5f7 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ clean: release: release-docs release-dockerhub release-docs: + cd ./swagger && ./generate.sh docker compose build dbrepo-docs docker tag dbrepo-docs:latest "dbrepo/docs:${TAG}" docker push "dbrepo/docs:${TAG}" diff --git a/swagger/Dockerfile b/swagger/Dockerfile index b7d9c039d8b56bad540a29c3fb26f812041e553d..dc6a2681f54ebfb689ae2689abf1c5115ba86e98 100644 --- a/swagger/Dockerfile +++ b/swagger/Dockerfile @@ -17,19 +17,21 @@ COPY ./swagger-initializer.js ./swagger-initializer.js COPY ./docker-build.sh ./docker-build.sh RUN chmod +x ./docker-build.sh +COPY ./nginx.conf /etc/nginx/nginx.conf + WORKDIR /usr/share/nginx/html/ -# copy api COPY ./index.html ./index.html -COPY ./api-analyse.yaml ./analyse/api.yaml -COPY ./api-authentication.yaml ./authentication/api.yaml -COPY ./api-container.yaml ./container/api.yaml -COPY ./api-database.yaml ./database/api.yaml -COPY ./api-identifier.yaml ./identifier/api.yaml -COPY ./api-metadata.yaml ./metadata/api.yaml -COPY ./api-query.yaml ./query/api.yaml -COPY ./api-table.yaml ./table/api.yaml -COPY ./api-units.yaml ./units/api.yaml + +COPY ./api-analyse.yaml ./docs/analyse/api.yaml +COPY ./api-authentication.yaml ./docs/authentication/api.yaml +COPY ./api-container.yaml ./docs/container/api.yaml +COPY ./api-database.yaml ./docs/database/api.yaml +COPY ./api-identifier.yaml ./docs/identifier/api.yaml +COPY ./api-metadata.yaml ./docs/metadata/api.yaml +COPY ./api-query.yaml ./docs/query/api.yaml +COPY ./api-table.yaml ./docs/table/api.yaml +COPY ./api-units.yaml ./docs/units/api.yaml # generate RUN bash /app/docker-build.sh \ No newline at end of file diff --git a/swagger/api-analyse.yaml b/swagger/api-analyse.yaml index f25d1841e185205c1da95ee71a73df560efb41b8..71725b3d5f9890e675a6747dfad87005357ac61d 100644 --- a/swagger/api-analyse.yaml +++ b/swagger/api-analyse.yaml @@ -1,176 +1 @@ -openapi: 3.0.1 -info: - title: Database Repository Analyse Service API - description: Service that manages the analysis - contact: - name: Prof. Andreas Rauber - email: andreas.rauber@tuwien.ac.at - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0 - version: 1.1.0-alpha -externalDocs: - description: Wiki Documentation - url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/wikis -servers: -# Added by API Auto Mocking Plugin -- description: SwaggerHub API Auto Mocking - url: https://virtserver.swaggerhub.com/mweise/dbrepo-debug/1.1.0-alpha -- url: http://localhost:5000 - description: Generated server url -paths: - /api/analyse/determinedt: - post: - tags: - - analyse-endpoint - summary: Determine datatypes - description: This is a simple API which returns the datatypes of a (path) csv file - requestBody: - required: true - content: - '*/*': - schema: - $ref: '#/components/schemas/DetermineDataTypeRequestDto' - responses: - 200: - description: "OK" - content: - '*/*': - schema: - $ref: '#/components/schemas/DetermineDataTypeResponseDto' - 405: - description: "Invalid input" - content: - '*/*': - schema: - $ref: '#/components/schemas/DeterminePrimaryKeyDto' - /api/analyse/determinepk: - post: - tags: - - analyse-endpoint - summary: Determine primary keys - description: This is a simple API which returns the primary keys + ranking of a (path) csv file - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - filepath: - type: string - example : "/data/testdt08.csv" - seperator: - type: string - example: "," - responses: - 200: - description: "OK" - content: - '*/*': - schema: - $ref: '#/components/schemas/DeterminePrimaryKeyDto' - 405: - description: "Invalid input" - content: - '*/*': - schema: - $ref: '#/components/schemas/ErrorDto' - /api/analyse/update_mdb_col: - post: - tags: - - mdb-endpoint - summary: Update entity mdb_columns from metadatabase - description: Updates entity mdb_columns and mdb_columns_num, mdb_columns_nom and mdb_columns_cat in metadatabase - requestBody: - required: true - description: Updates entity mdb_columns attributes (datatype, ordinal_position, is_nullable) and automatically updates mdb_columns_nom (attribute max_length), mdb_columns_num (min, max, mean, sd, histogram) and mdb_columns_cat (num_cat, cat_array). The attribute 'histogram' describes a equi-width histogram with a fix number of 10 buckets. The last value in this numeric array is the width of one bucket. The attribute cat_array contains an array with the names of the categories. - content: - '*/*': - schema: - $ref: '#/components/schemas/UpdateColumnDto' - responses: - 200: - description: "OK" - content: - '*/*': - schema: - $ref: '#/components/schemas/UpdateColumnDto' - 405: - description: "Invalid input" - content: - '*/*': - schema: - $ref: '#/components/schemas/ErrorDto' -components: - schemas: - DetermineDataTypeRequestDto: - required: - - filepath - type: object - properties: - filepath: - type: string - example : "/data/testdt08.csv" - enum: - type: boolean - example: true - enum_tol: - example: 0.1 - separator: - type: string - example: "," - DetermineDataTypeResponseDto: - required: - - columns - - separator - type: object - properties: - columns: - type: array - items: - $ref: '#/components/schemas/DataTypeDto' - separator: - type: string - example: "," - DeterminePrimaryKeyDto: - required: - - filepath - type: "object" - properties: - filepath: - type: string - example : "/data/testdt08.csv" - seperator: - type: string - example: "," - UpdateColumnDto: - required: - - dbid - - tid - - cid - type: object - properties: - dbid: - type: integer - example: 1 - tid: - type: integer - example: 1 - cid: - type: integer - example: 1 - DataTypeDto: - type: object - example: "{\"firstname\": \"text\"}" - ErrorDto: - required: - - success - type: object - properties: - success: - type: boolean - example : false - message: - type: string - example: Reason \ No newline at end of file +{"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"}]} diff --git a/swagger/api-authentication.yaml b/swagger/api-authentication.yaml index c769a938c88493a43254635106dfe41cfa32386e..85eeb5d071670b32cebb81e3b0deef9de9338972 100644 --- a/swagger/api-authentication.yaml +++ b/swagger/api-authentication.yaml @@ -23,20 +23,20 @@ paths: summary: List users operationId: list responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -47,6 +47,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -73,20 +103,20 @@ paths: $ref: '#/components/schemas/UserForgotDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -97,6 +127,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -121,20 +181,20 @@ paths: $ref: '#/components/schemas/SignupRequestDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -145,6 +205,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -171,20 +261,20 @@ paths: type: integer format: int64 responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -195,6 +285,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -228,20 +348,20 @@ paths: $ref: '#/components/schemas/UserUpdateDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -252,6 +372,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -286,20 +436,20 @@ paths: $ref: '#/components/schemas/UserThemeSetDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -310,6 +460,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -340,20 +520,20 @@ paths: $ref: '#/components/schemas/UserRolesDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -364,6 +544,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -398,20 +608,20 @@ paths: $ref: '#/components/schemas/UserPasswordDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -422,6 +632,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -456,20 +696,20 @@ paths: $ref: '#/components/schemas/UserEmailDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -480,6 +720,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -507,20 +777,20 @@ paths: $ref: '#/components/schemas/UserResetDto' required: true responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -531,6 +801,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -543,23 +843,29 @@ paths: put: tags: - authentication-endpoint - summary: Validate token + summary: Validate authentication token operationId: authenticateUser + parameters: + - name: Authorization + in: header + required: true + schema: + type: string responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -570,6 +876,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -587,7 +923,7 @@ paths: post: tags: - authentication-endpoint - summary: Create token + summary: Create authentication token operationId: authenticateUser_1 requestBody: content: @@ -596,30 +932,209 @@ paths: $ref: '#/components/schemas/LoginRequestDto' required: true responses: + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "424": + description: Failed Dependency + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "401": + description: Unauthorized + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/JwtResponseDto' + /api/user/token: + get: + tags: + - token-endpoint + summary: Lists developer tokens for user + operationId: listAll + responses: "417": description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "424": + description: Failed Dependency + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "401": + description: Unauthorized + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "409": description: Conflict content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/TokenBriefDto' + security: + - bearerAuth: [] + post: + tags: + - token-endpoint + summary: Create developer token + operationId: create + responses: + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "424": + description: Failed Dependency + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "401": + description: Unauthorized + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "404": description: Not Found content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -631,11 +1146,13 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/JwtResponseDto' - /api/user/token/resend: + $ref: '#/components/schemas/TokenDto' + security: + - bearerAuth: [] + /api/user/secret/resend: post: tags: - - token-endpoint + - time-secret-endpoint summary: resend user token operationId: resend requestBody: @@ -645,20 +1162,174 @@ paths: $ref: '#/components/schemas/UserForgotDto' required: true responses: + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "424": + description: Failed Dependency + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "401": + description: Unauthorized + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "400": description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: object + /api/auth/renew: + post: + tags: + - authentication-endpoint + summary: Renew authentication token + operationId: reAuthenticateUser + responses: + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "424": + description: Failed Dependency + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "401": + description: Unauthorized + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' + "403": + description: Forbidden + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/JwtResponseDto' + security: + - bearerAuth: [] + /api/user/secret: + get: + tags: + - time-secret-endpoint + summary: verify user email + operationId: verifyEmail + parameters: + - name: token + in: query + required: true + schema: + type: string + responses: + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -669,45 +1340,32 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "403": - description: Forbidden + "409": + description: Conflict content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "200": - description: OK - content: - '*/*': - schema: - type: object - /api/auth/renew: - post: - tags: - - authentication-endpoint - summary: Renew token - operationId: reAuthenticateUser - responses: - "400": - description: Bad Request + "418": + description: I'm a teapot content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "428": + description: Precondition Required content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "400": + description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "406": + description: Not Acceptable content: '*/*': schema: @@ -720,39 +1378,33 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK - content: - '*/*': - schema: - $ref: '#/components/schemas/JwtResponseDto' - security: - - bearerAuth: [] - /api/user/token: - get: + /api/user/token/{hash}: + delete: tags: - token-endpoint - summary: verify user email - operationId: verifyEmail + summary: Delete developer token + operationId: delete parameters: - - name: token - in: query + - name: hash + in: path required: true schema: type: string responses: - "400": - description: Bad Request + "417": + description: Expectation Failed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "417": - description: Expectation Failed + "424": + description: Failed Dependency content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "401": + description: Unauthorized content: '*/*': schema: @@ -763,6 +1415,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "418": + description: I'm a teapot + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "428": + description: Precondition Required + 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' "403": description: Forbidden content: @@ -771,6 +1453,8 @@ paths: $ref: '#/components/schemas/ApiErrorDto' "200": description: OK + security: + - bearerAuth: [] components: schemas: ApiErrorDto: @@ -913,6 +1597,31 @@ components: example: air-quality ip_address: type: string + CreatorDto: + required: + - created + - id + - name + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: "Carberry, Josiah" + affiliation: + type: string + example: Wesleyan University + orcid: + type: string + example: 0000-0002-1825-0097 + created: + type: string + format: date-time + last_modified: + type: string + format: date-time DatabaseDto: required: - creator @@ -933,13 +1642,93 @@ components: example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' - subjects: + identifier: + $ref: '#/components/schemas/IdentifierDto' + description: + type: string + example: Weather Australia 2009-2021 + tables: type: array items: - type: string + $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 + - 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 + creator: + $ref: '#/components/schemas/UserDto' language: type: string - example: EN enum: - ab - aa @@ -1127,47 +1916,57 @@ components: - zu license: $ref: '#/components/schemas/LicenseDto' - description: - type: string - example: Weather Australia 2009-2021 - publisher: - type: string - example: TU Wien - tables: + creators: type: array items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' + $ref: '#/components/schemas/CreatorDto' created: type: string format: date-time - deleted: + 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 - format: date-time - internal_name: + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + related: + type: array + items: + $ref: '#/components/schemas/RelatedIdentifierDto' + query_hash: type: string - example: weather_australia - publication_year: + 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 - publication_day: + example: 12 + publication_year: type: integer format: int32 - is_public: - type: boolean - example: true - GrantedAuthorityDto: - type: object - properties: - authority: + example: 2022 + last_modified: type: string - example: ROLE_RESEARCHER + format: date-time ImageBriefDto: required: - id @@ -1300,7 +2099,88 @@ components: uri: type: string example: https://opensource.org/licenses/MIT - example: MIT2 + 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 + deleted: + type: string + format: date-time + last_modified: + type: string + format: date-time TableBriefDto: required: - creator @@ -1494,6 +2374,36 @@ components: example: user@example.com password: type: string + TokenDto: + required: + - created + - expires + - id + - token + - token_hash + type: object + properties: + id: + type: integer + format: int64 + created: + type: string + format: date-time + expires: + type: string + format: date-time + deleted: + type: string + format: date-time + token: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + token_hash: + type: string + example: 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 + last_used: + type: string + format: date-time LoginRequestDto: required: - password @@ -1527,6 +2437,32 @@ components: type: array items: type: string + TokenBriefDto: + required: + - created + - expires + - id + - token_hash + type: object + properties: + id: + type: integer + format: int64 + created: + type: string + format: date-time + expires: + type: string + format: date-time + deleted: + type: string + format: date-time + token_hash: + type: string + example: 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 + last_used: + type: string + format: date-time securitySchemes: bearerAuth: type: http diff --git a/swagger/api-container.yaml b/swagger/api-container.yaml index 52e13aaec167f4136d5c7d0d8fbbdef36648075d..6ab5dce17180f908e7706825f0829a6652e4ef76 100644 --- a/swagger/api-container.yaml +++ b/swagger/api-container.yaml @@ -30,8 +30,8 @@ paths: type: integer format: int64 responses: - "400": - description: Bad Request + "404": + description: Image not found content: '*/*': schema: @@ -42,8 +42,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Image not found + "400": + description: Bad Request content: '*/*': schema: @@ -85,8 +85,8 @@ paths: $ref: '#/components/schemas/ImageChangeDto' required: true responses: - "400": - description: Bad Request + "404": + description: Image not found content: '*/*': schema: @@ -97,8 +97,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Image not found + "400": + description: Bad Request content: '*/*': schema: @@ -136,8 +136,8 @@ paths: type: integer format: int64 responses: - "400": - description: Bad Request + "404": + description: Image not found content: '*/*': schema: @@ -148,8 +148,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Image not found + "400": + description: Bad Request content: '*/*': schema: @@ -188,8 +188,8 @@ paths: type: integer format: int64 responses: - "400": - description: Bad Request + "404": + description: Not Found content: '*/*': schema: @@ -200,8 +200,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: @@ -243,8 +243,8 @@ paths: $ref: '#/components/schemas/ContainerChangeDto' required: true responses: - "400": - description: Bad Request + "404": + description: Not Found content: '*/*': schema: @@ -255,8 +255,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: @@ -294,8 +294,8 @@ paths: type: integer format: int64 responses: - "400": - description: Bad Request + "404": + description: Not Found content: '*/*': schema: @@ -306,8 +306,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: @@ -339,8 +339,8 @@ paths: summary: Find all images operationId: findAll responses: - "400": - description: Bad Request + "404": + description: Not Found content: '*/*': schema: @@ -351,8 +351,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: @@ -389,8 +389,8 @@ paths: $ref: '#/components/schemas/ImageCreateDto' required: true responses: - "400": - description: Bad Request + "404": + description: Image not found content: '*/*': schema: @@ -401,8 +401,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Image not found + "400": + description: Bad Request content: '*/*': schema: @@ -434,8 +434,8 @@ paths: summary: Find all containers operationId: findAll_1 responses: - "400": - description: Bad Request + "404": + description: Not Found content: '*/*': schema: @@ -446,8 +446,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: @@ -484,8 +484,8 @@ paths: $ref: '#/components/schemas/ContainerCreateRequestDto' required: true responses: - "400": - description: Bad Request + "404": + description: Not Found content: '*/*': schema: @@ -496,8 +496,8 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: @@ -918,6 +918,31 @@ components: example: air-quality ip_address: type: string + CreatorDto: + required: + - created + - id + - name + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: "Carberry, Josiah" + affiliation: + type: string + example: Wesleyan University + orcid: + type: string + example: 0000-0002-1825-0097 + created: + type: string + format: date-time + last_modified: + type: string + format: date-time DatabaseDto: required: - creator @@ -938,13 +963,93 @@ components: example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' - subjects: + identifier: + $ref: '#/components/schemas/IdentifierDto' + description: + type: string + example: Weather Australia 2009-2021 + tables: type: array items: - type: string + $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 + - 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 + creator: + $ref: '#/components/schemas/UserDto' language: type: string - example: EN enum: - ab - aa @@ -1132,41 +1237,57 @@ components: - zu license: $ref: '#/components/schemas/LicenseDto' - description: - type: string - example: Weather Australia 2009-2021 - publisher: - type: string - example: TU Wien - tables: + creators: type: array items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' + $ref: '#/components/schemas/CreatorDto' created: type: string format: date-time - deleted: + 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 - format: date-time - internal_name: + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + related: + type: array + items: + $ref: '#/components/schemas/RelatedIdentifierDto' + query_hash: type: string - example: weather_australia - publication_year: + 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 - publication_day: + example: 12 + publication_year: type: integer format: int32 - is_public: - type: boolean - example: true + example: 2022 + last_modified: + type: string + format: date-time LicenseDto: required: - identifier @@ -1179,7 +1300,88 @@ components: uri: type: string example: https://opensource.org/licenses/MIT - example: MIT2 + 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 + deleted: + type: string + format: date-time + last_modified: + type: string + format: date-time TableBriefDto: required: - creator @@ -1199,6 +1401,64 @@ components: internal_name: type: string example: air_quality + UserDto: + required: + - email + - email_verified + - id + - 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 + 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-database.yaml b/swagger/api-database.yaml index a128f4ba4a96568ce5c264e8b559464f29d35eee..e22dc884054fceb7dff912cf1d9a05693a7aeaa6 100644 --- a/swagger/api-database.yaml +++ b/swagger/api-database.yaml @@ -16,12 +16,12 @@ servers: - url: http://localhost:9092 description: Generated server url paths: - /api/container/{id}/database/{databaseId}: - get: + /api/container/{id}/database/{databaseId}/transfer: + put: tags: - database-endpoint - summary: Find some database - operationId: findById + summary: Update database + operationId: transfer parameters: - name: id in: path @@ -35,6 +35,12 @@ paths: schema: type: integer format: int64 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseTransferDto' + required: true responses: "404": description: Not Found @@ -60,14 +66,20 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "417": + description: Expectation Failed content: '*/*': schema: @@ -80,11 +92,12 @@ paths: $ref: '#/components/schemas/DatabaseDto' security: - bearerAuth: [] - put: + /api/container/{id}/database: + get: tags: - database-endpoint - summary: Update database - operationId: update + summary: List databases + operationId: list parameters: - name: id in: path @@ -92,18 +105,6 @@ paths: schema: type: integer format: int64 - - name: databaseId - in: path - required: true - schema: - type: integer - format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseModifyDto' - required: true responses: "404": description: Not Found @@ -129,14 +130,20 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "417": + description: Expectation Failed content: '*/*': schema: @@ -146,14 +153,14 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/DatabaseDto' - security: - - bearerAuth: [] - delete: + type: array + items: + $ref: '#/components/schemas/DatabaseBriefDto' + post: tags: - database-endpoint - summary: Delete some database - operationId: delete_1 + summary: Create database + operationId: create parameters: - name: id in: path @@ -161,12 +168,12 @@ paths: schema: type: integer format: int64 - - name: databaseId - in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DatabaseCreateDto' required: true - schema: - type: integer - format: int64 responses: "404": description: Not Found @@ -192,14 +199,20 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "417": + description: Expectation Failed content: '*/*': schema: @@ -209,15 +222,15 @@ paths: content: '*/*': schema: - type: object + $ref: '#/components/schemas/DatabaseBriefDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/transfer: - put: + /api/container/{id}/database/{databaseId}: + get: tags: - database-endpoint - summary: Update database - operationId: transfer + summary: Find some database + operationId: findById parameters: - name: id in: path @@ -231,12 +244,6 @@ paths: schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseTransferDto' - required: true responses: "404": description: Not Found @@ -262,14 +269,20 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "417": + description: Expectation Failed content: '*/*': schema: @@ -282,12 +295,11 @@ paths: $ref: '#/components/schemas/DatabaseDto' security: - bearerAuth: [] - /api/container/{id}/database: - get: + delete: tags: - database-endpoint - summary: List databases - operationId: findAll + summary: Delete some database + operationId: delete parameters: - name: id in: path @@ -295,6 +307,12 @@ paths: schema: type: integer format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 responses: "404": description: Not Found @@ -320,77 +338,20 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "502": - description: Bad Gateway - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' "405": description: Method Not Allowed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "200": - description: OK - content: - '*/*': - schema: - type: array - items: - $ref: '#/components/schemas/DatabaseBriefDto' - post: - tags: - - database-endpoint - summary: Create database - operationId: create - parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DatabaseCreateDto' - 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' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "417": + description: Expectation Failed content: '*/*': schema: @@ -400,7 +361,7 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/DatabaseBriefDto' + type: object security: - bearerAuth: [] /api/container/{id}/database/license: @@ -408,7 +369,7 @@ paths: tags: - license-endpoint summary: Get all licenses - operationId: delete + operationId: list_1 parameters: - name: id in: path @@ -441,14 +402,20 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "405": + description: Method Not Allowed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "502": description: Bad Gateway content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "417": + description: Expectation Failed content: '*/*': schema: @@ -518,275 +485,44 @@ components: - 416 REQUESTED_RANGE_NOT_SATISFIABLE - 417 EXPECTATION_FAILED - 418 I_AM_A_TEAPOT - - 419 INSUFFICIENT_SPACE_ON_RESOURCE - - 420 METHOD_FAILURE - - 421 DESTINATION_LOCKED - - 422 UNPROCESSABLE_ENTITY - - 423 LOCKED - - 424 FAILED_DEPENDENCY - - 425 TOO_EARLY - - 426 UPGRADE_REQUIRED - - 428 PRECONDITION_REQUIRED - - 429 TOO_MANY_REQUESTS - - 431 REQUEST_HEADER_FIELDS_TOO_LARGE - - 451 UNAVAILABLE_FOR_LEGAL_REASONS - - 500 INTERNAL_SERVER_ERROR - - 501 NOT_IMPLEMENTED - - 502 BAD_GATEWAY - - 503 SERVICE_UNAVAILABLE - - 504 GATEWAY_TIMEOUT - - 505 HTTP_VERSION_NOT_SUPPORTED - - 506 VARIANT_ALSO_NEGOTIATES - - 507 INSUFFICIENT_STORAGE - - 508 LOOP_DETECTED - - 509 BANDWIDTH_LIMIT_EXCEEDED - - 510 NOT_EXTENDED - - 511 NETWORK_AUTHENTICATION_REQUIRED - message: - type: string - example: Could not find container - code: - type: string - example: error.container.notfound - DatabaseModifyDto: - required: - - publication_year - - publisher - type: object - properties: - subjects: - type: array - items: - type: string - description: - type: string - example: Sample - publisher: - type: string - example: TU Wien - license: - $ref: '#/components/schemas/LicenseDto' - language: - type: string - example: en - 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 - publication_year: - type: integer - description: database publication year - format: int32 - example: 2022 - publication_month: - maximum: 12 - minimum: 1 - type: integer - description: database publication month - format: int32 - example: 12 - publication_day: - maximum: 31 - minimum: 1 - type: integer - description: database publication day - format: int32 - example: 15 - contact_person: + - 419 INSUFFICIENT_SPACE_ON_RESOURCE + - 420 METHOD_FAILURE + - 421 DESTINATION_LOCKED + - 422 UNPROCESSABLE_ENTITY + - 423 LOCKED + - 424 FAILED_DEPENDENCY + - 425 TOO_EARLY + - 426 UPGRADE_REQUIRED + - 428 PRECONDITION_REQUIRED + - 429 TOO_MANY_REQUESTS + - 431 REQUEST_HEADER_FIELDS_TOO_LARGE + - 451 UNAVAILABLE_FOR_LEGAL_REASONS + - 500 INTERNAL_SERVER_ERROR + - 501 NOT_IMPLEMENTED + - 502 BAD_GATEWAY + - 503 SERVICE_UNAVAILABLE + - 504 GATEWAY_TIMEOUT + - 505 HTTP_VERSION_NOT_SUPPORTED + - 506 VARIANT_ALSO_NEGOTIATES + - 507 INSUFFICIENT_STORAGE + - 508 LOOP_DETECTED + - 509 BANDWIDTH_LIMIT_EXCEEDED + - 510 NOT_EXTENDED + - 511 NETWORK_AUTHENTICATION_REQUIRED + message: type: string - LicenseDto: + example: Could not find container + code: + type: string + example: error.container.notfound + DatabaseTransferDto: required: - - identifier - - uri + - is_public type: object properties: - identifier: - type: string - example: MIT - uri: - type: string - example: https://opensource.org/licenses/MIT + is_public: + type: boolean + example: true ContainerDto: required: - created @@ -833,6 +569,31 @@ components: example: air-quality ip_address: type: string + CreatorDto: + required: + - created + - id + - name + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: "Carberry, Josiah" + affiliation: + type: string + example: Wesleyan University + orcid: + type: string + example: 0000-0002-1825-0097 + created: + type: string + format: date-time + last_modified: + type: string + format: date-time DatabaseDto: required: - creator @@ -853,13 +614,93 @@ components: example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' - subjects: + identifier: + $ref: '#/components/schemas/IdentifierDto' + description: + type: string + example: Weather Australia 2009-2021 + tables: type: array items: - type: string + $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 + - 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 + creator: + $ref: '#/components/schemas/UserDto' language: type: string - example: EN enum: - ab - aa @@ -1047,41 +888,57 @@ components: - zu license: $ref: '#/components/schemas/LicenseDto' - description: - type: string - example: Weather Australia 2009-2021 - publisher: - type: string - example: TU Wien - tables: + creators: type: array items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' + $ref: '#/components/schemas/CreatorDto' created: type: string format: date-time - deleted: + 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 - format: date-time - internal_name: + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + related: + type: array + items: + $ref: '#/components/schemas/RelatedIdentifierDto' + query_hash: type: string - example: weather_australia - publication_year: + 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 - publication_day: + example: 12 + publication_year: type: integer format: int32 - is_public: - type: boolean - example: true + example: 2022 + last_modified: + type: string + format: date-time ImageBriefDto: required: - id @@ -1202,6 +1059,100 @@ components: - 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 + deleted: + type: string + format: date-time + last_modified: + type: string + format: date-time TableBriefDto: required: - creator @@ -1259,12 +1210,62 @@ components: email_verified: type: boolean example: true - DatabaseTransferDto: + UserDto: required: - - is_public + - email + - email_verified + - id + - theme_dark + - username type: object properties: - is_public: + 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 DatabaseCreateDto: @@ -1319,6 +1320,8 @@ components: description: type: string example: Air Quality in Austria + identifier: + $ref: '#/components/schemas/IdentifierBriefDto' engine: type: string example: mariadb:10.5 @@ -1332,6 +1335,43 @@ components: is_public: type: boolean example: true + IdentifierBriefDto: + required: + - container id + - database id + - title + - type + type: object + properties: + id: + type: integer + format: int64 + title: + 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 securitySchemes: bearerAuth: type: http diff --git a/swagger/api-identifier.yaml b/swagger/api-identifier.yaml index b6c33e384eb12961e19f3870556bacfb657f81fe..120e774b525f97f349e563b828bb73b73a14c1f8 100644 --- a/swagger/api-identifier.yaml +++ b/swagger/api-identifier.yaml @@ -16,12 +16,12 @@ servers: - url: http://localhost:9096 description: Generated server url paths: - /api/container/{id}/database/{databaseId}/identifier/{identiferId}: - put: + /api/identifier/{id}: + get: tags: - identifier-endpoint - summary: Update some identifier - operationId: update + summary: Export some identifier metadata + operationId: export parameters: - name: id in: path @@ -29,13 +29,57 @@ paths: schema: type: integer format: int64 - - name: databaseId - in: path - required: true - schema: - type: integer - format: int64 - - name: identiferId + 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 + summary: Update some identifier + operationId: update + parameters: + - name: id in: query required: true schema: @@ -48,26 +92,26 @@ paths: $ref: '#/components/schemas/IdentifierDto' required: true responses: - "406": - description: Not Acceptable + "404": + description: Not Found content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content + "406": + description: Not Acceptable content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed + "204": + description: No Content content: '*/*': schema: @@ -78,6 +122,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "412": + description: Precondition Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -93,44 +143,32 @@ paths: operationId: delete parameters: - name: id - in: path - required: true - schema: - type: integer - format: int64 - - name: databaseId - in: path - required: true - schema: - type: integer - format: int64 - - name: identiferId in: query required: true schema: type: integer format: int64 responses: - "406": - description: Not Acceptable + "404": + description: Not Found content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content + "406": + description: Not Acceptable content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed + "204": + description: No Content content: '*/*': schema: @@ -141,6 +179,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "412": + description: Precondition Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -149,22 +193,16 @@ paths: type: object security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/identifier: + /api/identifier: get: tags: - identifier-endpoint summary: Find identifiers - operationId: findAll + operationId: list parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 - - name: databaseId - in: path - required: true + - name: dbid + in: query + required: false schema: type: integer format: int64 @@ -175,26 +213,26 @@ paths: type: integer format: int64 responses: - "406": - description: Not Acceptable + "404": + description: Not Found content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content + "406": + description: Not Acceptable content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed + "204": + description: No Content content: '*/*': schema: @@ -205,6 +243,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "412": + description: Precondition Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -219,18 +263,6 @@ paths: summary: Create identifier 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 - name: Authorization in: header required: true @@ -243,26 +275,26 @@ paths: $ref: '#/components/schemas/IdentifierCreateDto' required: true responses: - "406": - description: Not Acceptable + "404": + description: Not Found content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found + "400": + description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content + "406": + description: Not Acceptable content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed + "204": + description: No Content content: '*/*': schema: @@ -273,6 +305,12 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "412": + description: Precondition Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -294,95 +332,44 @@ paths: schema: type: integer format: int64 + - name: Accept + in: header + required: true + schema: + type: string responses: - "406": - description: Not Acceptable - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' "404": description: Not Found content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "204": - description: No Content - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "400": + description: Bad Request content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "200": - description: OK - content: - '*/*': - schema: - $ref: '#/components/schemas/IdentifierDto' - /api/container/{id}/database/{databaseId}/identifier/{identifierId}: - get: - tags: - - identifier-endpoint - summary: Export some identifier metadata - operationId: export - parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 - - name: databaseId - in: path - required: true - schema: - type: integer - format: int64 - - name: identifierId - in: path - required: true - schema: - type: integer - format: int64 - responses: "406": description: Not Acceptable content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "404": - description: Not Found - content: - '*/*': - schema: - $ref: '#/components/schemas/ApiErrorDto' "204": description: No Content content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "412": - description: Precondition Failed + "409": + description: Conflict content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "412": + description: Precondition Failed content: '*/*': schema: @@ -392,8 +379,7 @@ paths: content: '*/*': schema: - type: string - format: binary + type: object components: schemas: ApiErrorDto: @@ -572,16 +558,96 @@ components: example: air_quality creator: $ref: '#/components/schemas/UserBriefDto' - subjects: + identifier: + $ref: '#/components/schemas/IdentifierDto' + description: + type: string + example: Weather Australia 2009-2021 + tables: type: array items: - type: string - language: + $ref: '#/components/schemas/TableBriefDto' + image: + $ref: '#/components/schemas/ImageDto' + container: + $ref: '#/components/schemas/ContainerDto' + created: type: string - example: EN - enum: - - ab - - aa + 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 + - 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 + creator: + $ref: '#/components/schemas/UserDto' + language: + type: string + enum: + - ab + - aa - af - ak - sq @@ -766,113 +832,25 @@ components: - zu license: $ref: '#/components/schemas/LicenseDto' - description: - type: string - example: Weather Australia 2009-2021 - publisher: - type: string - example: TU Wien - tables: + creators: type: array items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' + $ref: '#/components/schemas/CreatorDto' created: type: string format: date-time - deleted: - type: string - format: date-time - internal_name: - type: string - example: weather_australia - publication_year: - type: integer - format: int32 - publication_month: - type: integer - format: int32 - publication_day: - type: integer - format: int32 - is_public: - type: boolean - example: true - GrantedAuthorityDto: - type: object - properties: - authority: - type: string - example: ROLE_RESEARCHER - IdentifierDto: - required: - - cid - - creator - - creators - - dbid - - description - - execution - - publication_year - - qid - - query - - query_hash - - query_normalized - - result_hash - - result_number - - title - - visibility - type: object - properties: - id: + container id: type: integer format: int64 - cid: - type: integer - format: int64 - dbid: + example: 1 + database id: type: integer format: int64 - qid: + example: 1 + query id: type: integer format: int64 - 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 - creator: - $ref: '#/components/schemas/UserDto' - creators: - type: array - items: - $ref: '#/components/schemas/CreatorDto' - created: - type: string - format: date-time + example: 1 query_normalized: type: string example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ @@ -1037,7 +1015,6 @@ components: uri: type: string example: https://opensource.org/licenses/MIT - example: MIT2 RelatedIdentifierDto: required: - created @@ -1251,17 +1228,29 @@ components: example: 0000-0002-1825-0097 IdentifierCreateDto: required: + - cid - creators - - description + - dbid - publication_year - - qid - title + - type - visibility type: object properties: + cid: + type: integer + format: int64 + dbid: + type: integer + format: int64 qid: type: integer format: int64 + type: + type: string + enum: + - database + - subset title: type: string example: "Airquality Stephansplatz, Vienna, Austria" @@ -1281,6 +1270,195 @@ components: 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: diff --git a/swagger/api-metadata.yaml b/swagger/api-metadata.yaml index f58d3223d2a1756f06e5e588d56501581efbabbb..abdbf5ba05ae33bbeefc71336137f737460b60c7 100644 --- a/swagger/api-metadata.yaml +++ b/swagger/api-metadata.yaml @@ -13,7 +13,7 @@ externalDocs: description: Wiki Documentation url: https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/wikis servers: -- url: http://localhost:9098 +- url: http://localhost:9099 description: Generated server url paths: /api/oai: @@ -24,16 +24,25 @@ paths: operationId: identify_1_1_1_1 parameters: - name: verb - in: query - required: true - schema: - type: string + example: ListMetadataFormats - name: parameters in: query required: true schema: $ref: '#/components/schemas/OaiListIdentifiersParameters' responses: + "404": + description: Not Found + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -42,6 +51,91 @@ paths: type: object components: schemas: + ApiErrorDto: + required: + - code + - message + - status + type: object + properties: + status: + type: string + example: NOT_FOUND + enum: + - 100 CONTINUE + - 101 SWITCHING_PROTOCOLS + - 102 PROCESSING + - 103 CHECKPOINT + - 200 OK + - 201 CREATED + - 202 ACCEPTED + - 203 NON_AUTHORITATIVE_INFORMATION + - 204 NO_CONTENT + - 205 RESET_CONTENT + - 206 PARTIAL_CONTENT + - 207 MULTI_STATUS + - 208 ALREADY_REPORTED + - 226 IM_USED + - 300 MULTIPLE_CHOICES + - 301 MOVED_PERMANENTLY + - 302 FOUND + - 302 MOVED_TEMPORARILY + - 303 SEE_OTHER + - 304 NOT_MODIFIED + - 305 USE_PROXY + - 307 TEMPORARY_REDIRECT + - 308 PERMANENT_REDIRECT + - 400 BAD_REQUEST + - 401 UNAUTHORIZED + - 402 PAYMENT_REQUIRED + - 403 FORBIDDEN + - 404 NOT_FOUND + - 405 METHOD_NOT_ALLOWED + - 406 NOT_ACCEPTABLE + - 407 PROXY_AUTHENTICATION_REQUIRED + - 408 REQUEST_TIMEOUT + - 409 CONFLICT + - 410 GONE + - 411 LENGTH_REQUIRED + - 412 PRECONDITION_FAILED + - 413 PAYLOAD_TOO_LARGE + - 413 REQUEST_ENTITY_TOO_LARGE + - 414 URI_TOO_LONG + - 414 REQUEST_URI_TOO_LONG + - 415 UNSUPPORTED_MEDIA_TYPE + - 416 REQUESTED_RANGE_NOT_SATISFIABLE + - 417 EXPECTATION_FAILED + - 418 I_AM_A_TEAPOT + - 419 INSUFFICIENT_SPACE_ON_RESOURCE + - 420 METHOD_FAILURE + - 421 DESTINATION_LOCKED + - 422 UNPROCESSABLE_ENTITY + - 423 LOCKED + - 424 FAILED_DEPENDENCY + - 425 TOO_EARLY + - 426 UPGRADE_REQUIRED + - 428 PRECONDITION_REQUIRED + - 429 TOO_MANY_REQUESTS + - 431 REQUEST_HEADER_FIELDS_TOO_LARGE + - 451 UNAVAILABLE_FOR_LEGAL_REASONS + - 500 INTERNAL_SERVER_ERROR + - 501 NOT_IMPLEMENTED + - 502 BAD_GATEWAY + - 503 SERVICE_UNAVAILABLE + - 504 GATEWAY_TIMEOUT + - 505 HTTP_VERSION_NOT_SUPPORTED + - 506 VARIANT_ALSO_NEGOTIATES + - 507 INSUFFICIENT_STORAGE + - 508 LOOP_DETECTED + - 509 BANDWIDTH_LIMIT_EXCEEDED + - 510 NOT_EXTENDED + - 511 NETWORK_AUTHENTICATION_REQUIRED + message: + type: string + example: Could not find container + code: + type: string + example: error.container.notfound OaiListIdentifiersParameters: type: object properties: @@ -55,11 +149,11 @@ components: type: string resumptionToken: type: string - parametersString: - type: string fromDate: type: string format: date-time + parametersString: + type: string untilDate: type: string format: date-time diff --git a/swagger/api-query.yaml b/swagger/api-query.yaml index 10fd0f5f140b51fc570f6d4c03e8df4e35efc14b..7772e6ecbeafdfb8579d993e86e6a8d527e46c0d 100644 --- a/swagger/api-query.yaml +++ b/swagger/api-query.yaml @@ -21,7 +21,7 @@ paths: tags: - table-history-endpoint summary: Find all history - operationId: getAll_1 + operationId: getAll parameters: - name: id in: path @@ -42,8 +42,8 @@ paths: type: integer format: int64 responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -54,14 +54,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -72,6 +72,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -86,7 +98,7 @@ paths: tags: - table-history-endpoint summary: Find all history - operationId: getAll + operationId: getAll_1 parameters: - name: id in: path @@ -107,8 +119,8 @@ paths: type: integer format: int64 responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -119,14 +131,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -137,6 +149,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -152,7 +176,7 @@ paths: tags: - table-data-endpoint summary: Find data - operationId: getAll_3 + operationId: getAll_2 parameters: - name: id in: path @@ -190,9 +214,22 @@ paths: 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 responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -203,14 +240,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -221,6 +258,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -260,8 +309,8 @@ paths: $ref: '#/components/schemas/TableCsvUpdateDto' required: true responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -272,14 +321,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -290,6 +339,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK security: @@ -325,8 +386,8 @@ paths: $ref: '#/components/schemas/TableCsvDto' required: true responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -337,14 +398,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -355,6 +416,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK security: @@ -363,7 +436,7 @@ paths: tags: - table-data-endpoint summary: Delete data - operationId: delete + operationId: delete_1 parameters: - name: id in: path @@ -390,8 +463,8 @@ paths: $ref: '#/components/schemas/TableCsvDeleteDto' required: true responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -402,14 +475,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -420,6 +493,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK security: @@ -428,7 +513,7 @@ paths: tags: - table-data-endpoint summary: Find data - operationId: getAll_2 + operationId: getAll_3 parameters: - name: id in: path @@ -466,9 +551,22 @@ paths: 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 responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -479,14 +577,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -497,6 +595,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -510,7 +620,7 @@ paths: tags: - store-endpoint summary: Find queries - operationId: findAll + operationId: findAll_2 parameters: - name: id in: path @@ -524,9 +634,14 @@ paths: schema: type: integer format: int64 + - name: persisted + in: query + required: false + schema: + type: boolean responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -537,14 +652,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -555,6 +670,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -595,6 +722,19 @@ paths: 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: @@ -602,8 +742,8 @@ paths: $ref: '#/components/schemas/ExecuteStatementDto' required: true responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -614,14 +754,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -632,6 +772,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -640,12 +792,12 @@ paths: $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: - post: + /api/container/{id}/database/{databaseId}/query/{queryId}: + get: tags: - - table-data-endpoint - summary: Insert data from csv - operationId: importCsv + - store-endpoint + summary: Find some query + operationId: find parameters: - name: id in: path @@ -659,21 +811,15 @@ paths: schema: type: integer format: int64 - - name: tableId + - name: queryId in: path required: true schema: type: integer format: int64 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ImportDto' - required: true responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -684,14 +830,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -702,16 +848,483 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "200": - description: OK - security: - - bearerAuth: [] - /api/container/{id}/database/{databaseId}/table/{tableId}/export: + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/QueryDto' + security: + - bearerAuth: [] + put: + tags: + - store-endpoint + summary: Persist some query + operationId: persist + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + - name: queryId + in: path + required: true + schema: + type: integer + format: int64 + responses: + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Locked + 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' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/QueryDto' + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/view: + get: + tags: + - view-endpoint + summary: Find all views + operationId: findAll + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + responses: + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Locked + 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' + "417": + description: Expectation Failed + 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/ViewBriefDto' + security: + - bearerAuth: [] + post: + tags: + - view-endpoint + summary: Create a view + 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/ViewCreateDto' + required: true + responses: + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Locked + 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' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/ViewBriefDto' + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/table/{tableId}/data/import: + post: + tags: + - table-data-endpoint + summary: Insert data from csv + operationId: importCsv + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + 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 + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Locked + 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' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/view/{viewId}: + get: + tags: + - view-endpoint + summary: Find one view + operationId: findAll_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: viewId + in: path + required: true + schema: + type: integer + format: int64 + responses: + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Locked + 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' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + $ref: '#/components/schemas/ViewDto' + security: + - bearerAuth: [] + delete: + tags: + - view-endpoint + summary: Delete one view + operationId: delete + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: databaseId + in: path + required: true + schema: + type: integer + format: int64 + - name: viewId + in: path + required: true + schema: + type: integer + format: int64 + responses: + "409": + description: Conflict + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "400": + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "423": + description: Locked + 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' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "200": + description: OK + content: + '*/*': + schema: + type: object + security: + - bearerAuth: [] + /api/container/{id}/database/{databaseId}/view/{viewId}/data: get: tags: - - export-endpoint - summary: Export table - operationId: export + - view-endpoint + summary: Find view data + operationId: data parameters: - name: id in: path @@ -725,21 +1338,27 @@ paths: schema: type: integer format: int64 - - name: tableId + - name: viewId in: path required: true schema: type: integer format: int64 - - name: timestamp + - name: page in: query required: false schema: - type: string - format: date-time + type: integer + format: int64 + - name: size + in: query + required: false + schema: + type: integer + format: int64 responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -750,14 +1369,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -768,21 +1387,32 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - type: string - format: binary + $ref: '#/components/schemas/QueryResultDto' security: - bearerAuth: [] - /api/container/{id}/database/{databaseId}/query/{queryId}: + /api/container/{id}/database/{databaseId}/table/{tableId}/export: get: tags: - - store-endpoint - summary: Find some query - operationId: find + - export-endpoint + summary: Export table + operationId: export parameters: - name: id in: path @@ -796,15 +1426,21 @@ paths: schema: type: integer format: int64 - - name: queryId + - name: tableId in: path required: true schema: type: integer format: int64 + - name: timestamp + in: query + required: false + schema: + type: string + format: date-time responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -815,14 +1451,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -833,12 +1469,25 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - $ref: '#/components/schemas/QueryDto' + type: string + format: binary security: - bearerAuth: [] /api/container/{id}/database/{databaseId}/query/{queryId}/export: @@ -866,9 +1515,14 @@ paths: schema: type: integer format: int64 + - name: download + in: query + required: false + schema: + type: string responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -879,14 +1533,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -897,13 +1551,24 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: '*/*': schema: - type: string - format: binary + type: object security: - bearerAuth: [] /api/container/{id}/database/{databaseId}/query/{queryId}/data: @@ -943,9 +1608,22 @@ paths: 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 responses: - "404": - description: Not Found + "409": + description: Conflict content: '*/*': schema: @@ -956,14 +1634,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "409": - description: Conflict + "423": + description: Locked content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "423": - description: Locked + "404": + description: Not Found content: '*/*': schema: @@ -974,6 +1652,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' + "417": + description: Expectation Failed + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' + "406": + description: Not Acceptable + content: + '*/*': + schema: + $ref: '#/components/schemas/ApiErrorDto' "200": description: OK content: @@ -1126,41 +1816,6 @@ components: statement: type: string example: SELECT `id` FROM `air_quality` - TableCsvDto: - required: - - data - type: object - properties: - data: - type: object - additionalProperties: - type: object - ImportDto: - required: - - location - - separator - type: object - properties: - location: - type: string - example: /tmp/file.csv - separator: - type: string - example: "," - quote: - type: string - example: '"' - skip_lines: - minimum: 0 - type: integer - format: int64 - false_element: - type: string - true_element: - type: string - null_element: - type: string - example: NA ContainerDto: required: - created @@ -1194,46 +1849,151 @@ components: items: $ref: '#/components/schemas/DatabaseDto' image: - $ref: '#/components/schemas/ImageBriefDto' - port: - type: integer - format: int32 + $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 + - id + - name + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + example: "Carberry, Josiah" + affiliation: + type: string + example: Wesleyan University + orcid: + type: string + example: 0000-0002-1825-0097 + created: + type: string + format: date-time + last_modified: + 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 - example: 2021-03-12T15:26:21.678396092Z + deleted: + type: string + format: date-time internal_name: type: string - example: air-quality - ip_address: + example: weather_australia + is_public: + type: boolean + example: true + GrantedAuthorityDto: + type: object + properties: + authority: type: string - DatabaseDto: + example: ROLE_RESEARCHER + IdentifierDto: required: + - container id - creator - - exchange - - id - - internal_name - - name + - 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 - name: + type: type: string - example: Air Quality - exchange: + enum: + - database + - subset + title: type: string - example: air_quality + 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 creator: - $ref: '#/components/schemas/UserBriefDto' - subjects: - type: array - items: - type: string + $ref: '#/components/schemas/UserDto' language: type: string - example: EN enum: - ab - aa @@ -1421,47 +2181,57 @@ components: - zu license: $ref: '#/components/schemas/LicenseDto' - description: - type: string - example: Weather Australia 2009-2021 - publisher: - type: string - example: TU Wien - tables: + creators: type: array items: - $ref: '#/components/schemas/TableBriefDto' - image: - $ref: '#/components/schemas/ImageDto' - container: - $ref: '#/components/schemas/ContainerDto' + $ref: '#/components/schemas/CreatorDto' created: type: string format: date-time - deleted: + 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 - format: date-time - internal_name: + example: "SELECT `id`, `value`, `location` FROM `air_quality` WHERE `location`\ + \ = \"09:STEF\"" + related: + type: array + items: + $ref: '#/components/schemas/RelatedIdentifierDto' + query_hash: type: string - example: weather_australia - publication_year: + 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 - publication_day: + example: 12 + publication_year: type: integer format: int32 - is_public: - type: boolean - example: true - GrantedAuthorityDto: - type: object - properties: - authority: + example: 2022 + last_modified: type: string - example: ROLE_RESEARCHER + format: date-time ImageBriefDto: required: - id @@ -1594,14 +2364,14 @@ components: uri: type: string example: https://opensource.org/licenses/MIT - example: MIT2 - QueryBriefDto: + QueryDto: required: - cid - created - creator - dbid - id + - is_persisted - query - query_hash type: object @@ -1623,6 +2393,12 @@ components: query: type: string example: SELECT `id` FROM `air_quality` + type: + type: string + example: query + enum: + - query + - view created: type: string format: date-time @@ -1631,10 +2407,10 @@ components: example: SELECT `id` FROM `air_quality` query_hash: type: string - example: 17e682f060b5f8e47ea04c5c4855908b0a5ad612022260fe50e11ecb0cc0ab76 + is_persisted: + type: boolean result_hash: type: string - example: 17e682f060b5f8e47ea04c5c4855908b0a5ad612022260fe50e11ecb0cc0ab76 result_number: type: integer format: int64 @@ -1642,6 +2418,88 @@ components: last_modified: type: string format: date-time + 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 + deleted: + type: string + format: date-time + last_modified: + type: string + format: date-time TableBriefDto: required: - creator @@ -1757,7 +2615,141 @@ components: email_verified: type: boolean example: true - QueryDto: + ViewCreateDto: + required: + - is_public + - name + - query + type: object + properties: + name: + type: string + example: Air Quality + query: + type: string + example: SELECT `id` FROM `air_quality` + is_public: + type: boolean + example: true + ViewBriefDto: + required: + - created + - created_by + - id + - query + - vdbid + type: object + properties: + id: + type: integer + format: int64 + vdbid: + type: integer + format: int64 + name: + 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 + initial_view: + type: boolean + description: True if it is the default view for the database + example: true + created_by: + type: integer + format: int64 + last_modified: + type: string + format: date-time + TableCsvDto: + required: + - data + type: object + properties: + data: + type: object + additionalProperties: + type: object + ImportDto: + required: + - location + - separator + type: object + properties: + location: + type: string + example: /tmp/file.csv + separator: + type: string + example: "," + quote: + type: string + example: '"' + skip_lines: + minimum: 0 + type: integer + format: int64 + false_element: + type: string + true_element: + type: string + null_element: + type: string + example: NA + ViewDto: + required: + - created + - creator + - database + - id + - name + - query + - vdbid + type: object + properties: + id: + type: integer + format: int64 + vdbid: + type: integer + format: int64 + creator: + $ref: '#/components/schemas/UserDto' + database: + $ref: '#/components/schemas/DatabaseDto' + name: + 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 + initial_view: + type: boolean + description: True if it is the default view for the database + example: true + last_modified: + type: string + format: date-time + QueryBriefDto: required: - cid - created @@ -1785,6 +2777,12 @@ components: query: type: string example: SELECT `id` FROM `air_quality` + type: + type: string + example: query + enum: + - query + - view created: type: string format: date-time @@ -1793,8 +2791,10 @@ components: example: SELECT `id` FROM `air_quality` query_hash: type: string + example: 17e682f060b5f8e47ea04c5c4855908b0a5ad612022260fe50e11ecb0cc0ab76 result_hash: type: string + example: 17e682f060b5f8e47ea04c5c4855908b0a5ad612022260fe50e11ecb0cc0ab76 result_number: type: integer format: int64 diff --git a/swagger/api-table.yaml b/swagger/api-table.yaml index 122ec5d0559909ae4a051963cd3e143f4979fdb5..1624286e82cd5b8b59b7c5712bbc71f165e6f818 100644 --- a/swagger/api-table.yaml +++ b/swagger/api-table.yaml @@ -60,14 +60,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable + "405": + description: Method Not Allowed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "406": + description: Not Acceptable content: '*/*': schema: @@ -123,14 +123,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable + "405": + description: Method Not Allowed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "406": + description: Not Acceptable content: '*/*': schema: @@ -167,11 +167,6 @@ paths: schema: type: integer format: int64 - - name: Authorization - in: header - required: true - schema: - type: string responses: "400": description: Bad Request @@ -191,14 +186,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable + "405": + description: Method Not Allowed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "406": + description: Not Acceptable content: '*/*': schema: @@ -212,7 +207,7 @@ paths: tags: - table-endpoint summary: List all tables - operationId: findAll + operationId: list parameters: - name: id in: path @@ -245,14 +240,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable + "405": + description: Method Not Allowed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "406": + description: Not Acceptable content: '*/*': schema: @@ -285,11 +280,6 @@ paths: schema: type: integer format: int64 - - name: Authorization - in: header - required: true - schema: - type: string requestBody: content: application/json: @@ -315,14 +305,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "406": - description: Not Acceptable + "405": + description: Method Not Allowed content: '*/*': schema: $ref: '#/components/schemas/ApiErrorDto' - "405": - description: Method Not Allowed + "406": + description: Not Acceptable content: '*/*': schema: diff --git a/swagger/api/api_analyse/__init__.py b/swagger/api/api_analyse/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6c9df81fd67c36a7a8df66a93efeec43ea9c34a8 --- /dev/null +++ b/swagger/api/api_analyse/__init__.py @@ -0,0 +1,22 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Analyse Service API + + Service that analyses data structures # 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_analyse.api.default_api import DefaultApi +# import ApiClient +from api_analyse.api_client import ApiClient +from api_analyse.configuration import Configuration +# import models into sdk package diff --git a/swagger/api/api_analyse/api/__init__.py b/swagger/api/api_analyse/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6b591ee3dcfab64fe943b8d0cb87068ab697bab9 --- /dev/null +++ b/swagger/api/api_analyse/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_analyse.api.default_api import DefaultApi diff --git a/swagger/api/api_analyse/api/default_api.py b/swagger/api/api_analyse/api/default_api.py new file mode 100644 index 0000000000000000000000000000000000000000..bc0aa0c3507b847ddc4eef2ee485c446717675fd --- /dev/null +++ b/swagger/api/api_analyse/api/default_api.py @@ -0,0 +1,199 @@ +# coding: utf-8 + +""" + Database Repository Analyse Service API + + Service that analyses data structures # 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_analyse.api_client import ApiClient + + +class DefaultApi(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_analyse_determinedt_post(self, **kwargs): # noqa: E501 + """Determine datatypes # noqa: E501 + + This is a simple API which returns the datatypes of a (path) csv file # 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_analyse_determinedt_post(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_analyse_determinedt_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_analyse_determinedt_post_with_http_info(**kwargs) # noqa: E501 + return data + + def api_analyse_determinedt_post_with_http_info(self, **kwargs): # noqa: E501 + """Determine datatypes # noqa: E501 + + This is a simple API which returns the datatypes of a (path) csv file # 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_analyse_determinedt_post_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_analyse_determinedt_post" % 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/analyse/determinedt', '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_analyse_determinepk_post(self, **kwargs): # noqa: E501 + """Determine primary keys # noqa: E501 + + This is a simple API which returns the primary keys + ranking of a (path) csv file # 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_analyse_determinepk_post(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_analyse_determinepk_post_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.api_analyse_determinepk_post_with_http_info(**kwargs) # noqa: E501 + return data + + def api_analyse_determinepk_post_with_http_info(self, **kwargs): # noqa: E501 + """Determine primary keys # noqa: E501 + + This is a simple API which returns the primary keys + ranking of a (path) csv file # 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_analyse_determinepk_post_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_analyse_determinepk_post" % 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/analyse/determinepk', '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_analyse/api_client.py b/swagger/api/api_analyse/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..5576a63b81b22baa4dff217729ac02de505ad4f9 --- /dev/null +++ b/swagger/api/api_analyse/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Analyse Service API + + Service that analyses data structures # 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_analyse.configuration import Configuration +import api_analyse.models +from api_analyse 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_analyse.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_analyse/configuration.py b/swagger/api/api_analyse/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..b3044832d8ca8443d7911578bf8eb509d97440ad --- /dev/null +++ b/swagger/api/api_analyse/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Analyse Service API + + Service that analyses data structures # 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_analyse") + 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_analyse/models/__init__.py b/swagger/api/api_analyse/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c15480fe80a10d53702e31227a48dd18bb3eb0a2 --- /dev/null +++ b/swagger/api/api_analyse/models/__init__.py @@ -0,0 +1,16 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Analyse Service API + + Service that analyses data structures # 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 diff --git a/swagger/api/api_analyse/rest.py b/swagger/api/api_analyse/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..25387928de2d02870eb05ac16be251aa8a242d08 --- /dev/null +++ b/swagger/api/api_analyse/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Analyse Service API + + Service that analyses data structures # 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_authentication/__init__.py b/swagger/api/api_authentication/__init__.py index c20f434f5ee3610077bb2fd6ec91f8a21f5ca08a..b0babf029dd738c8a08ae3f2360b6b3a5e0cdfec 100644 --- a/swagger/api/api_authentication/__init__.py +++ b/swagger/api/api_authentication/__init__.py @@ -16,6 +16,7 @@ from __future__ import absolute_import # import apis into sdk package from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi +from api_authentication.api.time_secret_endpoint_api import TimeSecretEndpointApi from api_authentication.api.token_endpoint_api import TokenEndpointApi from api_authentication.api.user_endpoint_api import UserEndpointApi # import ApiClient @@ -24,8 +25,10 @@ from api_authentication.configuration import Configuration # import models into sdk package 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_dto import DatabaseDto from api_authentication.models.granted_authority_dto import GrantedAuthorityDto +from api_authentication.models.identifier_dto import IdentifierDto from api_authentication.models.image_brief_dto import ImageBriefDto from api_authentication.models.image_date_dto import ImageDateDto from api_authentication.models.image_dto import ImageDto @@ -33,8 +36,11 @@ from api_authentication.models.image_env_item_dto import ImageEnvItemDto from api_authentication.models.jwt_response_dto import JwtResponseDto from api_authentication.models.license_dto import LicenseDto from api_authentication.models.login_request_dto import LoginRequestDto +from api_authentication.models.related_identifier_dto import RelatedIdentifierDto from api_authentication.models.signup_request_dto import SignupRequestDto from api_authentication.models.table_brief_dto import TableBriefDto +from api_authentication.models.token_brief_dto import TokenBriefDto +from api_authentication.models.token_dto import TokenDto from api_authentication.models.user_brief_dto import UserBriefDto from api_authentication.models.user_dto import UserDto from api_authentication.models.user_email_dto import UserEmailDto diff --git a/swagger/api/api_authentication/api/__init__.py b/swagger/api/api_authentication/api/__init__.py index 9643d433a897d442036202f72e292b7b4cf0c6d5..dbe2618cccb80f03c92c3603aa98baf04bcc2f44 100644 --- a/swagger/api/api_authentication/api/__init__.py +++ b/swagger/api/api_authentication/api/__init__.py @@ -4,5 +4,6 @@ from __future__ import absolute_import # import apis into api package from api_authentication.api.authentication_endpoint_api import AuthenticationEndpointApi +from api_authentication.api.time_secret_endpoint_api import TimeSecretEndpointApi from api_authentication.api.token_endpoint_api import TokenEndpointApi from api_authentication.api.user_endpoint_api import UserEndpointApi diff --git a/swagger/api/api_authentication/api/authentication_endpoint_api.py b/swagger/api/api_authentication/api/authentication_endpoint_api.py index 93d09fe07770eca0410a7e84df665ee639805114..00cfea46bf073312505a6577f2a0552993a9c09b 100644 --- a/swagger/api/api_authentication/api/authentication_endpoint_api.py +++ b/swagger/api/api_authentication/api/authentication_endpoint_api.py @@ -32,41 +32,43 @@ class AuthenticationEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def authenticate_user(self, **kwargs): # noqa: E501 - """Validate token # noqa: E501 + def authenticate_user(self, authorization, **kwargs): # noqa: E501 + """Validate authentication 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.authenticate_user(async_req=True) + >>> thread = api.authenticate_user(authorization, async_req=True) >>> result = thread.get() :param async_req bool + :param str authorization: (required) :return: UserDto If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.authenticate_user_with_http_info(**kwargs) # noqa: E501 + return self.authenticate_user_with_http_info(authorization, **kwargs) # noqa: E501 else: - (data) = self.authenticate_user_with_http_info(**kwargs) # noqa: E501 + (data) = self.authenticate_user_with_http_info(authorization, **kwargs) # noqa: E501 return data - def authenticate_user_with_http_info(self, **kwargs): # noqa: E501 - """Validate token # noqa: E501 + def authenticate_user_with_http_info(self, authorization, **kwargs): # noqa: E501 + """Validate authentication 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.authenticate_user_with_http_info(async_req=True) + >>> thread = api.authenticate_user_with_http_info(authorization, async_req=True) >>> result = thread.get() :param async_req bool + :param str authorization: (required) :return: UserDto If the method is called asynchronously, returns the request thread. """ - all_params = [] # noqa: E501 + all_params = ['authorization'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -81,6 +83,10 @@ class AuthenticationEndpointApi(object): ) params[key] = val del params['kwargs'] + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `authenticate_user`") # noqa: E501 collection_formats = {} @@ -89,6 +95,8 @@ class AuthenticationEndpointApi(object): query_params = [] header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 form_params = [] local_var_files = {} @@ -118,7 +126,7 @@ class AuthenticationEndpointApi(object): collection_formats=collection_formats) def authenticate_user1(self, body, **kwargs): # noqa: E501 - """Create token # noqa: E501 + """Create authentication token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -139,7 +147,7 @@ class AuthenticationEndpointApi(object): return data def authenticate_user1_with_http_info(self, body, **kwargs): # noqa: E501 - """Create token # noqa: E501 + """Create authentication token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -215,7 +223,7 @@ class AuthenticationEndpointApi(object): collection_formats=collection_formats) def re_authenticate_user(self, **kwargs): # noqa: E501 - """Renew token # noqa: E501 + """Renew authentication token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -235,7 +243,7 @@ class AuthenticationEndpointApi(object): return data def re_authenticate_user_with_http_info(self, **kwargs): # noqa: E501 - """Renew token # noqa: E501 + """Renew authentication token # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True diff --git a/swagger/api/api_authentication/api/time_secret_endpoint_api.py b/swagger/api/api_authentication/api/time_secret_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..b679f9f98694f2b1e6222e1afdfa16befaee7404 --- /dev/null +++ b/swagger/api/api_authentication/api/time_secret_endpoint_api.py @@ -0,0 +1,223 @@ +# 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 +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from api_authentication.api_client import ApiClient + + +class TimeSecretEndpointApi(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 resend(self, body, **kwargs): # noqa: E501 + """resend user 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.resend(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserForgotDto body: (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.resend_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.resend_with_http_info(body, **kwargs) # noqa: E501 + return data + + def resend_with_http_info(self, body, **kwargs): # noqa: E501 + """resend user 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.resend_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param UserForgotDto body: (required) + :return: object + 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 resend" % 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 `resend`") # noqa: E501 + + 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 `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 = [] # noqa: E501 + + return self.api_client.call_api( + '/api/user/secret/resend', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def verify_email(self, token, **kwargs): # noqa: E501 + """verify user email # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.verify_email(token, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str token: (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.verify_email_with_http_info(token, **kwargs) # noqa: E501 + else: + (data) = self.verify_email_with_http_info(token, **kwargs) # noqa: E501 + return data + + def verify_email_with_http_info(self, token, **kwargs): # noqa: E501 + """verify user email # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.verify_email_with_http_info(token, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str token: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['token'] # 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 verify_email" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'token' is set + if ('token' not in params or + params['token'] is None): + raise ValueError("Missing the required parameter `token` when calling `verify_email`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'token' in params: + query_params.append(('token', params['token'])) # noqa: E501 + + 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/user/secret', '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_authentication/api/token_endpoint_api.py b/swagger/api/api_authentication/api/token_endpoint_api.py index d00b8ecc1bf1722274513f9978e69735c7901af0..554d4694bc844a7c21578b1f7b4446e28a311dc9 100644 --- a/swagger/api/api_authentication/api/token_endpoint_api.py +++ b/swagger/api/api_authentication/api/token_endpoint_api.py @@ -32,43 +32,41 @@ class TokenEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def resend(self, body, **kwargs): # noqa: E501 - """resend user token # noqa: E501 + def create(self, **kwargs): # noqa: E501 + """Create 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.resend(body, async_req=True) + >>> thread = api.create(async_req=True) >>> result = thread.get() :param async_req bool - :param UserForgotDto body: (required) - :return: object + :return: TokenDto If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.resend_with_http_info(body, **kwargs) # noqa: E501 + return self.create_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.resend_with_http_info(body, **kwargs) # noqa: E501 + (data) = self.create_with_http_info(**kwargs) # noqa: E501 return data - def resend_with_http_info(self, body, **kwargs): # noqa: E501 - """resend user token # noqa: E501 + def create_with_http_info(self, **kwargs): # noqa: E501 + """Create 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.resend_with_http_info(body, async_req=True) + >>> thread = api.create_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param UserForgotDto body: (required) - :return: object + :return: TokenDto If the method is called asynchronously, returns the request thread. """ - all_params = ['body'] # noqa: E501 + all_params = [] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -79,14 +77,10 @@ class TokenEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method resend" % key + " 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 `resend`") # noqa: E501 collection_formats = {} @@ -100,28 +94,22 @@ class TokenEndpointApi(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 = [] # noqa: E501 + auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/user/token/resend', 'POST', + '/api/user/token', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='object', # noqa: E501 + response_type='TokenDto', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -129,43 +117,43 @@ class TokenEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def verify_email(self, token, **kwargs): # noqa: E501 - """verify user email # noqa: E501 + def delete(self, hash, **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.verify_email(token, async_req=True) + >>> thread = api.delete(hash, async_req=True) >>> result = thread.get() :param async_req bool - :param str token: (required) + :param str hash: (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.verify_email_with_http_info(token, **kwargs) # noqa: E501 + return self.delete_with_http_info(hash, **kwargs) # noqa: E501 else: - (data) = self.verify_email_with_http_info(token, **kwargs) # noqa: E501 + (data) = self.delete_with_http_info(hash, **kwargs) # noqa: E501 return data - def verify_email_with_http_info(self, token, **kwargs): # noqa: E501 - """verify user email # noqa: E501 + def delete_with_http_info(self, hash, **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.verify_email_with_http_info(token, async_req=True) + >>> thread = api.delete_with_http_info(hash, async_req=True) >>> result = thread.get() :param async_req bool - :param str token: (required) + :param str hash: (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['token'] # noqa: E501 + all_params = ['hash'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -176,22 +164,22 @@ class TokenEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method verify_email" % key + " to method delete" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'token' is set - if ('token' not in params or - params['token'] is None): - raise ValueError("Missing the required parameter `token` when calling `verify_email`") # noqa: E501 + # 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 collection_formats = {} path_params = {} + if 'hash' in params: + path_params['hash'] = params['hash'] # noqa: E501 query_params = [] - if 'token' in params: - query_params.append(('token', params['token'])) # noqa: E501 header_params = {} @@ -204,10 +192,10 @@ class TokenEndpointApi(object): ['*/*']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/user/token', 'GET', + '/api/user/token/{hash}', 'DELETE', path_params, query_params, header_params, @@ -221,3 +209,88 @@ class TokenEndpointApi(object): _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + + def list_all(self, **kwargs): # noqa: E501 + """Lists developer tokens for user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_all(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[TokenBriefDto] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.list_all_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.list_all_with_http_info(**kwargs) # noqa: E501 + return data + + def list_all_with_http_info(self, **kwargs): # noqa: E501 + """Lists developer tokens for user # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_all_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: list[TokenBriefDto] + 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 list_all" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + 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/user/token', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[TokenBriefDto]', # 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_authentication/models/__init__.py b/swagger/api/api_authentication/models/__init__.py index fc192aa3f48fc29eb41b993849da77e1a52b8001..ba53b0f5ea004397009f41a1e85b17e3ac868851 100644 --- a/swagger/api/api_authentication/models/__init__.py +++ b/swagger/api/api_authentication/models/__init__.py @@ -16,8 +16,10 @@ from __future__ import absolute_import # import models into model package 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_dto import DatabaseDto from api_authentication.models.granted_authority_dto import GrantedAuthorityDto +from api_authentication.models.identifier_dto import IdentifierDto from api_authentication.models.image_brief_dto import ImageBriefDto from api_authentication.models.image_date_dto import ImageDateDto from api_authentication.models.image_dto import ImageDto @@ -25,8 +27,11 @@ from api_authentication.models.image_env_item_dto import ImageEnvItemDto from api_authentication.models.jwt_response_dto import JwtResponseDto from api_authentication.models.license_dto import LicenseDto from api_authentication.models.login_request_dto import LoginRequestDto +from api_authentication.models.related_identifier_dto import RelatedIdentifierDto from api_authentication.models.signup_request_dto import SignupRequestDto from api_authentication.models.table_brief_dto import TableBriefDto +from api_authentication.models.token_brief_dto import TokenBriefDto +from api_authentication.models.token_dto import TokenDto from api_authentication.models.user_brief_dto import UserBriefDto from api_authentication.models.user_dto import UserDto from api_authentication.models.user_email_dto import UserEmailDto diff --git a/swagger/api/api_authentication/models/creator_dto.py b/swagger/api/api_authentication/models/creator_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..c658d9f4d33230608429da34da80afea90c4fe9c --- /dev/null +++ b/swagger/api/api_authentication/models/creator_dto.py @@ -0,0 +1,243 @@ +# 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 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', + 'name': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'created': 'created', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, name=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._affiliation = None + self._orcid = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.name = name + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + 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 name(self): + """Gets the name of this CreatorDto. # noqa: E501 + + + :return: The name of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreatorDto. + + + :param name: The name of this CreatorDto. # 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 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 + """ + 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 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_authentication/models/database_dto.py b/swagger/api/api_authentication/models/database_dto.py index a8a3fed0801cf9c5b07e2fe15631578e93913f72..9003079cba6f9bd0d1fceebd265115c0235843d8 100644 --- a/swagger/api/api_authentication/models/database_dto.py +++ b/swagger/api/api_authentication/models/database_dto.py @@ -32,20 +32,14 @@ class DatabaseDto(object): 'name': 'str', 'exchange': 'str', 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', + 'identifier': 'IdentifierDto', 'description': 'str', - 'publisher': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication_year': 'int', - 'publication_month': 'int', - 'publication_day': 'int', 'is_public': 'bool' } @@ -54,59 +48,41 @@ class DatabaseDto(object): 'name': 'name', 'exchange': 'exchange', 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', + 'identifier': 'identifier', 'description': 'description', - 'publisher': 'publisher', 'tables': 'tables', 'image': 'image', 'container': 'container', 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'publication_month': 'publication_month', - 'publication_day': 'publication_day', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_public=None): # noqa: E501 + 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 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._exchange = None self._creator = None - self._subjects = None - self._language = None - self._license = None + self._identifier = None self._description = None - self._publisher = None self._tables = None self._image = None self._container = None self._created = None self._deleted = None self._internal_name = None - self._publication_year = None - self._publication_month = None - self._publication_day = None self._is_public = None self.discriminator = None self.id = id self.name = name self.exchange = exchange self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license + if identifier is not None: + self.identifier = identifier if description is not None: self.description = description - if publisher is not None: - self.publisher = publisher if tables is not None: self.tables = tables if image is not None: @@ -118,12 +94,6 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication_year is not None: - 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 is_public is not None: self.is_public = is_public @@ -220,73 +190,25 @@ class DatabaseDto(object): self._creator = creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def identifier(self): + """Gets the identifier of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 - :rtype: list[str] + :return: The identifier of this DatabaseDto. # noqa: E501 + :rtype: IdentifierDto """ - return self._subjects + return self._identifier - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 - :type: list[str] + :param identifier: The identifier of this DatabaseDto. # noqa: E501 + :type: IdentifierDto """ - self._subjects = subjects - - @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 - - - :return: The language of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._language - - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. - - - :param language: The language of this DatabaseDto. # 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 DatabaseDto. # noqa: E501 - - - :return: The license of this DatabaseDto. # noqa: E501 - :rtype: LicenseDto - """ - return self._license - - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. - - - :param license: The license of this DatabaseDto. # noqa: E501 - :type: LicenseDto - """ - - self._license = license + self._identifier = identifier @property def description(self): @@ -309,27 +231,6 @@ class DatabaseDto(object): self._description = description - @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 - - - :return: The publisher of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._publisher - - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. - - - :param publisher: The publisher of this DatabaseDto. # noqa: E501 - :type: str - """ - - self._publisher = publisher - @property def tables(self): """Gets the tables of this DatabaseDto. # noqa: E501 @@ -458,69 +359,6 @@ class DatabaseDto(object): self._internal_name = internal_name - @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 - - - :return: The publication_year of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_year - - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. - - - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_year = publication_year - - @property - def publication_month(self): - """Gets the publication_month of this DatabaseDto. # noqa: E501 - - - :return: The publication_month of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_month - - @publication_month.setter - def publication_month(self, publication_month): - """Sets the publication_month of this DatabaseDto. - - - :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_month = publication_month - - @property - def publication_day(self): - """Gets the publication_day of this DatabaseDto. # noqa: E501 - - - :return: The publication_day of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_day - - @publication_day.setter - def publication_day(self, publication_day): - """Sets the publication_day of this DatabaseDto. - - - :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_day = publication_day - @property def is_public(self): """Gets the is_public of this DatabaseDto. # noqa: E501 diff --git a/swagger/api/api_authentication/models/identifier_dto.py b/swagger/api/api_authentication/models/identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..67aa0ce33e277e75b69bb29968d425933c81c3c1 --- /dev/null +++ b/swagger/api/api_authentication/models/identifier_dto.py @@ -0,0 +1,794 @@ +# 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 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', + 'creator': 'UserDto', + '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', + 'creator': 'creator', + '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, 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 + """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._creator = 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 + self.creator = creator + 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 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 + + + :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_authentication/models/related_identifier_dto.py b/swagger/api/api_authentication/models/related_identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b75773d2c6df3bf4d147a129bd98d987a161ebd6 --- /dev/null +++ b/swagger/api/api_authentication/models/related_identifier_dto.py @@ -0,0 +1,281 @@ +# 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 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', + 'deleted': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'value': 'value', + '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 + """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 + self.value = value + if type is not None: + self.type = type + 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 + + @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 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 + + + :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_authentication/models/token_brief_dto.py b/swagger/api/api_authentication/models/token_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..b86592c9b9b8725950fdeb1c05c307693584b2f3 --- /dev/null +++ b/swagger/api/api_authentication/models/token_brief_dto.py @@ -0,0 +1,244 @@ +# 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 TokenBriefDto(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', + 'created': 'datetime', + 'expires': 'datetime', + 'deleted': 'datetime', + 'token_hash': 'str', + 'last_used': 'datetime' + } + + attribute_map = { + '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 + """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 + + @property + def id(self): + """Gets the id of this TokenBriefDto. # noqa: E501 + + + :return: The id of this TokenBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TokenBriefDto. + + + :param id: The id of this TokenBriefDto. # 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 created(self): + """Gets the created of this TokenBriefDto. # noqa: E501 + + + :return: The created of this TokenBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this TokenBriefDto. + + + :param created: The created of this TokenBriefDto. # 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 expires(self): + """Gets the expires of this TokenBriefDto. # noqa: E501 + + + :return: The expires of this TokenBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._expires + + @expires.setter + def expires(self, expires): + """Sets the expires of this TokenBriefDto. + + + :param expires: The expires of this TokenBriefDto. # noqa: E501 + :type: datetime + """ + if expires is None: + raise ValueError("Invalid value for `expires`, must not be `None`") # noqa: E501 + + 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 + + + :return: The token_hash of this TokenBriefDto. # noqa: E501 + :rtype: str + """ + return self._token_hash + + @token_hash.setter + def token_hash(self, token_hash): + """Sets the token_hash of this TokenBriefDto. + + + :param token_hash: The token_hash of this TokenBriefDto. # noqa: E501 + :type: str + """ + if token_hash is None: + raise ValueError("Invalid value for `token_hash`, must not be `None`") # noqa: E501 + + self._token_hash = token_hash + + @property + def last_used(self): + """Gets the last_used of this TokenBriefDto. # noqa: E501 + + + :return: The last_used of this TokenBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._last_used + + @last_used.setter + def last_used(self, last_used): + """Sets the last_used of this TokenBriefDto. + + + :param last_used: The last_used of this TokenBriefDto. # noqa: E501 + :type: datetime + """ + + self._last_used = last_used + + 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(TokenBriefDto, 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, TokenBriefDto): + 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/token_dto.py b/swagger/api/api_authentication/models/token_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e2a7c97556d255f2f950fd67e054113c672f3e06 --- /dev/null +++ b/swagger/api/api_authentication/models/token_dto.py @@ -0,0 +1,271 @@ +# 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 TokenDto(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', + 'created': 'datetime', + 'expires': 'datetime', + 'deleted': 'datetime', + 'token': 'str', + 'token_hash': 'str', + 'last_used': 'datetime' + } + + attribute_map = { + '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 + """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 + self.discriminator = None + 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: + self.last_used = last_used + + @property + def id(self): + """Gets the id of this TokenDto. # noqa: E501 + + + :return: The id of this TokenDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TokenDto. + + + :param id: The id of this TokenDto. # 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 created(self): + """Gets the created of this TokenDto. # noqa: E501 + + + :return: The created of this TokenDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this TokenDto. + + + :param created: The created of this TokenDto. # 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 expires(self): + """Gets the expires of this TokenDto. # noqa: E501 + + + :return: The expires of this TokenDto. # noqa: E501 + :rtype: datetime + """ + return self._expires + + @expires.setter + def expires(self, expires): + """Sets the expires of this TokenDto. + + + :param expires: The expires of this TokenDto. # noqa: E501 + :type: datetime + """ + if expires is None: + raise ValueError("Invalid value for `expires`, must not be `None`") # noqa: E501 + + 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 + + + :return: The token of this TokenDto. # noqa: E501 + :rtype: str + """ + return self._token + + @token.setter + def token(self, token): + """Sets the token of this TokenDto. + + + :param token: The token of this TokenDto. # noqa: E501 + :type: str + """ + if token is None: + raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501 + + self._token = token + + @property + def token_hash(self): + """Gets the token_hash of this TokenDto. # noqa: E501 + + + :return: The token_hash of this TokenDto. # noqa: E501 + :rtype: str + """ + return self._token_hash + + @token_hash.setter + def token_hash(self, token_hash): + """Sets the token_hash of this TokenDto. + + + :param token_hash: The token_hash of this TokenDto. # noqa: E501 + :type: str + """ + if token_hash is None: + raise ValueError("Invalid value for `token_hash`, must not be `None`") # noqa: E501 + + self._token_hash = token_hash + + @property + def last_used(self): + """Gets the last_used of this TokenDto. # noqa: E501 + + + :return: The last_used of this TokenDto. # noqa: E501 + :rtype: datetime + """ + return self._last_used + + @last_used.setter + def last_used(self, last_used): + """Sets the last_used of this TokenDto. + + + :param last_used: The last_used of this TokenDto. # noqa: E501 + :type: datetime + """ + + self._last_used = last_used + + 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(TokenDto, 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, TokenDto): + 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/__init__.py b/swagger/api/api_container/__init__.py index c37bd1a9543340cd1effa2d5e3de96fdf13f5375..5c202db249aefebe9939234e90f99ec884eeb541 100644 --- a/swagger/api/api_container/__init__.py +++ b/swagger/api/api_container/__init__.py @@ -26,7 +26,10 @@ from api_container.models.container_brief_dto import ContainerBriefDto 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_dto import DatabaseDto +from api_container.models.granted_authority_dto import GrantedAuthorityDto +from api_container.models.identifier_dto import IdentifierDto from api_container.models.image_brief_dto import ImageBriefDto from api_container.models.image_change_dto import ImageChangeDto from api_container.models.image_create_dto import ImageCreateDto @@ -34,5 +37,7 @@ from api_container.models.image_date_dto import ImageDateDto from api_container.models.image_dto import ImageDto from api_container.models.image_env_item_dto import ImageEnvItemDto from api_container.models.license_dto import LicenseDto +from api_container.models.related_identifier_dto import RelatedIdentifierDto from api_container.models.table_brief_dto import TableBriefDto from api_container.models.user_brief_dto import UserBriefDto +from api_container.models.user_dto import UserDto diff --git a/swagger/api/api_container/models/__init__.py b/swagger/api/api_container/models/__init__.py index 32e6e340214faf439abb16a103fd75f4c0cec578..2f3f0932583ab6e3c27a0f9fa2cddf8dcbe98d13 100644 --- a/swagger/api/api_container/models/__init__.py +++ b/swagger/api/api_container/models/__init__.py @@ -19,7 +19,10 @@ from api_container.models.container_brief_dto import ContainerBriefDto 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_dto import DatabaseDto +from api_container.models.granted_authority_dto import GrantedAuthorityDto +from api_container.models.identifier_dto import IdentifierDto from api_container.models.image_brief_dto import ImageBriefDto from api_container.models.image_change_dto import ImageChangeDto from api_container.models.image_create_dto import ImageCreateDto @@ -27,5 +30,7 @@ from api_container.models.image_date_dto import ImageDateDto from api_container.models.image_dto import ImageDto from api_container.models.image_env_item_dto import ImageEnvItemDto from api_container.models.license_dto import LicenseDto +from api_container.models.related_identifier_dto import RelatedIdentifierDto from api_container.models.table_brief_dto import TableBriefDto from api_container.models.user_brief_dto import UserBriefDto +from api_container.models.user_dto import UserDto diff --git a/swagger/api/api_container/models/creator_dto.py b/swagger/api/api_container/models/creator_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..d3dd17c191d513f6806239c20b6164888ff0e40c --- /dev/null +++ b/swagger/api/api_container/models/creator_dto.py @@ -0,0 +1,243 @@ +# 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 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', + 'name': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'created': 'created', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, name=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._affiliation = None + self._orcid = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.name = name + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + 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 name(self): + """Gets the name of this CreatorDto. # noqa: E501 + + + :return: The name of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreatorDto. + + + :param name: The name of this CreatorDto. # 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 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 + """ + 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 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_container/models/database_dto.py b/swagger/api/api_container/models/database_dto.py index 4c1e4837496cdf9051cf1ee03fcb8e4882734298..4cfdfd3fc8373c5e04966280d14399e47f50d66d 100644 --- a/swagger/api/api_container/models/database_dto.py +++ b/swagger/api/api_container/models/database_dto.py @@ -32,20 +32,14 @@ class DatabaseDto(object): 'name': 'str', 'exchange': 'str', 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', + 'identifier': 'IdentifierDto', 'description': 'str', - 'publisher': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication_year': 'int', - 'publication_month': 'int', - 'publication_day': 'int', 'is_public': 'bool' } @@ -54,59 +48,41 @@ class DatabaseDto(object): 'name': 'name', 'exchange': 'exchange', 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', + 'identifier': 'identifier', 'description': 'description', - 'publisher': 'publisher', 'tables': 'tables', 'image': 'image', 'container': 'container', 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'publication_month': 'publication_month', - 'publication_day': 'publication_day', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_public=None): # noqa: E501 + 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 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._exchange = None self._creator = None - self._subjects = None - self._language = None - self._license = None + self._identifier = None self._description = None - self._publisher = None self._tables = None self._image = None self._container = None self._created = None self._deleted = None self._internal_name = None - self._publication_year = None - self._publication_month = None - self._publication_day = None self._is_public = None self.discriminator = None self.id = id self.name = name self.exchange = exchange self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license + if identifier is not None: + self.identifier = identifier if description is not None: self.description = description - if publisher is not None: - self.publisher = publisher if tables is not None: self.tables = tables if image is not None: @@ -118,12 +94,6 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication_year is not None: - 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 is_public is not None: self.is_public = is_public @@ -220,73 +190,25 @@ class DatabaseDto(object): self._creator = creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def identifier(self): + """Gets the identifier of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 - :rtype: list[str] + :return: The identifier of this DatabaseDto. # noqa: E501 + :rtype: IdentifierDto """ - return self._subjects + return self._identifier - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 - :type: list[str] + :param identifier: The identifier of this DatabaseDto. # noqa: E501 + :type: IdentifierDto """ - self._subjects = subjects - - @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 - - - :return: The language of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._language - - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. - - - :param language: The language of this DatabaseDto. # 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 DatabaseDto. # noqa: E501 - - - :return: The license of this DatabaseDto. # noqa: E501 - :rtype: LicenseDto - """ - return self._license - - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. - - - :param license: The license of this DatabaseDto. # noqa: E501 - :type: LicenseDto - """ - - self._license = license + self._identifier = identifier @property def description(self): @@ -309,27 +231,6 @@ class DatabaseDto(object): self._description = description - @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 - - - :return: The publisher of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._publisher - - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. - - - :param publisher: The publisher of this DatabaseDto. # noqa: E501 - :type: str - """ - - self._publisher = publisher - @property def tables(self): """Gets the tables of this DatabaseDto. # noqa: E501 @@ -458,69 +359,6 @@ class DatabaseDto(object): self._internal_name = internal_name - @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 - - - :return: The publication_year of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_year - - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. - - - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_year = publication_year - - @property - def publication_month(self): - """Gets the publication_month of this DatabaseDto. # noqa: E501 - - - :return: The publication_month of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_month - - @publication_month.setter - def publication_month(self, publication_month): - """Sets the publication_month of this DatabaseDto. - - - :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_month = publication_month - - @property - def publication_day(self): - """Gets the publication_day of this DatabaseDto. # noqa: E501 - - - :return: The publication_day of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_day - - @publication_day.setter - def publication_day(self, publication_day): - """Sets the publication_day of this DatabaseDto. - - - :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_day = publication_day - @property def is_public(self): """Gets the is_public of this DatabaseDto. # noqa: E501 diff --git a/swagger/api/api_container/models/identifier_dto.py b/swagger/api/api_container/models/identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e17a6c46819e3f50a0749b7883086cdfc4559dfe --- /dev/null +++ b/swagger/api/api_container/models/identifier_dto.py @@ -0,0 +1,794 @@ +# 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 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', + 'creator': 'UserDto', + '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', + 'creator': 'creator', + '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, 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 + """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._creator = 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 + self.creator = creator + 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 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 + + + :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_container/models/related_identifier_dto.py b/swagger/api/api_container/models/related_identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e35dace89a088cc3c8ba2544c68645db51424e9d --- /dev/null +++ b/swagger/api/api_container/models/related_identifier_dto.py @@ -0,0 +1,281 @@ +# 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 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', + 'deleted': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'value': 'value', + '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 + """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 + self.value = value + if type is not None: + self.type = type + 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 + + @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 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 + + + :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_container/models/user_dto.py b/swagger/api/api_container/models/user_dto.py index 1d4b0bbf7f7aa3c801b4b2ae734fac286b9a5a87..3d1b14417ef4405b97be22e752df7c5144127a49 100644 --- a/swagger/api/api_container/models/user_dto.py +++ b/swagger/api/api_container/models/user_dto.py @@ -155,6 +155,7 @@ class UserDto(object): 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 @@ -165,6 +166,7 @@ class UserDto(object): 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 diff --git a/swagger/api/api_database/__init__.py b/swagger/api/api_database/__init__.py index 40bd120d03f25022230c83d15792eb3afa2e9bb4..234f48713cc53d5a1e86ed5b580a9857888c8dbf 100644 --- a/swagger/api/api_database/__init__.py +++ b/swagger/api/api_database/__init__.py @@ -24,15 +24,20 @@ from api_database.configuration import Configuration 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_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_modify_dto import DatabaseModifyDto 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 from api_database.models.image_dto import ImageDto from api_database.models.image_env_item_dto import ImageEnvItemDto from api_database.models.license_dto import LicenseDto +from api_database.models.related_identifier_dto import RelatedIdentifierDto from api_database.models.table_brief_dto import TableBriefDto from api_database.models.user_brief_dto import UserBriefDto +from api_database.models.user_dto import UserDto diff --git a/swagger/api/api_database/api/database_endpoint_api.py b/swagger/api/api_database/api/database_endpoint_api.py index 1ad3383e96e34ef610d182226910b5a5e2ef197f..3245d772dbde48c59b10e46c0a0420e48b49f4b2 100644 --- a/swagger/api/api_database/api/database_endpoint_api.py +++ b/swagger/api/api_database/api/database_endpoint_api.py @@ -137,12 +137,12 @@ class DatabaseEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def delete1(self, id, database_id, **kwargs): # noqa: E501 + def delete(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.delete(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -154,17 +154,17 @@ class DatabaseEndpointApi(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.delete_with_http_info(id, database_id, **kwargs) # noqa: E501 else: - (data) = self.delete1_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.delete_with_http_info(id, database_id, **kwargs) # noqa: E501 return data - def delete1_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + def delete_with_http_info(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_with_http_info(id, database_id, async_req=True) + >>> thread = api.delete_with_http_info(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -186,18 +186,18 @@ class DatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete1" % key + " to method delete" % 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 `delete1`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete`") # 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 `delete`") # noqa: E501 collection_formats = {} @@ -238,99 +238,6 @@ class DatabaseEndpointApi(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 @@ -432,47 +339,43 @@ class DatabaseEndpointApi(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 list(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.transfer(body, id, database_id, async_req=True) + >>> thread = api.list(id, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseTransferDto body: (required) :param int id: (required) - :param int database_id: (required) - :return: DatabaseDto + :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.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + return self.list_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + (data) = self.list_with_http_info(id, **kwargs) # noqa: E501 return data - def transfer_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 - """Update database # noqa: E501 + def list_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.transfer_with_http_info(body, id, database_id, async_req=True) + >>> thread = api.list_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseTransferDto body: (required) :param int id: (required) - :param int database_id: (required) - :return: DatabaseDto + :return: list[DatabaseBriefDto] If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'id', 'database_id'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -483,30 +386,20 @@ class DatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method transfer" % key + " to method list" % 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 # 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 - # 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 `id` when calling `list`") # 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 query_params = [] @@ -516,28 +409,22 @@ class DatabaseEndpointApi(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 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/transfer', 'PUT', + '/api/container/{id}/database', '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='list[DatabaseBriefDto]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -545,16 +432,16 @@ class DatabaseEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def update(self, body, id, database_id, **kwargs): # noqa: E501 + def transfer(self, body, id, database_id, **kwargs): # noqa: E501 """Update 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.transfer(body, id, database_id, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseModifyDto body: (required) + :param DatabaseTransferDto body: (required) :param int id: (required) :param int database_id: (required) :return: DatabaseDto @@ -563,21 +450,21 @@ class DatabaseEndpointApi(object): """ 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.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 else: - (data) = self.update_with_http_info(body, id, database_id, **kwargs) # noqa: E501 + (data) = self.transfer_with_http_info(body, id, database_id, **kwargs) # noqa: E501 return data - def update_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 + def transfer_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 """Update 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.transfer_with_http_info(body, id, database_id, async_req=True) >>> result = thread.get() :param async_req bool - :param DatabaseModifyDto body: (required) + :param DatabaseTransferDto body: (required) :param int id: (required) :param int database_id: (required) :return: DatabaseDto @@ -596,22 +483,22 @@ class DatabaseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method update" % key + " to method transfer" % 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 + raise ValueError("Missing the required parameter `body` when calling `transfer`") # 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 `transfer`") # 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 `transfer`") # noqa: E501 collection_formats = {} @@ -643,7 +530,7 @@ class DatabaseEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}', 'PUT', + '/api/container/{id}/database/{databaseId}/transfer', 'PUT', path_params, query_params, header_params, diff --git a/swagger/api/api_database/api/license_endpoint_api.py b/swagger/api/api_database/api/license_endpoint_api.py index beedbc3d344d7f2edb4c89be9460dfe8cd1f0149..0758f7823cbeefdf1b3d28ed8f06eaf967a54613 100644 --- a/swagger/api/api_database/api/license_endpoint_api.py +++ b/swagger/api/api_database/api/license_endpoint_api.py @@ -32,12 +32,12 @@ class LicenseEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def delete(self, id, **kwargs): # noqa: E501 + def list1(self, id, **kwargs): # noqa: E501 """Get all licenses # 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(id, async_req=True) + >>> thread = api.list1(id, async_req=True) >>> result = thread.get() :param async_req bool @@ -48,17 +48,17 @@ class LicenseEndpointApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.delete_with_http_info(id, **kwargs) # noqa: E501 + return self.list1_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.delete_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.list1_with_http_info(id, **kwargs) # noqa: E501 return data - def delete_with_http_info(self, id, **kwargs): # noqa: E501 + def list1_with_http_info(self, id, **kwargs): # noqa: E501 """Get all licenses # 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(id, async_req=True) + >>> thread = api.list1_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool @@ -79,14 +79,14 @@ class LicenseEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete" % key + " to method list1" % 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 `delete`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `list1`") # noqa: E501 collection_formats = {} diff --git a/swagger/api/api_database/models/__init__.py b/swagger/api/api_database/models/__init__.py index 75d043704bb0625459042595af1e81904221060c..21d9634c64dcf7aefc43514da153f435ae5a7b29 100644 --- a/swagger/api/api_database/models/__init__.py +++ b/swagger/api/api_database/models/__init__.py @@ -17,15 +17,20 @@ from __future__ import absolute_import 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_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_modify_dto import DatabaseModifyDto 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 from api_database.models.image_dto import ImageDto from api_database.models.image_env_item_dto import ImageEnvItemDto from api_database.models.license_dto import LicenseDto +from api_database.models.related_identifier_dto import RelatedIdentifierDto from api_database.models.table_brief_dto import TableBriefDto from api_database.models.user_brief_dto import UserBriefDto +from api_database.models.user_dto import UserDto diff --git a/swagger/api/api_database/models/creator_dto.py b/swagger/api/api_database/models/creator_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..e45b85f54d837323447fe5df46828cb61797e885 --- /dev/null +++ b/swagger/api/api_database/models/creator_dto.py @@ -0,0 +1,243 @@ +# 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 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', + 'name': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'created': 'created', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, name=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._affiliation = None + self._orcid = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.name = name + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + 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 name(self): + """Gets the name of this CreatorDto. # noqa: E501 + + + :return: The name of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreatorDto. + + + :param name: The name of this CreatorDto. # 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 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 + """ + 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 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_database/models/database_brief_dto.py b/swagger/api/api_database/models/database_brief_dto.py index bf325afda796e5f97d25a0459deba58fefdbad9b..1597621ff1c3dfb49a7b63125415bd8c2516d04e 100644 --- a/swagger/api/api_database/models/database_brief_dto.py +++ b/swagger/api/api_database/models/database_brief_dto.py @@ -31,6 +31,7 @@ class DatabaseBriefDto(object): 'id': 'int', 'name': 'str', 'description': 'str', + 'identifier': 'IdentifierBriefDto', 'engine': 'str', 'container': 'ContainerBriefDto', 'creator': 'UserBriefDto', @@ -42,6 +43,7 @@ class DatabaseBriefDto(object): 'id': 'id', 'name': 'name', 'description': 'description', + 'identifier': 'identifier', 'engine': 'engine', 'container': 'container', 'creator': 'creator', @@ -49,11 +51,12 @@ class DatabaseBriefDto(object): 'is_public': 'is_public' } - def __init__(self, id=None, name=None, description=None, engine=None, container=None, creator=None, created=None, is_public=None): # noqa: E501 + def __init__(self, id=None, name=None, description=None, identifier=None, engine=None, container=None, creator=None, created=None, is_public=None): # noqa: E501 """DatabaseBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._description = None + self._identifier = None self._engine = None self._container = None self._creator = None @@ -64,6 +67,8 @@ class DatabaseBriefDto(object): self.name = name if description is not None: self.description = description + if identifier is not None: + self.identifier = identifier if engine is not None: self.engine = engine if container is not None: @@ -142,6 +147,27 @@ class DatabaseBriefDto(object): self._description = description + @property + def identifier(self): + """Gets the identifier of this DatabaseBriefDto. # noqa: E501 + + + :return: The identifier of this DatabaseBriefDto. # noqa: E501 + :rtype: IdentifierBriefDto + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseBriefDto. + + + :param identifier: The identifier of this DatabaseBriefDto. # noqa: E501 + :type: IdentifierBriefDto + """ + + self._identifier = identifier + @property def engine(self): """Gets the engine of this DatabaseBriefDto. # noqa: E501 diff --git a/swagger/api/api_database/models/database_dto.py b/swagger/api/api_database/models/database_dto.py index 2ac4839ac7fed4b29f04560ca8a73ae3e7795e70..28909d435b7b96b6171e494eb9a4a97f1fe1f9a7 100644 --- a/swagger/api/api_database/models/database_dto.py +++ b/swagger/api/api_database/models/database_dto.py @@ -32,20 +32,14 @@ class DatabaseDto(object): 'name': 'str', 'exchange': 'str', 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', + 'identifier': 'IdentifierDto', 'description': 'str', - 'publisher': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication_year': 'int', - 'publication_month': 'int', - 'publication_day': 'int', 'is_public': 'bool' } @@ -54,59 +48,41 @@ class DatabaseDto(object): 'name': 'name', 'exchange': 'exchange', 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', + 'identifier': 'identifier', 'description': 'description', - 'publisher': 'publisher', 'tables': 'tables', 'image': 'image', 'container': 'container', 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'publication_month': 'publication_month', - 'publication_day': 'publication_day', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_public=None): # noqa: E501 + 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 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._exchange = None self._creator = None - self._subjects = None - self._language = None - self._license = None + self._identifier = None self._description = None - self._publisher = None self._tables = None self._image = None self._container = None self._created = None self._deleted = None self._internal_name = None - self._publication_year = None - self._publication_month = None - self._publication_day = None self._is_public = None self.discriminator = None self.id = id self.name = name self.exchange = exchange self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license + if identifier is not None: + self.identifier = identifier if description is not None: self.description = description - if publisher is not None: - self.publisher = publisher if tables is not None: self.tables = tables if image is not None: @@ -118,12 +94,6 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication_year is not None: - 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 is_public is not None: self.is_public = is_public @@ -220,73 +190,25 @@ class DatabaseDto(object): self._creator = creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def identifier(self): + """Gets the identifier of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 - :rtype: list[str] + :return: The identifier of this DatabaseDto. # noqa: E501 + :rtype: IdentifierDto """ - return self._subjects + return self._identifier - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 - :type: list[str] + :param identifier: The identifier of this DatabaseDto. # noqa: E501 + :type: IdentifierDto """ - self._subjects = subjects - - @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 - - - :return: The language of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._language - - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. - - - :param language: The language of this DatabaseDto. # 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 DatabaseDto. # noqa: E501 - - - :return: The license of this DatabaseDto. # noqa: E501 - :rtype: LicenseDto - """ - return self._license - - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. - - - :param license: The license of this DatabaseDto. # noqa: E501 - :type: LicenseDto - """ - - self._license = license + self._identifier = identifier @property def description(self): @@ -309,27 +231,6 @@ class DatabaseDto(object): self._description = description - @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 - - - :return: The publisher of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._publisher - - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. - - - :param publisher: The publisher of this DatabaseDto. # noqa: E501 - :type: str - """ - - self._publisher = publisher - @property def tables(self): """Gets the tables of this DatabaseDto. # noqa: E501 @@ -458,69 +359,6 @@ class DatabaseDto(object): self._internal_name = internal_name - @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 - - - :return: The publication_year of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_year - - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. - - - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_year = publication_year - - @property - def publication_month(self): - """Gets the publication_month of this DatabaseDto. # noqa: E501 - - - :return: The publication_month of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_month - - @publication_month.setter - def publication_month(self, publication_month): - """Sets the publication_month of this DatabaseDto. - - - :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_month = publication_month - - @property - def publication_day(self): - """Gets the publication_day of this DatabaseDto. # noqa: E501 - - - :return: The publication_day of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_day - - @publication_day.setter - def publication_day(self, publication_day): - """Sets the publication_day of this DatabaseDto. - - - :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_day = publication_day - @property def is_public(self): """Gets the is_public of this DatabaseDto. # noqa: E501 diff --git a/swagger/api/api_database/models/identifier_brief_dto.py b/swagger/api/api_database/models/identifier_brief_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..4d7c22c69adf089ced7557637646efba91518523 --- /dev/null +++ b/swagger/api/api_database/models/identifier_brief_dto.py @@ -0,0 +1,302 @@ +# 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 IdentifierBriefDto(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', + 'title': 'str', + 'type': 'str', + 'created': 'datetime', + 'container_id': 'int', + 'database_id': 'int', + 'query_id': 'int', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'title': 'title', + 'type': 'type', + 'created': 'created', + 'container_id': 'container id', + 'database_id': 'database id', + 'query_id': 'query id', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, title=None, type=None, created=None, container_id=None, database_id=None, query_id=None, last_modified=None): # noqa: E501 + """IdentifierBriefDto - a model defined in Swagger""" # noqa: E501 + self._id = None + self._title = None + self._type = None + self._created = None + self._container_id = None + self._database_id = None + self._query_id = None + self._last_modified = None + self.discriminator = None + if id is not None: + self.id = id + self.title = title + self.type = type + 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 + if last_modified is not None: + self.last_modified = last_modified + + @property + def id(self): + """Gets the id of this IdentifierBriefDto. # noqa: E501 + + + :return: The id of this IdentifierBriefDto. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this IdentifierBriefDto. + + + :param id: The id of this IdentifierBriefDto. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def title(self): + """Gets the title of this IdentifierBriefDto. # noqa: E501 + + + :return: The title of this IdentifierBriefDto. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this IdentifierBriefDto. + + + :param title: The title of this IdentifierBriefDto. # 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 type(self): + """Gets the type of this IdentifierBriefDto. # noqa: E501 + + + :return: The type of this IdentifierBriefDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this IdentifierBriefDto. + + + :param type: The type of this IdentifierBriefDto. # 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 created(self): + """Gets the created of this IdentifierBriefDto. # noqa: E501 + + + :return: The created of this IdentifierBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._created + + @created.setter + def created(self, created): + """Sets the created of this IdentifierBriefDto. + + + :param created: The created of this IdentifierBriefDto. # noqa: E501 + :type: datetime + """ + + self._created = created + + @property + def container_id(self): + """Gets the container_id of this IdentifierBriefDto. # noqa: E501 + + + :return: The container_id of this IdentifierBriefDto. # noqa: E501 + :rtype: int + """ + return self._container_id + + @container_id.setter + def container_id(self, container_id): + """Sets the container_id of this IdentifierBriefDto. + + + :param container_id: The container_id of this IdentifierBriefDto. # 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 IdentifierBriefDto. # noqa: E501 + + + :return: The database_id of this IdentifierBriefDto. # noqa: E501 + :rtype: int + """ + return self._database_id + + @database_id.setter + def database_id(self, database_id): + """Sets the database_id of this IdentifierBriefDto. + + + :param database_id: The database_id of this IdentifierBriefDto. # 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 IdentifierBriefDto. # noqa: E501 + + + :return: The query_id of this IdentifierBriefDto. # noqa: E501 + :rtype: int + """ + return self._query_id + + @query_id.setter + def query_id(self, query_id): + """Sets the query_id of this IdentifierBriefDto. + + + :param query_id: The query_id of this IdentifierBriefDto. # noqa: E501 + :type: int + """ + + self._query_id = query_id + + @property + def last_modified(self): + """Gets the last_modified of this IdentifierBriefDto. # noqa: E501 + + + :return: The last_modified of this IdentifierBriefDto. # noqa: E501 + :rtype: datetime + """ + return self._last_modified + + @last_modified.setter + def last_modified(self, last_modified): + """Sets the last_modified of this IdentifierBriefDto. + + + :param last_modified: The last_modified of this IdentifierBriefDto. # 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(IdentifierBriefDto, 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, IdentifierBriefDto): + 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 new file mode 100644 index 0000000000000000000000000000000000000000..72b5f5e29b762116b7c11edd6a70ba39dd500aad --- /dev/null +++ b/swagger/api/api_database/models/identifier_dto.py @@ -0,0 +1,794 @@ +# 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 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', + 'creator': 'UserDto', + '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', + 'creator': 'creator', + '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, 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 + """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._creator = 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 + self.creator = creator + 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 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 + + + :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_database/models/related_identifier_dto.py b/swagger/api/api_database/models/related_identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..5742b421d56ec2876f3c4fcf063fb3e9e114b30b --- /dev/null +++ b/swagger/api/api_database/models/related_identifier_dto.py @@ -0,0 +1,281 @@ +# 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 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', + 'deleted': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'value': 'value', + '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 + """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 + self.value = value + if type is not None: + self.type = type + 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 + + @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 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 + + + :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_database/models/user_dto.py b/swagger/api/api_database/models/user_dto.py index fef246bbae7e509d86e14142176a3fb235fa5d89..46206a4a60b0d254b5f407d9a758a1ca87199bb0 100644 --- a/swagger/api/api_database/models/user_dto.py +++ b/swagger/api/api_database/models/user_dto.py @@ -155,6 +155,7 @@ class UserDto(object): 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 @@ -165,6 +166,7 @@ class UserDto(object): 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 diff --git a/swagger/api/api_identifier/api/identifier_endpoint_api.py b/swagger/api/api_identifier/api/identifier_endpoint_api.py index c481c9ff454520d489156ea4d9e1c2ba6840c353..7dee02a333d5089b86feecf4bc2c39f81eeb9bcf 100644 --- a/swagger/api/api_identifier/api/identifier_endpoint_api.py +++ b/swagger/api/api_identifier/api/identifier_endpoint_api.py @@ -32,49 +32,45 @@ class IdentifierEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def create(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + def create(self, body, authorization, **kwargs): # noqa: E501 """Create identifier # 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, authorization, id, database_id, async_req=True) + >>> thread = api.create(body, authorization, async_req=True) >>> result = thread.get() :param async_req bool :param IdentifierCreateDto body: (required) :param str authorization: (required) - :param int id: (required) - :param int database_id: (required) :return: IdentifierDto 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, authorization, id, database_id, **kwargs) # noqa: E501 + return self.create_with_http_info(body, authorization, **kwargs) # noqa: E501 else: - (data) = self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + (data) = self.create_with_http_info(body, authorization, **kwargs) # noqa: E501 return data - def create_with_http_info(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + def create_with_http_info(self, body, authorization, **kwargs): # noqa: E501 """Create identifier # 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, authorization, id, database_id, async_req=True) + >>> thread = api.create_with_http_info(body, authorization, async_req=True) >>> result = thread.get() :param async_req bool :param IdentifierCreateDto body: (required) :param str authorization: (required) - :param int id: (required) - :param int database_id: (required) :return: IdentifierDto If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'authorization', 'id', 'database_id'] # noqa: E501 + all_params = ['body', 'authorization'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -97,22 +93,10 @@ class IdentifierEndpointApi(object): if ('authorization' not in params or params['authorization'] is None): raise ValueError("Missing the required parameter `authorization` 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 - # 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 `create`") # 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 query_params = [] @@ -138,7 +122,7 @@ class IdentifierEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/identifier', 'POST', + '/api/identifier', 'POST', path_params, query_params, header_params, @@ -153,47 +137,43 @@ class IdentifierEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def delete(self, id, database_id, identifer_id, **kwargs): # noqa: E501 + def delete(self, id, **kwargs): # noqa: E501 """Delete some identifer # 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(id, database_id, identifer_id, async_req=True) + >>> thread = api.delete(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) - :param int database_id: (required) - :param int identifer_id: (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.delete_with_http_info(id, database_id, identifer_id, **kwargs) # noqa: E501 + return self.delete_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.delete_with_http_info(id, database_id, identifer_id, **kwargs) # noqa: E501 + (data) = self.delete_with_http_info(id, **kwargs) # noqa: E501 return data - def delete_with_http_info(self, id, database_id, identifer_id, **kwargs): # noqa: E501 + def delete_with_http_info(self, id, **kwargs): # noqa: E501 """Delete some identifer # 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(id, database_id, identifer_id, async_req=True) + >>> thread = api.delete_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) - :param int database_id: (required) - :param int identifer_id: (required) :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'identifer_id'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -212,26 +192,14 @@ class IdentifierEndpointApi(object): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `delete`") # 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 `delete`") # noqa: E501 - # verify the required parameter 'identifer_id' is set - if ('identifer_id' not in params or - params['identifer_id'] is None): - raise ValueError("Missing the required parameter `identifer_id` when calling `delete`") # 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 query_params = [] - if 'identifer_id' in params: - query_params.append(('identiferId', params['identifer_id'])) # noqa: E501 + if 'id' in params: + query_params.append(('id', params['id'])) # noqa: E501 header_params = {} @@ -247,7 +215,7 @@ class IdentifierEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/identifier/{identiferId}', 'DELETE', + '/api/identifier/{id}', 'DELETE', path_params, query_params, header_params, @@ -262,47 +230,43 @@ class IdentifierEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def export(self, id, database_id, identifier_id, **kwargs): # noqa: E501 + 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, database_id, identifier_id, async_req=True) + >>> thread = api.export(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) - :param int database_id: (required) - :param int identifier_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, database_id, identifier_id, **kwargs) # noqa: E501 + return self.export_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.export_with_http_info(id, database_id, identifier_id, **kwargs) # noqa: E501 + (data) = self.export_with_http_info(id, **kwargs) # noqa: E501 return data - def export_with_http_info(self, id, database_id, identifier_id, **kwargs): # noqa: E501 + 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, database_id, identifier_id, async_req=True) + >>> thread = api.export_with_http_info(id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) - :param int database_id: (required) - :param int identifier_id: (required) :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'identifier_id'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -321,24 +285,12 @@ class IdentifierEndpointApi(object): if ('id' not in params or params['id'] is None): raise ValueError("Missing the required parameter `id` when calling `export`") # 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 `export`") # noqa: E501 - # verify the required parameter 'identifier_id' is set - if ('identifier_id' not in params or - params['identifier_id'] is None): - raise ValueError("Missing the required parameter `identifier_id` when calling `export`") # 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 'identifier_id' in params: - path_params['identifierId'] = params['identifier_id'] # noqa: E501 query_params = [] @@ -356,7 +308,7 @@ class IdentifierEndpointApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/identifier/{identifierId}', 'GET', + '/api/identifier/{id}', 'GET', path_params, query_params, header_params, @@ -371,17 +323,16 @@ class IdentifierEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all(self, id, database_id, **kwargs): # noqa: E501 + def list(self, **kwargs): # noqa: E501 """Find identifiers # 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.list(async_req=True) >>> result = thread.get() :param async_req bool - :param int id: (required) - :param int database_id: (required) + :param int dbid: :param int qid: :return: list[IdentifierDto] If the method is called asynchronously, @@ -389,29 +340,28 @@ class IdentifierEndpointApi(object): """ 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.list_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.list_with_http_info(**kwargs) # noqa: E501 return data - def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + def list_with_http_info(self, **kwargs): # noqa: E501 """Find identifiers # 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.list_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param int id: (required) - :param int database_id: (required) + :param int dbid: :param int qid: :return: list[IdentifierDto] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'qid'] # noqa: E501 + all_params = ['dbid', 'qid'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -422,28 +372,18 @@ class IdentifierEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_all" % key + " to method list" % 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 - # 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 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 query_params = [] + if 'dbid' in params: + query_params.append(('dbid', params['dbid'])) # noqa: E501 if 'qid' in params: query_params.append(('qid', params['qid'])) # noqa: E501 @@ -461,7 +401,7 @@ class IdentifierEndpointApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/identifier', 'GET', + '/api/identifier', 'GET', path_params, query_params, header_params, @@ -476,49 +416,45 @@ class IdentifierEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def update(self, body, identifer_id, id, database_id, **kwargs): # noqa: E501 + def update(self, body, id, **kwargs): # noqa: E501 """Update some identifier # 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, identifer_id, id, database_id, async_req=True) + >>> thread = api.update(body, id, async_req=True) >>> result = thread.get() :param async_req bool :param IdentifierDto body: (required) - :param int identifer_id: (required) :param int id: (required) - :param int database_id: (required) :return: IdentifierDto 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, identifer_id, id, database_id, **kwargs) # noqa: E501 + return self.update_with_http_info(body, id, **kwargs) # noqa: E501 else: - (data) = self.update_with_http_info(body, identifer_id, id, database_id, **kwargs) # noqa: E501 + (data) = self.update_with_http_info(body, id, **kwargs) # noqa: E501 return data - def update_with_http_info(self, body, identifer_id, id, database_id, **kwargs): # noqa: E501 + def update_with_http_info(self, body, id, **kwargs): # noqa: E501 """Update some identifier # 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, identifer_id, id, database_id, async_req=True) + >>> thread = api.update_with_http_info(body, id, async_req=True) >>> result = thread.get() :param async_req bool :param IdentifierDto body: (required) - :param int identifer_id: (required) :param int id: (required) - :param int database_id: (required) :return: IdentifierDto If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'identifer_id', 'id', 'database_id'] # noqa: E501 + all_params = ['body', 'id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -537,30 +473,18 @@ class IdentifierEndpointApi(object): 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 'identifer_id' is set - if ('identifer_id' not in params or - params['identifer_id'] is None): - raise ValueError("Missing the required parameter `identifer_id` 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 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 query_params = [] - if 'identifer_id' in params: - query_params.append(('identiferId', params['identifer_id'])) # noqa: E501 + if 'id' in params: + query_params.append(('id', params['id'])) # noqa: E501 header_params = {} @@ -582,7 +506,7 @@ class IdentifierEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/identifier/{identiferId}', 'PUT', + '/api/identifier/{id}', 'PUT', path_params, query_params, header_params, diff --git a/swagger/api/api_identifier/api/persistence_endpoint_api.py b/swagger/api/api_identifier/api/persistence_endpoint_api.py index 46af546da5338e05cc0aeaf948762e7794efb1fe..4106bd5ee8b2758419669e02ec78b26f51bad304 100644 --- a/swagger/api/api_identifier/api/persistence_endpoint_api.py +++ b/swagger/api/api_identifier/api/persistence_endpoint_api.py @@ -32,43 +32,45 @@ class PersistenceEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def find(self, pid, **kwargs): # noqa: E501 + def find(self, pid, accept, **kwargs): # noqa: E501 """Find some identifier # 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(pid, async_req=True) + >>> thread = api.find(pid, accept, async_req=True) >>> result = thread.get() :param async_req bool :param int pid: (required) - :return: IdentifierDto + :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.find_with_http_info(pid, **kwargs) # noqa: E501 + return self.find_with_http_info(pid, accept, **kwargs) # noqa: E501 else: - (data) = self.find_with_http_info(pid, **kwargs) # noqa: E501 + (data) = self.find_with_http_info(pid, accept, **kwargs) # noqa: E501 return data - def find_with_http_info(self, pid, **kwargs): # noqa: E501 + def find_with_http_info(self, pid, accept, **kwargs): # noqa: E501 """Find some identifier # 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(pid, async_req=True) + >>> thread = api.find_with_http_info(pid, accept, async_req=True) >>> result = thread.get() :param async_req bool :param int pid: (required) - :return: IdentifierDto + :param str accept: (required) + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['pid'] # noqa: E501 + all_params = ['pid', 'accept'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -87,6 +89,10 @@ class PersistenceEndpointApi(object): if ('pid' not in params or params['pid'] is None): raise ValueError("Missing the required parameter `pid` when calling `find`") # 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 `find`") # noqa: E501 collection_formats = {} @@ -97,6 +103,8 @@ class PersistenceEndpointApi(object): query_params = [] header_params = {} + if 'accept' in params: + header_params['Accept'] = params['accept'] # noqa: E501 form_params = [] local_var_files = {} @@ -117,7 +125,7 @@ class PersistenceEndpointApi(object): body=body_params, post_params=form_params, files=local_var_files, - response_type='IdentifierDto', # 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_identifier/models/database_dto.py b/swagger/api/api_identifier/models/database_dto.py index 8e46079b68f82175ab2c44a7932b08fe919322f2..c5ca2f52a32be5eba5c11e65f5ce440915e6a502 100644 --- a/swagger/api/api_identifier/models/database_dto.py +++ b/swagger/api/api_identifier/models/database_dto.py @@ -32,20 +32,14 @@ class DatabaseDto(object): 'name': 'str', 'exchange': 'str', 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', + 'identifier': 'IdentifierDto', 'description': 'str', - 'publisher': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication_year': 'int', - 'publication_month': 'int', - 'publication_day': 'int', 'is_public': 'bool' } @@ -54,59 +48,41 @@ class DatabaseDto(object): 'name': 'name', 'exchange': 'exchange', 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', + 'identifier': 'identifier', 'description': 'description', - 'publisher': 'publisher', 'tables': 'tables', 'image': 'image', 'container': 'container', 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'publication_month': 'publication_month', - 'publication_day': 'publication_day', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_public=None): # noqa: E501 + 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 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._exchange = None self._creator = None - self._subjects = None - self._language = None - self._license = None + self._identifier = None self._description = None - self._publisher = None self._tables = None self._image = None self._container = None self._created = None self._deleted = None self._internal_name = None - self._publication_year = None - self._publication_month = None - self._publication_day = None self._is_public = None self.discriminator = None self.id = id self.name = name self.exchange = exchange self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license + if identifier is not None: + self.identifier = identifier if description is not None: self.description = description - if publisher is not None: - self.publisher = publisher if tables is not None: self.tables = tables if image is not None: @@ -118,12 +94,6 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication_year is not None: - 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 is_public is not None: self.is_public = is_public @@ -220,73 +190,25 @@ class DatabaseDto(object): self._creator = creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def identifier(self): + """Gets the identifier of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 - :rtype: list[str] + :return: The identifier of this DatabaseDto. # noqa: E501 + :rtype: IdentifierDto """ - return self._subjects + return self._identifier - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 - :type: list[str] + :param identifier: The identifier of this DatabaseDto. # noqa: E501 + :type: IdentifierDto """ - self._subjects = subjects - - @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 - - - :return: The language of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._language - - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. - - - :param language: The language of this DatabaseDto. # 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 DatabaseDto. # noqa: E501 - - - :return: The license of this DatabaseDto. # noqa: E501 - :rtype: LicenseDto - """ - return self._license - - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. - - - :param license: The license of this DatabaseDto. # noqa: E501 - :type: LicenseDto - """ - - self._license = license + self._identifier = identifier @property def description(self): @@ -309,27 +231,6 @@ class DatabaseDto(object): self._description = description - @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 - - - :return: The publisher of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._publisher - - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. - - - :param publisher: The publisher of this DatabaseDto. # noqa: E501 - :type: str - """ - - self._publisher = publisher - @property def tables(self): """Gets the tables of this DatabaseDto. # noqa: E501 @@ -458,69 +359,6 @@ class DatabaseDto(object): self._internal_name = internal_name - @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 - - - :return: The publication_year of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_year - - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. - - - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_year = publication_year - - @property - def publication_month(self): - """Gets the publication_month of this DatabaseDto. # noqa: E501 - - - :return: The publication_month of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_month - - @publication_month.setter - def publication_month(self, publication_month): - """Sets the publication_month of this DatabaseDto. - - - :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_month = publication_month - - @property - def publication_day(self): - """Gets the publication_day of this DatabaseDto. # noqa: E501 - - - :return: The publication_day of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_day - - @publication_day.setter - def publication_day(self, publication_day): - """Sets the publication_day of this DatabaseDto. - - - :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_day = publication_day - @property def is_public(self): """Gets the is_public of this DatabaseDto. # noqa: E501 diff --git a/swagger/api/api_identifier/models/identifier_create_dto.py b/swagger/api/api_identifier/models/identifier_create_dto.py index 80c8790bdcde9549390fc471a5a7bf95228d940d..544501b09801e5e10445dd7f8bdfcff571954f57 100644 --- a/swagger/api/api_identifier/models/identifier_create_dto.py +++ b/swagger/api/api_identifier/models/identifier_create_dto.py @@ -28,12 +28,17 @@ class IdentifierCreateDto(object): and the value is json key in definition. """ swagger_types = { + 'cid': 'int', + 'dbid': 'int', 'qid': 'int', + 'type': 'str', 'title': 'str', 'description': 'str', 'visibility': 'str', 'doi': 'str', 'publisher': 'str', + 'language': 'str', + 'license': 'LicenseDto', 'creators': 'list[CreatorCreateDto]', 'publication_day': 'int', 'publication_month': 'int', @@ -42,12 +47,17 @@ class IdentifierCreateDto(object): } attribute_map = { + 'cid': 'cid', + 'dbid': 'dbid', 'qid': 'qid', + 'type': 'type', 'title': 'title', 'description': 'description', 'visibility': 'visibility', 'doi': 'doi', 'publisher': 'publisher', + 'language': 'language', + 'license': 'license', 'creators': 'creators', 'publication_day': 'publication_day', 'publication_month': 'publication_month', @@ -55,28 +65,42 @@ class IdentifierCreateDto(object): 'related_identifiers': 'related_identifiers' } - def __init__(self, qid=None, title=None, description=None, visibility=None, doi=None, publisher=None, creators=None, publication_day=None, publication_month=None, publication_year=None, related_identifiers=None): # noqa: E501 + def __init__(self, cid=None, dbid=None, qid=None, type=None, title=None, description=None, visibility=None, doi=None, publisher=None, language=None, license=None, creators=None, publication_day=None, publication_month=None, publication_year=None, related_identifiers=None): # noqa: E501 """IdentifierCreateDto - a model defined in Swagger""" # noqa: E501 + self._cid = None + self._dbid = None self._qid = None + self._type = None self._title = None self._description = None self._visibility = None self._doi = None self._publisher = None + self._language = None + self._license = None self._creators = None self._publication_day = None self._publication_month = None self._publication_year = None self._related_identifiers = None self.discriminator = None - self.qid = qid + self.cid = cid + self.dbid = dbid + if qid is not None: + self.qid = qid + self.type = type self.title = title - self.description = description + if description is not None: + self.description = description 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 publication_day is not None: self.publication_day = publication_day @@ -86,6 +110,52 @@ class IdentifierCreateDto(object): if related_identifiers is not None: self.related_identifiers = related_identifiers + @property + def cid(self): + """Gets the cid of this IdentifierCreateDto. # noqa: E501 + + + :return: The cid of this IdentifierCreateDto. # noqa: E501 + :rtype: int + """ + return self._cid + + @cid.setter + def cid(self, cid): + """Sets the cid of this IdentifierCreateDto. + + + :param cid: The cid of this IdentifierCreateDto. # noqa: E501 + :type: int + """ + if cid is None: + raise ValueError("Invalid value for `cid`, must not be `None`") # noqa: E501 + + self._cid = cid + + @property + def dbid(self): + """Gets the dbid of this IdentifierCreateDto. # noqa: E501 + + + :return: The dbid of this IdentifierCreateDto. # noqa: E501 + :rtype: int + """ + return self._dbid + + @dbid.setter + def dbid(self, dbid): + """Sets the dbid of this IdentifierCreateDto. + + + :param dbid: The dbid of this IdentifierCreateDto. # noqa: E501 + :type: int + """ + if dbid is None: + raise ValueError("Invalid value for `dbid`, must not be `None`") # noqa: E501 + + self._dbid = dbid + @property def qid(self): """Gets the qid of this IdentifierCreateDto. # noqa: E501 @@ -104,11 +174,38 @@ class IdentifierCreateDto(object): :param qid: The qid of this IdentifierCreateDto. # noqa: E501 :type: int """ - if qid is None: - raise ValueError("Invalid value for `qid`, must not be `None`") # noqa: E501 self._qid = qid + @property + def type(self): + """Gets the type of this IdentifierCreateDto. # noqa: E501 + + + :return: The type of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this IdentifierCreateDto. + + + :param type: The type of this IdentifierCreateDto. # 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 IdentifierCreateDto. # noqa: E501 @@ -150,8 +247,6 @@ class IdentifierCreateDto(object): :param description: The description of this IdentifierCreateDto. # noqa: E501 :type: str """ - if description is None: - raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 self._description = description @@ -226,6 +321,54 @@ class IdentifierCreateDto(object): self._publisher = publisher + @property + def language(self): + """Gets the language of this IdentifierCreateDto. # noqa: E501 + + + :return: The language of this IdentifierCreateDto. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this IdentifierCreateDto. + + + :param language: The language of this IdentifierCreateDto. # 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 IdentifierCreateDto. # noqa: E501 + + + :return: The license of this IdentifierCreateDto. # noqa: E501 + :rtype: LicenseDto + """ + return self._license + + @license.setter + def license(self, license): + """Sets the license of this IdentifierCreateDto. + + + :param license: The license of this IdentifierCreateDto. # noqa: E501 + :type: LicenseDto + """ + + self._license = license + @property def creators(self): """Gets the creators of this IdentifierCreateDto. # noqa: E501 diff --git a/swagger/api/api_identifier/models/identifier_dto.py b/swagger/api/api_identifier/models/identifier_dto.py index 5014eb258bb12393dd9a2431e1f8a9fa5d78bc86..7928313c8e56d3723ec0717fbd143b71ece18ff4 100644 --- a/swagger/api/api_identifier/models/identifier_dto.py +++ b/swagger/api/api_identifier/models/identifier_dto.py @@ -29,9 +29,7 @@ class IdentifierDto(object): """ swagger_types = { 'id': 'int', - 'cid': 'int', - 'dbid': 'int', - 'qid': 'int', + 'type': 'str', 'title': 'str', 'description': 'str', 'query': 'str', @@ -40,8 +38,13 @@ class IdentifierDto(object): 'doi': 'str', 'publisher': 'str', 'creator': 'UserDto', + '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', @@ -55,9 +58,7 @@ class IdentifierDto(object): attribute_map = { 'id': 'id', - 'cid': 'cid', - 'dbid': 'dbid', - 'qid': 'qid', + 'type': 'type', 'title': 'title', 'description': 'description', 'query': 'query', @@ -66,8 +67,13 @@ class IdentifierDto(object): 'doi': 'doi', 'publisher': 'publisher', 'creator': 'creator', + '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', @@ -79,12 +85,10 @@ class IdentifierDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, cid=None, dbid=None, qid=None, title=None, description=None, query=None, execution=None, visibility=None, doi=None, publisher=None, creator=None, creators=None, created=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, 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 """IdentifierDto - a model defined in Swagger""" # noqa: E501 self._id = None - self._cid = None - self._dbid = None - self._qid = None + self._type = None self._title = None self._description = None self._query = None @@ -93,8 +97,13 @@ class IdentifierDto(object): self._doi = None self._publisher = None self._creator = 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 @@ -107,11 +116,10 @@ class IdentifierDto(object): self.discriminator = None if id is not None: self.id = id - self.cid = cid - self.dbid = dbid - self.qid = qid + self.type = type self.title = title - self.description = description + if description is not None: + self.description = description self.query = query self.execution = execution self.visibility = visibility @@ -120,9 +128,17 @@ class IdentifierDto(object): if publisher is not None: self.publisher = publisher self.creator = creator + 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 @@ -159,73 +175,33 @@ class IdentifierDto(object): self._id = id @property - def cid(self): - """Gets the cid of this IdentifierDto. # noqa: E501 + def type(self): + """Gets the type of this IdentifierDto. # noqa: E501 - :return: The cid of this IdentifierDto. # noqa: E501 - :rtype: int - """ - return self._cid - - @cid.setter - def cid(self, cid): - """Sets the cid of this IdentifierDto. - - - :param cid: The cid of this IdentifierDto. # noqa: E501 - :type: int - """ - if cid is None: - raise ValueError("Invalid value for `cid`, must not be `None`") # noqa: E501 - - self._cid = cid - - @property - def dbid(self): - """Gets the dbid of this IdentifierDto. # noqa: E501 - - - :return: The dbid of this IdentifierDto. # noqa: E501 - :rtype: int - """ - return self._dbid - - @dbid.setter - def dbid(self, dbid): - """Sets the dbid of this IdentifierDto. - - - :param dbid: The dbid of this IdentifierDto. # noqa: E501 - :type: int - """ - if dbid is None: - raise ValueError("Invalid value for `dbid`, must not be `None`") # noqa: E501 - - self._dbid = dbid - - @property - def qid(self): - """Gets the qid of this IdentifierDto. # noqa: E501 - - - :return: The qid of this IdentifierDto. # noqa: E501 - :rtype: int + :return: The type of this IdentifierDto. # noqa: E501 + :rtype: str """ - return self._qid + return self._type - @qid.setter - def qid(self, qid): - """Sets the qid of this IdentifierDto. + @type.setter + def type(self, type): + """Sets the type of this IdentifierDto. - :param qid: The qid of this IdentifierDto. # noqa: E501 - :type: int + :param type: The type of this IdentifierDto. # noqa: E501 + :type: str """ - if qid is None: - raise ValueError("Invalid value for `qid`, must not be `None`") # noqa: E501 + 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._qid = qid + self._type = type @property def title(self): @@ -268,8 +244,6 @@ class IdentifierDto(object): :param description: The description of this IdentifierDto. # noqa: E501 :type: str """ - if description is None: - raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 self._description = description @@ -413,6 +387,54 @@ class IdentifierDto(object): self._creator = creator + @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 @@ -457,6 +479,73 @@ class IdentifierDto(object): 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 diff --git a/swagger/api/api_metadata/__init__.py b/swagger/api/api_metadata/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0c6354f338d49a7463978865856feeb57efb62e1 --- /dev/null +++ b/swagger/api/api_metadata/__init__.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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_metadata.api.metadata_endpoint_api import MetadataEndpointApi +# import ApiClient +from api_metadata.api_client import ApiClient +from api_metadata.configuration import Configuration +# import models into sdk package +from api_metadata.models.api_error_dto import ApiErrorDto +from api_metadata.models.oai_list_identifiers_parameters import OaiListIdentifiersParameters diff --git a/swagger/api/api_metadata/api/__init__.py b/swagger/api/api_metadata/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3b53275ce79733f9cdc9004ce857198382fe4581 --- /dev/null +++ b/swagger/api/api_metadata/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from api_metadata.api.metadata_endpoint_api import MetadataEndpointApi diff --git a/swagger/api/api_metadata/api/metadata_endpoint_api.py b/swagger/api/api_metadata/api/metadata_endpoint_api.py new file mode 100644 index 0000000000000000000000000000000000000000..81440a85e2d8c4ecc062b1ccc0ede4581bf7128d --- /dev/null +++ b/swagger/api/api_metadata/api/metadata_endpoint_api.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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_metadata.api_client import ApiClient + + +class MetadataEndpointApi(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 identify1111(self, parameters, **kwargs): # noqa: E501 + """Get the record # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.identify1111(parameters, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OaiListIdentifiersParameters parameters: (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.identify1111_with_http_info(parameters, **kwargs) # noqa: E501 + else: + (data) = self.identify1111_with_http_info(parameters, **kwargs) # noqa: E501 + return data + + def identify1111_with_http_info(self, parameters, **kwargs): # noqa: E501 + """Get the record # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.identify1111_with_http_info(parameters, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param OaiListIdentifiersParameters parameters: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['parameters'] # 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 identify1111" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'parameters' is set + if ('parameters' not in params or + params['parameters'] is None): + raise ValueError("Missing the required parameter `parameters` when calling `identify1111`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'parameters' in params: + query_params.append(('parameters', params['parameters'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['*/*', 'text/xml;charset=UTF-8']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/api/oai', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/swagger/api/api_metadata/api_client.py b/swagger/api/api_metadata/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..168f238b4171ba853004d84752621f479abf7b72 --- /dev/null +++ b/swagger/api/api_metadata/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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_metadata.configuration import Configuration +import api_metadata.models +from api_metadata 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_metadata.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_metadata/configuration.py b/swagger/api/api_metadata/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..d8a184c34fee46c235812aaab9526ff9498ecf36 --- /dev/null +++ b/swagger/api/api_metadata/configuration.py @@ -0,0 +1,244 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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_metadata") + 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_metadata/models/__init__.py b/swagger/api/api_metadata/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..34635d40714338c78d7592d16bc725b35dd6cf27 --- /dev/null +++ b/swagger/api/api_metadata/models/__init__.py @@ -0,0 +1,18 @@ +# coding: utf-8 + +# flake8: noqa +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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_metadata.models.api_error_dto import ApiErrorDto +from api_metadata.models.oai_list_identifiers_parameters import OaiListIdentifiersParameters diff --git a/swagger/api/api_metadata/models/api_error_dto.py b/swagger/api/api_metadata/models/api_error_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..abd6a183deba10bc3700d4dfa2cb7ded7be7aa8a --- /dev/null +++ b/swagger/api/api_metadata/models/api_error_dto.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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 ApiErrorDto(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 = { + 'status': 'str', + 'message': 'str', + 'code': 'str' + } + + attribute_map = { + 'status': 'status', + 'message': 'message', + 'code': 'code' + } + + def __init__(self, status=None, message=None, code=None): # noqa: E501 + """ApiErrorDto - a model defined in Swagger""" # noqa: E501 + self._status = None + self._message = None + self._code = None + self.discriminator = None + self.status = status + self.message = message + self.code = code + + @property + def status(self): + """Gets the status of this ApiErrorDto. # noqa: E501 + + + :return: The status of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ApiErrorDto. + + + :param status: The status of this ApiErrorDto. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + allowed_values = ["100 CONTINUE", "101 SWITCHING_PROTOCOLS", "102 PROCESSING", "103 CHECKPOINT", "200 OK", "201 CREATED", "202 ACCEPTED", "203 NON_AUTHORITATIVE_INFORMATION", "204 NO_CONTENT", "205 RESET_CONTENT", "206 PARTIAL_CONTENT", "207 MULTI_STATUS", "208 ALREADY_REPORTED", "226 IM_USED", "300 MULTIPLE_CHOICES", "301 MOVED_PERMANENTLY", "302 FOUND", "302 MOVED_TEMPORARILY", "303 SEE_OTHER", "304 NOT_MODIFIED", "305 USE_PROXY", "307 TEMPORARY_REDIRECT", "308 PERMANENT_REDIRECT", "400 BAD_REQUEST", "401 UNAUTHORIZED", "402 PAYMENT_REQUIRED", "403 FORBIDDEN", "404 NOT_FOUND", "405 METHOD_NOT_ALLOWED", "406 NOT_ACCEPTABLE", "407 PROXY_AUTHENTICATION_REQUIRED", "408 REQUEST_TIMEOUT", "409 CONFLICT", "410 GONE", "411 LENGTH_REQUIRED", "412 PRECONDITION_FAILED", "413 PAYLOAD_TOO_LARGE", "413 REQUEST_ENTITY_TOO_LARGE", "414 URI_TOO_LONG", "414 REQUEST_URI_TOO_LONG", "415 UNSUPPORTED_MEDIA_TYPE", "416 REQUESTED_RANGE_NOT_SATISFIABLE", "417 EXPECTATION_FAILED", "418 I_AM_A_TEAPOT", "419 INSUFFICIENT_SPACE_ON_RESOURCE", "420 METHOD_FAILURE", "421 DESTINATION_LOCKED", "422 UNPROCESSABLE_ENTITY", "423 LOCKED", "424 FAILED_DEPENDENCY", "425 TOO_EARLY", "426 UPGRADE_REQUIRED", "428 PRECONDITION_REQUIRED", "429 TOO_MANY_REQUESTS", "431 REQUEST_HEADER_FIELDS_TOO_LARGE", "451 UNAVAILABLE_FOR_LEGAL_REASONS", "500 INTERNAL_SERVER_ERROR", "501 NOT_IMPLEMENTED", "502 BAD_GATEWAY", "503 SERVICE_UNAVAILABLE", "504 GATEWAY_TIMEOUT", "505 HTTP_VERSION_NOT_SUPPORTED", "506 VARIANT_ALSO_NEGOTIATES", "507 INSUFFICIENT_STORAGE", "508 LOOP_DETECTED", "509 BANDWIDTH_LIMIT_EXCEEDED", "510 NOT_EXTENDED", "511 NETWORK_AUTHENTICATION_REQUIRED"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def message(self): + """Gets the message of this ApiErrorDto. # noqa: E501 + + + :return: The message of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiErrorDto. + + + :param message: The message of this ApiErrorDto. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + @property + def code(self): + """Gets the code of this ApiErrorDto. # noqa: E501 + + + :return: The code of this ApiErrorDto. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this ApiErrorDto. + + + :param code: The code of this ApiErrorDto. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + 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(ApiErrorDto, 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, ApiErrorDto): + 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_metadata/models/oai_list_identifiers_parameters.py b/swagger/api/api_metadata/models/oai_list_identifiers_parameters.py new file mode 100644 index 0000000000000000000000000000000000000000..4ed5d2ccb5930e91f7ab902e582327cefd534dce --- /dev/null +++ b/swagger/api/api_metadata/models/oai_list_identifiers_parameters.py @@ -0,0 +1,292 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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 OaiListIdentifiersParameters(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 = { + 'metadata_prefix': 'str', + '_from': 'str', + 'until': 'str', + 'set': 'str', + 'resumption_token': 'str', + 'from_date': 'datetime', + 'parameters_string': 'str', + 'until_date': 'datetime' + } + + attribute_map = { + 'metadata_prefix': 'metadataPrefix', + '_from': 'from', + 'until': 'until', + 'set': 'set', + 'resumption_token': 'resumptionToken', + 'from_date': 'fromDate', + 'parameters_string': 'parametersString', + 'until_date': 'untilDate' + } + + def __init__(self, metadata_prefix=None, _from=None, until=None, set=None, resumption_token=None, from_date=None, parameters_string=None, until_date=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._from_date = None + self._parameters_string = None + self._until_date = None + self.discriminator = None + if metadata_prefix is not None: + self.metadata_prefix = metadata_prefix + if _from is not None: + self._from = _from + if until is not None: + self.until = until + if set is not None: + self.set = set + if resumption_token is not None: + self.resumption_token = resumption_token + if from_date is not None: + self.from_date = from_date + if parameters_string is not None: + self.parameters_string = parameters_string + if until_date is not None: + self.until_date = until_date + + @property + def metadata_prefix(self): + """Gets the metadata_prefix of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The metadata_prefix of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._metadata_prefix + + @metadata_prefix.setter + def metadata_prefix(self, metadata_prefix): + """Sets the metadata_prefix of this OaiListIdentifiersParameters. + + + :param metadata_prefix: The metadata_prefix of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._metadata_prefix = metadata_prefix + + @property + def _from(self): + """Gets the _from of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The _from of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this OaiListIdentifiersParameters. + + + :param _from: The _from of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self.__from = _from + + @property + def until(self): + """Gets the until of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The until of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._until + + @until.setter + def until(self, until): + """Sets the until of this OaiListIdentifiersParameters. + + + :param until: The until of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._until = until + + @property + def set(self): + """Gets the set of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The set of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._set + + @set.setter + def set(self, set): + """Sets the set of this OaiListIdentifiersParameters. + + + :param set: The set of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._set = set + + @property + def resumption_token(self): + """Gets the resumption_token of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The resumption_token of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: str + """ + return self._resumption_token + + @resumption_token.setter + def resumption_token(self, resumption_token): + """Sets the resumption_token of this OaiListIdentifiersParameters. + + + :param resumption_token: The resumption_token of this OaiListIdentifiersParameters. # noqa: E501 + :type: str + """ + + self._resumption_token = resumption_token + + @property + def from_date(self): + """Gets the from_date of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The from_date of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: datetime + """ + return self._from_date + + @from_date.setter + def from_date(self, from_date): + """Sets the from_date of this OaiListIdentifiersParameters. + + + :param from_date: The from_date of this OaiListIdentifiersParameters. # noqa: E501 + :type: datetime + """ + + self._from_date = from_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 + + @property + def until_date(self): + """Gets the until_date of this OaiListIdentifiersParameters. # noqa: E501 + + + :return: The until_date of this OaiListIdentifiersParameters. # noqa: E501 + :rtype: datetime + """ + return self._until_date + + @until_date.setter + def until_date(self, until_date): + """Sets the until_date of this OaiListIdentifiersParameters. + + + :param until_date: The until_date of this OaiListIdentifiersParameters. # noqa: E501 + :type: datetime + """ + + self._until_date = until_date + + 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(OaiListIdentifiersParameters, 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, OaiListIdentifiersParameters): + 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_metadata/rest.py b/swagger/api/api_metadata/rest.py new file mode 100644 index 0000000000000000000000000000000000000000..886644736010d4e652a34f9006bb2aa7249ca900 --- /dev/null +++ b/swagger/api/api_metadata/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + Database Repository Metadata Service API + + Service that manages the metadata # 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_query/__init__.py b/swagger/api/api_query/__init__.py index 142aed7fbc0ce87c14d0410efc89eb10a809f156..d404e920f66c58cccdfd9db0e0b3cebd75468b1d 100644 --- a/swagger/api/api_query/__init__.py +++ b/swagger/api/api_query/__init__.py @@ -20,15 +20,18 @@ from api_query.api.query_endpoint_api import QueryEndpointApi from api_query.api.store_endpoint_api import StoreEndpointApi from api_query.api.table_data_endpoint_api import TableDataEndpointApi from api_query.api.table_history_endpoint_api import TableHistoryEndpointApi +from api_query.api.view_endpoint_api import ViewEndpointApi # import ApiClient from api_query.api_client import ApiClient from api_query.configuration import Configuration # import models into sdk package 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_dto import DatabaseDto from api_query.models.execute_statement_dto import ExecuteStatementDto from api_query.models.granted_authority_dto import GrantedAuthorityDto +from api_query.models.identifier_dto import IdentifierDto from api_query.models.image_brief_dto import ImageBriefDto from api_query.models.image_date_dto import ImageDateDto from api_query.models.image_dto import ImageDto @@ -38,6 +41,7 @@ from api_query.models.license_dto import LicenseDto from api_query.models.query_brief_dto import QueryBriefDto from api_query.models.query_dto import QueryDto from api_query.models.query_result_dto import QueryResultDto +from api_query.models.related_identifier_dto import RelatedIdentifierDto from api_query.models.table_brief_dto import TableBriefDto from api_query.models.table_csv_delete_dto import TableCsvDeleteDto from api_query.models.table_csv_dto import TableCsvDto @@ -45,3 +49,6 @@ from api_query.models.table_csv_update_dto import TableCsvUpdateDto from api_query.models.table_history_dto import TableHistoryDto from api_query.models.user_brief_dto import UserBriefDto from api_query.models.user_dto import UserDto +from api_query.models.view_brief_dto import ViewBriefDto +from api_query.models.view_create_dto import ViewCreateDto +from api_query.models.view_dto import ViewDto diff --git a/swagger/api/api_query/api/__init__.py b/swagger/api/api_query/api/__init__.py index b644b1438d02bcc510ef2c6c6cb3b93b50d5b76b..eef04da51c4146f817c9fd0aafcf53dce05dd4d9 100644 --- a/swagger/api/api_query/api/__init__.py +++ b/swagger/api/api_query/api/__init__.py @@ -8,3 +8,4 @@ from api_query.api.query_endpoint_api import QueryEndpointApi from api_query.api.store_endpoint_api import StoreEndpointApi from api_query.api.table_data_endpoint_api import TableDataEndpointApi from api_query.api.table_history_endpoint_api import TableHistoryEndpointApi +from api_query.api.view_endpoint_api import ViewEndpointApi diff --git a/swagger/api/api_query/api/query_endpoint_api.py b/swagger/api/api_query/api/query_endpoint_api.py index a49f8443f997528fac0ab0a110305f7a7799b7dd..1747ab4a2e81fabe39b05fa078729ba13fe08811 100644 --- a/swagger/api/api_query/api/query_endpoint_api.py +++ b/swagger/api/api_query/api/query_endpoint_api.py @@ -46,6 +46,8 @@ class QueryEndpointApi(object): :param int database_id: (required) :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. @@ -71,12 +73,14 @@ class QueryEndpointApi(object): :param int database_id: (required) :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. """ - all_params = ['body', 'id', 'database_id', 'page', 'size'] # noqa: E501 + all_params = ['body', 'id', 'database_id', 'page', 'size', 'sort_direction', 'sort_column'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -117,6 +121,10 @@ class QueryEndpointApi(object): query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 + if 'sort_direction' in params: + query_params.append(('sortDirection', params['sort_direction'])) # noqa: E501 + if 'sort_column' in params: + query_params.append(('sortColumn', params['sort_column'])) # noqa: E501 header_params = {} @@ -165,7 +173,8 @@ class QueryEndpointApi(object): :param int id: (required) :param int database_id: (required) :param int query_id: (required) - :return: str + :param str download: + :return: object If the method is called asynchronously, returns the request thread. """ @@ -188,12 +197,13 @@ class QueryEndpointApi(object): :param int id: (required) :param int database_id: (required) :param int query_id: (required) - :return: str + :param str download: + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'query_id'] # noqa: E501 + all_params = ['id', 'database_id', 'query_id', 'download'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -232,6 +242,8 @@ 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 = {} @@ -254,7 +266,7 @@ class QueryEndpointApi(object): body=body_params, post_params=form_params, files=local_var_files, - response_type='str', # 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'), @@ -276,6 +288,8 @@ class QueryEndpointApi(object): :param int query_id: (required) :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. @@ -301,12 +315,14 @@ class QueryEndpointApi(object): :param int query_id: (required) :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'query_id', 'page', 'size'] # noqa: E501 + all_params = ['id', 'database_id', 'query_id', 'page', 'size', 'sort_direction', 'sort_column'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -349,6 +365,10 @@ class QueryEndpointApi(object): query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 + if 'sort_direction' in params: + query_params.append(('sortDirection', params['sort_direction'])) # noqa: E501 + if 'sort_column' in params: + query_params.append(('sortColumn', params['sort_column'])) # noqa: E501 header_params = {} diff --git a/swagger/api/api_query/api/store_endpoint_api.py b/swagger/api/api_query/api/store_endpoint_api.py index 7915be349dad83de0d555cddfb224ae58b6b36fa..b649aef9251c2e8764e64bd8e21d453f87d0fc46 100644 --- a/swagger/api/api_query/api/store_endpoint_api.py +++ b/swagger/api/api_query/api/store_endpoint_api.py @@ -141,45 +141,47 @@ class StoreEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all(self, id, database_id, **kwargs): # noqa: E501 + def find_all2(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_all(id, database_id, async_req=True) + >>> thread = api.find_all2(id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) + :param bool persisted: :return: list[QueryBriefDto] 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_all2_with_http_info(id, database_id, **kwargs) # noqa: E501 else: - (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.find_all2_with_http_info(id, database_id, **kwargs) # noqa: E501 return data - def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + def find_all2_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_all_with_http_info(id, database_id, async_req=True) + >>> thread = api.find_all2_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 bool persisted: :return: list[QueryBriefDto] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id'] # noqa: E501 + all_params = ['id', 'database_id', 'persisted'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -190,18 +192,18 @@ class StoreEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_all" % key + " to method find_all2" % 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_all2`") # 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_all2`") # noqa: E501 collection_formats = {} @@ -212,6 +214,8 @@ class StoreEndpointApi(object): path_params['databaseId'] = params['database_id'] # noqa: E501 query_params = [] + if 'persisted' in params: + query_params.append(('persisted', params['persisted'])) # noqa: E501 header_params = {} @@ -241,3 +245,112 @@ class StoreEndpointApi(object): _preload_content=params.get('_preload_content', True), _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + + def persist(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Persist 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.persist(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :return: QueryDto + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.persist_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + else: + (data) = self.persist_with_http_info(id, database_id, query_id, **kwargs) # noqa: E501 + return data + + def persist_with_http_info(self, id, database_id, query_id, **kwargs): # noqa: E501 + """Persist 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.persist_with_http_info(id, database_id, query_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int id: (required) + :param int database_id: (required) + :param int query_id: (required) + :return: QueryDto + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'database_id', 'query_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 persist" % 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 `persist`") # 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 `persist`") # 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 `persist`") # 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 'query_id' in params: + path_params['queryId'] = params['query_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}/query/{queryId}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='QueryDto', # 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_query/api/table_data_endpoint_api.py b/swagger/api/api_query/api/table_data_endpoint_api.py index 632bf0023c0c979119e43647dec551cf4bc744ad..d320ecf7d55b32502bc9664e192d60f6ffbd7548 100644 --- a/swagger/api/api_query/api/table_data_endpoint_api.py +++ b/swagger/api/api_query/api/table_data_endpoint_api.py @@ -32,12 +32,12 @@ class TableDataEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def delete(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + def delete1(self, body, id, database_id, table_id, **kwargs): # noqa: E501 """Delete data # 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(body, id, database_id, table_id, async_req=True) + >>> thread = api.delete1(body, id, database_id, table_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -51,17 +51,17 @@ class TableDataEndpointApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.delete_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + return self.delete1_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 else: - (data) = self.delete_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 + (data) = self.delete1_with_http_info(body, id, database_id, table_id, **kwargs) # noqa: E501 return data - def delete_with_http_info(self, body, id, database_id, table_id, **kwargs): # noqa: E501 + def delete1_with_http_info(self, body, id, database_id, table_id, **kwargs): # noqa: E501 """Delete data # 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(body, id, database_id, table_id, async_req=True) + >>> thread = api.delete1_with_http_info(body, id, database_id, table_id, async_req=True) >>> result = thread.get() :param async_req bool @@ -85,26 +85,26 @@ class TableDataEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete" % key + " to method delete1" % 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 `delete`") # noqa: E501 + raise ValueError("Missing the required parameter `body` when calling `delete1`") # 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 + raise ValueError("Missing the required parameter `id` when calling `delete1`") # 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 `delete`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `delete1`") # 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 `delete`") # noqa: E501 + raise ValueError("Missing the required parameter `table_id` when calling `delete1`") # noqa: E501 collection_formats = {} @@ -168,6 +168,8 @@ class TableDataEndpointApi(object): :param datetime timestamp: :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. @@ -194,12 +196,14 @@ class TableDataEndpointApi(object): :param datetime timestamp: :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'table_id', 'timestamp', 'page', 'size'] # noqa: E501 + all_params = ['id', 'database_id', 'table_id', 'timestamp', 'page', 'size', 'sort_direction', 'sort_column'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -244,6 +248,10 @@ class TableDataEndpointApi(object): query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 + if 'sort_direction' in params: + query_params.append(('sortDirection', params['sort_direction'])) # noqa: E501 + if 'sort_column' in params: + query_params.append(('sortColumn', params['sort_column'])) # noqa: E501 header_params = {} @@ -259,7 +267,7 @@ class TableDataEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', path_params, query_params, header_params, @@ -289,6 +297,8 @@ class TableDataEndpointApi(object): :param datetime timestamp: :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. @@ -315,12 +325,14 @@ class TableDataEndpointApi(object): :param datetime timestamp: :param int page: :param int size: + :param str sort_direction: + :param str sort_column: :return: QueryResultDto If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'table_id', 'timestamp', 'page', 'size'] # noqa: E501 + all_params = ['id', 'database_id', 'table_id', 'timestamp', 'page', 'size', 'sort_direction', 'sort_column'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -365,6 +377,10 @@ class TableDataEndpointApi(object): query_params.append(('page', params['page'])) # noqa: E501 if 'size' in params: query_params.append(('size', params['size'])) # noqa: E501 + if 'sort_direction' in params: + query_params.append(('sortDirection', params['sort_direction'])) # noqa: E501 + if 'sort_column' in params: + query_params.append(('sortColumn', params['sort_column'])) # noqa: E501 header_params = {} @@ -380,7 +396,7 @@ class TableDataEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'GET', + '/api/container/{id}/database/{databaseId}/table/{tableId}/data', 'HEAD', path_params, query_params, header_params, diff --git a/swagger/api/api_query/api/table_history_endpoint_api.py b/swagger/api/api_query/api/table_history_endpoint_api.py index f013bf0c6aede1359efe4f36e48a29c1d18215c9..024816773f5d4328cc00116d9c298b48cd860fc9 100644 --- a/swagger/api/api_query/api/table_history_endpoint_api.py +++ b/swagger/api/api_query/api/table_history_endpoint_api.py @@ -126,7 +126,7 @@ class TableHistoryEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/history', 'HEAD', + '/api/container/{id}/database/{databaseId}/table/{tableId}/history', 'GET', path_params, query_params, header_params, @@ -235,7 +235,7 @@ class TableHistoryEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}/history', 'GET', + '/api/container/{id}/database/{databaseId}/table/{tableId}/history', 'HEAD', path_params, query_params, header_params, diff --git a/swagger/api/api_query/api/view_endpoint_api.py b/swagger/api/api_query/api/view_endpoint_api.py index 7443e08e6e79b141ac1634866ab6cb4910b0154d..fc42b97b83ea3c970a8d8929084437b120761972 100644 --- a/swagger/api/api_query/api/view_endpoint_api.py +++ b/swagger/api/api_query/api/view_endpoint_api.py @@ -262,6 +262,115 @@ class ViewEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def delete(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Delete 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.delete(id, database_id, view_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: object + 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(id, database_id, view_id, **kwargs) # noqa: E501 + else: + (data) = self.delete_with_http_info(id, database_id, view_id, **kwargs) # noqa: E501 + return data + + def delete_with_http_info(self, id, database_id, view_id, **kwargs): # noqa: E501 + """Delete 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.delete_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) + :param int view_id: (required) + :return: object + If the method is called asynchronously, + returns the request thread. + """ + + 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') + 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 delete" % 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 `delete`") # 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 `delete`") # 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 `delete`") # 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 'view_id' in params: + path_params['viewId'] = params['view_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}/view/{viewId}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + 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'), + _preload_content=params.get('_preload_content', True), + _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 diff --git a/swagger/api/api_query/models/__init__.py b/swagger/api/api_query/models/__init__.py index 5e2e453915e8343aea08ee1f42c29abad0538f06..407817fca59c5394cbbda685de5b6772fc3fa14d 100644 --- a/swagger/api/api_query/models/__init__.py +++ b/swagger/api/api_query/models/__init__.py @@ -16,9 +16,11 @@ from __future__ import absolute_import # import models into model package 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_dto import DatabaseDto from api_query.models.execute_statement_dto import ExecuteStatementDto from api_query.models.granted_authority_dto import GrantedAuthorityDto +from api_query.models.identifier_dto import IdentifierDto from api_query.models.image_brief_dto import ImageBriefDto from api_query.models.image_date_dto import ImageDateDto from api_query.models.image_dto import ImageDto @@ -28,6 +30,7 @@ from api_query.models.license_dto import LicenseDto from api_query.models.query_brief_dto import QueryBriefDto from api_query.models.query_dto import QueryDto from api_query.models.query_result_dto import QueryResultDto +from api_query.models.related_identifier_dto import RelatedIdentifierDto from api_query.models.table_brief_dto import TableBriefDto from api_query.models.table_csv_delete_dto import TableCsvDeleteDto from api_query.models.table_csv_dto import TableCsvDto @@ -35,3 +38,6 @@ from api_query.models.table_csv_update_dto import TableCsvUpdateDto from api_query.models.table_history_dto import TableHistoryDto from api_query.models.user_brief_dto import UserBriefDto from api_query.models.user_dto import UserDto +from api_query.models.view_brief_dto import ViewBriefDto +from api_query.models.view_create_dto import ViewCreateDto +from api_query.models.view_dto import ViewDto diff --git a/swagger/api/api_query/models/creator_dto.py b/swagger/api/api_query/models/creator_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..073b1f7d018ba23f8545ff95a700a9c7fcdb8d31 --- /dev/null +++ b/swagger/api/api_query/models/creator_dto.py @@ -0,0 +1,243 @@ +# 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 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', + 'name': 'str', + 'affiliation': 'str', + 'orcid': 'str', + 'created': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'name': 'name', + 'affiliation': 'affiliation', + 'orcid': 'orcid', + 'created': 'created', + 'last_modified': 'last_modified' + } + + def __init__(self, id=None, name=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._affiliation = None + self._orcid = None + self._created = None + self._last_modified = None + self.discriminator = None + self.id = id + self.name = name + if affiliation is not None: + self.affiliation = affiliation + if orcid is not None: + self.orcid = orcid + 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 name(self): + """Gets the name of this CreatorDto. # noqa: E501 + + + :return: The name of this CreatorDto. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CreatorDto. + + + :param name: The name of this CreatorDto. # 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 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 + """ + 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 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_query/models/database_dto.py b/swagger/api/api_query/models/database_dto.py index 2a1eca58879ea04405ff2b27dba5d4713893b3ac..4e9ae11005bb4192c9190e04e895e348618b8636 100644 --- a/swagger/api/api_query/models/database_dto.py +++ b/swagger/api/api_query/models/database_dto.py @@ -32,20 +32,14 @@ class DatabaseDto(object): 'name': 'str', 'exchange': 'str', 'creator': 'UserBriefDto', - 'subjects': 'list[str]', - 'language': 'str', - 'license': 'LicenseDto', + 'identifier': 'IdentifierDto', 'description': 'str', - 'publisher': 'str', 'tables': 'list[TableBriefDto]', 'image': 'ImageDto', 'container': 'ContainerDto', 'created': 'datetime', 'deleted': 'datetime', 'internal_name': 'str', - 'publication_year': 'int', - 'publication_month': 'int', - 'publication_day': 'int', 'is_public': 'bool' } @@ -54,59 +48,41 @@ class DatabaseDto(object): 'name': 'name', 'exchange': 'exchange', 'creator': 'creator', - 'subjects': 'subjects', - 'language': 'language', - 'license': 'license', + 'identifier': 'identifier', 'description': 'description', - 'publisher': 'publisher', 'tables': 'tables', 'image': 'image', 'container': 'container', 'created': 'created', 'deleted': 'deleted', 'internal_name': 'internal_name', - 'publication_year': 'publication_year', - 'publication_month': 'publication_month', - 'publication_day': 'publication_day', 'is_public': 'is_public' } - def __init__(self, id=None, name=None, exchange=None, creator=None, subjects=None, language=None, license=None, description=None, publisher=None, tables=None, image=None, container=None, created=None, deleted=None, internal_name=None, publication_year=None, publication_month=None, publication_day=None, is_public=None): # noqa: E501 + 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 """DatabaseDto - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._exchange = None self._creator = None - self._subjects = None - self._language = None - self._license = None + self._identifier = None self._description = None - self._publisher = None self._tables = None self._image = None self._container = None self._created = None self._deleted = None self._internal_name = None - self._publication_year = None - self._publication_month = None - self._publication_day = None self._is_public = None self.discriminator = None self.id = id self.name = name self.exchange = exchange self.creator = creator - if subjects is not None: - self.subjects = subjects - if language is not None: - self.language = language - if license is not None: - self.license = license + if identifier is not None: + self.identifier = identifier if description is not None: self.description = description - if publisher is not None: - self.publisher = publisher if tables is not None: self.tables = tables if image is not None: @@ -118,12 +94,6 @@ class DatabaseDto(object): if deleted is not None: self.deleted = deleted self.internal_name = internal_name - if publication_year is not None: - 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 is_public is not None: self.is_public = is_public @@ -220,73 +190,25 @@ class DatabaseDto(object): self._creator = creator @property - def subjects(self): - """Gets the subjects of this DatabaseDto. # noqa: E501 + def identifier(self): + """Gets the identifier of this DatabaseDto. # noqa: E501 - :return: The subjects of this DatabaseDto. # noqa: E501 - :rtype: list[str] + :return: The identifier of this DatabaseDto. # noqa: E501 + :rtype: IdentifierDto """ - return self._subjects + return self._identifier - @subjects.setter - def subjects(self, subjects): - """Sets the subjects of this DatabaseDto. + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DatabaseDto. - :param subjects: The subjects of this DatabaseDto. # noqa: E501 - :type: list[str] + :param identifier: The identifier of this DatabaseDto. # noqa: E501 + :type: IdentifierDto """ - self._subjects = subjects - - @property - def language(self): - """Gets the language of this DatabaseDto. # noqa: E501 - - - :return: The language of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._language - - @language.setter - def language(self, language): - """Sets the language of this DatabaseDto. - - - :param language: The language of this DatabaseDto. # 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 DatabaseDto. # noqa: E501 - - - :return: The license of this DatabaseDto. # noqa: E501 - :rtype: LicenseDto - """ - return self._license - - @license.setter - def license(self, license): - """Sets the license of this DatabaseDto. - - - :param license: The license of this DatabaseDto. # noqa: E501 - :type: LicenseDto - """ - - self._license = license + self._identifier = identifier @property def description(self): @@ -309,27 +231,6 @@ class DatabaseDto(object): self._description = description - @property - def publisher(self): - """Gets the publisher of this DatabaseDto. # noqa: E501 - - - :return: The publisher of this DatabaseDto. # noqa: E501 - :rtype: str - """ - return self._publisher - - @publisher.setter - def publisher(self, publisher): - """Sets the publisher of this DatabaseDto. - - - :param publisher: The publisher of this DatabaseDto. # noqa: E501 - :type: str - """ - - self._publisher = publisher - @property def tables(self): """Gets the tables of this DatabaseDto. # noqa: E501 @@ -458,69 +359,6 @@ class DatabaseDto(object): self._internal_name = internal_name - @property - def publication_year(self): - """Gets the publication_year of this DatabaseDto. # noqa: E501 - - - :return: The publication_year of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_year - - @publication_year.setter - def publication_year(self, publication_year): - """Sets the publication_year of this DatabaseDto. - - - :param publication_year: The publication_year of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_year = publication_year - - @property - def publication_month(self): - """Gets the publication_month of this DatabaseDto. # noqa: E501 - - - :return: The publication_month of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_month - - @publication_month.setter - def publication_month(self, publication_month): - """Sets the publication_month of this DatabaseDto. - - - :param publication_month: The publication_month of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_month = publication_month - - @property - def publication_day(self): - """Gets the publication_day of this DatabaseDto. # noqa: E501 - - - :return: The publication_day of this DatabaseDto. # noqa: E501 - :rtype: int - """ - return self._publication_day - - @publication_day.setter - def publication_day(self, publication_day): - """Sets the publication_day of this DatabaseDto. - - - :param publication_day: The publication_day of this DatabaseDto. # noqa: E501 - :type: int - """ - - self._publication_day = publication_day - @property def is_public(self): """Gets the is_public of this DatabaseDto. # noqa: E501 diff --git a/swagger/api/api_query/models/identifier_dto.py b/swagger/api/api_query/models/identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..f1707672a1149db49681cbeceee1f45621cc0eaa --- /dev/null +++ b/swagger/api/api_query/models/identifier_dto.py @@ -0,0 +1,794 @@ +# 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 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', + 'creator': 'UserDto', + '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', + 'creator': 'creator', + '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, 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 + """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._creator = 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 + self.creator = creator + 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 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 + + + :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_query/models/query_brief_dto.py b/swagger/api/api_query/models/query_brief_dto.py index 4eb119fd8b0efcf31ba4edf6feed9207d0cf4a13..9b4a3e4e4912cbe410d71efaa07c8d54c37b40f8 100644 --- a/swagger/api/api_query/models/query_brief_dto.py +++ b/swagger/api/api_query/models/query_brief_dto.py @@ -34,6 +34,7 @@ class QueryBriefDto(object): 'creator': 'UserDto', 'execution': 'datetime', 'query': 'str', + 'type': 'str', 'created': 'datetime', 'query_normalized': 'str', 'query_hash': 'str', @@ -49,6 +50,7 @@ class QueryBriefDto(object): 'creator': 'creator', 'execution': 'execution', 'query': 'query', + 'type': 'type', 'created': 'created', 'query_normalized': 'query_normalized', 'query_hash': 'query_hash', @@ -57,7 +59,7 @@ class QueryBriefDto(object): 'last_modified': 'last_modified' } - def __init__(self, id=None, cid=None, dbid=None, creator=None, execution=None, query=None, created=None, query_normalized=None, query_hash=None, result_hash=None, result_number=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, cid=None, dbid=None, creator=None, execution=None, query=None, type=None, created=None, query_normalized=None, query_hash=None, result_hash=None, result_number=None, last_modified=None): # noqa: E501 """QueryBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._cid = None @@ -65,6 +67,7 @@ class QueryBriefDto(object): self._creator = None self._execution = None self._query = None + self._type = None self._created = None self._query_normalized = None self._query_hash = None @@ -79,6 +82,8 @@ class QueryBriefDto(object): if execution is not None: self.execution = execution self.query = query + if type is not None: + self.type = type self.created = created if query_normalized is not None: self.query_normalized = query_normalized @@ -226,6 +231,33 @@ class QueryBriefDto(object): self._query = query + @property + def type(self): + """Gets the type of this QueryBriefDto. # noqa: E501 + + + :return: The type of this QueryBriefDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this QueryBriefDto. + + + :param type: The type of this QueryBriefDto. # noqa: E501 + :type: str + """ + allowed_values = ["query", "view"] # 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 QueryBriefDto. # noqa: E501 diff --git a/swagger/api/api_query/models/query_dto.py b/swagger/api/api_query/models/query_dto.py index 60469ec4cf21b7ed58ed9c06ff17c95420e9cbd5..e8cf5221c2142b1a60765a1a9429f7856c529ff9 100644 --- a/swagger/api/api_query/models/query_dto.py +++ b/swagger/api/api_query/models/query_dto.py @@ -34,9 +34,11 @@ class QueryDto(object): 'creator': 'UserDto', 'execution': 'datetime', 'query': 'str', + 'type': 'str', 'created': 'datetime', 'query_normalized': 'str', 'query_hash': 'str', + 'is_persisted': 'bool', 'result_hash': 'str', 'result_number': 'int', 'last_modified': 'datetime' @@ -49,15 +51,17 @@ class QueryDto(object): 'creator': 'creator', 'execution': 'execution', 'query': 'query', + 'type': 'type', 'created': 'created', 'query_normalized': 'query_normalized', 'query_hash': 'query_hash', + 'is_persisted': 'is_persisted', 'result_hash': 'result_hash', 'result_number': 'result_number', 'last_modified': 'last_modified' } - def __init__(self, id=None, cid=None, dbid=None, creator=None, execution=None, query=None, created=None, query_normalized=None, query_hash=None, result_hash=None, result_number=None, last_modified=None): # noqa: E501 + def __init__(self, id=None, cid=None, dbid=None, creator=None, execution=None, query=None, type=None, created=None, query_normalized=None, query_hash=None, is_persisted=None, result_hash=None, result_number=None, last_modified=None): # noqa: E501 """QueryDto - a model defined in Swagger""" # noqa: E501 self._id = None self._cid = None @@ -65,9 +69,11 @@ class QueryDto(object): self._creator = None self._execution = None self._query = None + self._type = None self._created = None self._query_normalized = None self._query_hash = None + self._is_persisted = None self._result_hash = None self._result_number = None self._last_modified = None @@ -79,10 +85,13 @@ class QueryDto(object): if execution is not None: self.execution = execution self.query = query + if type is not None: + self.type = type self.created = created if query_normalized is not None: self.query_normalized = query_normalized self.query_hash = query_hash + self.is_persisted = is_persisted if result_hash is not None: self.result_hash = result_hash if result_number is not None: @@ -226,6 +235,33 @@ class QueryDto(object): self._query = query + @property + def type(self): + """Gets the type of this QueryDto. # noqa: E501 + + + :return: The type of this QueryDto. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this QueryDto. + + + :param type: The type of this QueryDto. # noqa: E501 + :type: str + """ + allowed_values = ["query", "view"] # 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 QueryDto. # noqa: E501 @@ -293,6 +329,29 @@ class QueryDto(object): self._query_hash = query_hash + @property + def is_persisted(self): + """Gets the is_persisted of this QueryDto. # noqa: E501 + + + :return: The is_persisted of this QueryDto. # noqa: E501 + :rtype: bool + """ + return self._is_persisted + + @is_persisted.setter + def is_persisted(self, is_persisted): + """Sets the is_persisted of this QueryDto. + + + :param is_persisted: The is_persisted of this QueryDto. # noqa: E501 + :type: bool + """ + if is_persisted is None: + raise ValueError("Invalid value for `is_persisted`, must not be `None`") # noqa: E501 + + self._is_persisted = is_persisted + @property def result_hash(self): """Gets the result_hash of this QueryDto. # noqa: E501 diff --git a/swagger/api/api_query/models/related_identifier_dto.py b/swagger/api/api_query/models/related_identifier_dto.py new file mode 100644 index 0000000000000000000000000000000000000000..56722e2955a6884ceaac750b31bf246d87a0a5da --- /dev/null +++ b/swagger/api/api_query/models/related_identifier_dto.py @@ -0,0 +1,281 @@ +# 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 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', + 'deleted': 'datetime', + 'last_modified': 'datetime' + } + + attribute_map = { + 'id': 'id', + 'value': 'value', + '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 + """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 + self.value = value + if type is not None: + self.type = type + 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 + + @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 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 + + + :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_query/models/view_brief_dto.py b/swagger/api/api_query/models/view_brief_dto.py index 0022567a848f72a2e2d2ca7d2810b7396db528a7..14f4995bd980bba85398086c99d147b0e6736f76 100644 --- a/swagger/api/api_query/models/view_brief_dto.py +++ b/swagger/api/api_query/models/view_brief_dto.py @@ -36,6 +36,7 @@ class ViewBriefDto(object): 'deleted': 'datetime', 'is_public': 'bool', 'initial_view': 'bool', + 'created_by': 'int', 'last_modified': 'datetime' } @@ -48,10 +49,11 @@ class ViewBriefDto(object): '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, last_modified=None): # noqa: E501 + 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 """ViewBriefDto - a model defined in Swagger""" # noqa: E501 self._id = None self._vdbid = None @@ -61,6 +63,7 @@ class ViewBriefDto(object): self._deleted = None self._is_public = None self._initial_view = None + self._created_by = None self._last_modified = None self.discriminator = None self.id = id @@ -75,6 +78,7 @@ class ViewBriefDto(object): self.is_public = is_public if initial_view is not None: self.initial_view = initial_view + self.created_by = created_by if last_modified is not None: self.last_modified = last_modified @@ -256,6 +260,29 @@ class ViewBriefDto(object): self._initial_view = initial_view + @property + def created_by(self): + """Gets the created_by of this ViewBriefDto. # noqa: E501 + + + :return: The created_by of this ViewBriefDto. # noqa: E501 + :rtype: int + """ + return self._created_by + + @created_by.setter + def created_by(self, created_by): + """Sets the created_by of this ViewBriefDto. + + + :param created_by: The created_by of this ViewBriefDto. # noqa: E501 + :type: int + """ + if created_by is None: + raise ValueError("Invalid value for `created_by`, must not be `None`") # noqa: E501 + + self._created_by = created_by + @property def last_modified(self): """Gets the last_modified of this ViewBriefDto. # noqa: E501 diff --git a/swagger/api/api_table/api/table_endpoint_api.py b/swagger/api/api_table/api/table_endpoint_api.py index 55049efced3b3b4d48481955d940887bf2542a5c..03c13a37d72e0187e4a1994b400a5f45c34712b5 100644 --- a/swagger/api/api_table/api/table_endpoint_api.py +++ b/swagger/api/api_table/api/table_endpoint_api.py @@ -32,17 +32,16 @@ class TableEndpointApi(object): api_client = ApiClient() self.api_client = api_client - def create(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + def create(self, body, id, database_id, **kwargs): # noqa: E501 """Create 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.create(body, authorization, id, database_id, async_req=True) + >>> thread = api.create(body, id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param TableCreateDto body: (required) - :param str authorization: (required) :param int id: (required) :param int database_id: (required) :return: TableBriefDto @@ -51,22 +50,21 @@ class TableEndpointApi(object): """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + return self.create_with_http_info(body, id, database_id, **kwargs) # noqa: E501 else: - (data) = self.create_with_http_info(body, authorization, id, database_id, **kwargs) # noqa: E501 + (data) = self.create_with_http_info(body, id, database_id, **kwargs) # noqa: E501 return data - def create_with_http_info(self, body, authorization, id, database_id, **kwargs): # noqa: E501 + def create_with_http_info(self, body, id, database_id, **kwargs): # noqa: E501 """Create 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.create_with_http_info(body, authorization, id, database_id, async_req=True) + >>> thread = api.create_with_http_info(body, id, database_id, async_req=True) >>> result = thread.get() :param async_req bool :param TableCreateDto body: (required) - :param str authorization: (required) :param int id: (required) :param int database_id: (required) :return: TableBriefDto @@ -74,7 +72,7 @@ class TableEndpointApi(object): returns the request thread. """ - all_params = ['body', 'authorization', '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') @@ -93,10 +91,6 @@ class TableEndpointApi(object): 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 'authorization' is set - if ('authorization' not in params or - params['authorization'] is None): - raise ValueError("Missing the required parameter `authorization` when calling `create`") # noqa: E501 # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): @@ -117,8 +111,6 @@ class TableEndpointApi(object): query_params = [] header_params = {} - if 'authorization' in params: - header_params['Authorization'] = params['authorization'] # noqa: E501 form_params = [] local_var_files = {} @@ -153,49 +145,47 @@ class TableEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def delete(self, id, database_id, table_id, authorization, **kwargs): # noqa: E501 + def delete(self, id, database_id, table_id, **kwargs): # noqa: E501 """Delete 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.delete(id, database_id, table_id, authorization, async_req=True) + >>> thread = api.delete(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) - :param str authorization: (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(id, database_id, table_id, authorization, **kwargs) # noqa: E501 + return self.delete_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 else: - (data) = self.delete_with_http_info(id, database_id, table_id, authorization, **kwargs) # noqa: E501 + (data) = self.delete_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 return data - def delete_with_http_info(self, id, database_id, table_id, authorization, **kwargs): # noqa: E501 + def delete_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 """Delete 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.delete_with_http_info(id, database_id, table_id, authorization, async_req=True) + >>> thread = api.delete_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) - :param str authorization: (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'table_id', 'authorization'] # noqa: E501 + 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') @@ -222,10 +212,6 @@ class TableEndpointApi(object): if ('table_id' not in params or params['table_id'] is None): raise ValueError("Missing the required parameter `table_id` when calling `delete`") # noqa: E501 - # verify the required parameter 'authorization' is set - if ('authorization' not in params or - params['authorization'] is None): - raise ValueError("Missing the required parameter `authorization` when calling `delete`") # noqa: E501 collection_formats = {} @@ -240,8 +226,6 @@ class TableEndpointApi(object): query_params = [] header_params = {} - if 'authorization' in params: - header_params['Authorization'] = params['authorization'] # noqa: E501 form_params = [] local_var_files = {} @@ -270,45 +254,47 @@ class TableEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_all(self, id, database_id, **kwargs): # noqa: E501 - """List all tables # noqa: E501 + def find_by_id(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Get information about 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.find_all(id, database_id, async_req=True) + >>> thread = api.find_by_id(id, database_id, table_id, async_req=True) >>> result = thread.get() :param async_req bool :param int id: (required) :param int database_id: (required) - :return: list[TableBriefDto] + :param int table_id: (required) + :return: TableDto 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_by_id_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 else: - (data) = self.find_all_with_http_info(id, database_id, **kwargs) # noqa: E501 + (data) = self.find_by_id_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 return data - def find_all_with_http_info(self, id, database_id, **kwargs): # noqa: E501 - """List all tables # noqa: E501 + def find_by_id_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 + """Get information about 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.find_all_with_http_info(id, database_id, async_req=True) + >>> thread = api.find_by_id_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) - :return: list[TableBriefDto] + :param int table_id: (required) + :return: TableDto If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id'] # noqa: E501 + 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') @@ -319,18 +305,22 @@ class TableEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_all" % key + " to method find_by_id" % 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_by_id`") # 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_by_id`") # 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 `find_by_id`") # noqa: E501 collection_formats = {} @@ -339,6 +329,8 @@ class TableEndpointApi(object): 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 = [] @@ -356,14 +348,14 @@ class TableEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table', 'GET', + '/api/container/{id}/database/{databaseId}/table/{tableId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[TableBriefDto]', # noqa: E501 + response_type='TableDto', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -371,47 +363,45 @@ class TableEndpointApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def find_by_id(self, id, database_id, table_id, **kwargs): # noqa: E501 - """Get information about table # noqa: E501 + def list(self, id, database_id, **kwargs): # noqa: E501 + """List all tables # 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, table_id, async_req=True) + >>> thread = api.list(id, database_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: TableDto + :return: list[TableBriefDto] 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, table_id, **kwargs) # noqa: E501 + return self.list_with_http_info(id, database_id, **kwargs) # noqa: E501 else: - (data) = self.find_by_id_with_http_info(id, database_id, table_id, **kwargs) # noqa: E501 + (data) = self.list_with_http_info(id, database_id, **kwargs) # noqa: E501 return data - def find_by_id_with_http_info(self, id, database_id, table_id, **kwargs): # noqa: E501 - """Get information about table # noqa: E501 + def list_with_http_info(self, id, database_id, **kwargs): # noqa: E501 + """List all tables # 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, table_id, async_req=True) + >>> thread = api.list_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 table_id: (required) - :return: TableDto + :return: list[TableBriefDto] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'database_id', 'table_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') @@ -422,22 +412,18 @@ class TableEndpointApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method find_by_id" % key + " to method list" % 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 `list`") # 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 - # 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 `find_by_id`") # noqa: E501 + raise ValueError("Missing the required parameter `database_id` when calling `list`") # noqa: E501 collection_formats = {} @@ -446,8 +432,6 @@ class TableEndpointApi(object): 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 = [] @@ -465,14 +449,14 @@ class TableEndpointApi(object): auth_settings = ['bearerAuth'] # noqa: E501 return self.api_client.call_api( - '/api/container/{id}/database/{databaseId}/table/{tableId}', 'GET', + '/api/container/{id}/database/{databaseId}/table', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='TableDto', # noqa: E501 + response_type='list[TableBriefDto]', # 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/docker-build.sh b/swagger/docker-build.sh index c8d0630c91e615bc31172b834dac4a3f0d0a7188..d21378a2ceaa906ee4102f7fde8cdbb9bb8e4276 100644 --- a/swagger/docker-build.sh +++ b/swagger/docker-build.sh @@ -11,20 +11,20 @@ services[9096]=identifier services[9097]=authentication services[9098]=metadata +function replace () { + echo "... replace server url of $1" + sed -i -e "s/localhost:[0-9]+/dbrepo1.ec.tuwien.ac.at/g" "/usr/share/nginx/html/docs/$1/api.yaml" + sed -i -e "s/Generated server url/TU Wien DBRepo/g" "/usr/share/nginx/html/docs/$1/api.yaml" +} + function copy () { echo "... copy dist to $1" - cp -r /app/dist/* "./$1" + cp -r /app/dist/* "/usr/share/nginx/html/docs/$1" } function init () { echo "... copy initializer to $1" - cp /app/swagger-initializer.js "/usr/share/nginx/html/$1" -} - -function replace () { - echo "... replace server url of $1" - sed -i -e "s/localhost.*/dbrepo1.ec.tuwien.ac.at\/api/g" "./$1/api.yaml" - sed -i -e "s/Generated server url/TU Wien DBRepo/g" "./$1/api.yaml" + cp /app/swagger-initializer.js "/usr/share/nginx/html/docs/$1" } for key in "${!services[@]}"; do diff --git a/swagger/generate.sh b/swagger/generate.sh index e22453902669f506b7dc5dcf892791546be9a565..2d5a8ac815e03d807e929f488edb39eae25d4128 100755 --- a/swagger/generate.sh +++ b/swagger/generate.sh @@ -9,11 +9,11 @@ services[9093]=query services[9094]=table services[9096]=identifier services[9097]=authentication -services[9098]=metadata +services[9099]=metadata function retrieve () { echo "... retrieve api" - if [[ "$2" == units ]]; then + if [[ "$2" == units ]] || [[ "$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,24 +27,24 @@ 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 "${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" "${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" } 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 "${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/index.html b/swagger/index.html index e730d640e2baa5e031974aea556a85df598bc7f1..0c2e93d6cda09a563fe880f011cfabb9c4633cc7 100644 --- a/swagger/index.html +++ b/swagger/index.html @@ -5,14 +5,14 @@ <body> <h3>DBRepo Endpoint Documentation</h3> <ul> - <li><a href="/analyse">Analyse Service</a></li> - <li><a href="/authentication">Authentication Service</a></li> - <li><a href="/container">Container Service</a></li> - <li><a href="/database">Database Service</a></li> - <li><a href="/identifier">Identifier Service</a></li> - <li><a href="/metadata">Metadata Service</a></li> - <li><a href="/query">Query Service</a></li> - <li><a href="/table">Table Service</a></li> - <li><a href="/units">Units Service</a></li> + <li><a href="/docs/analyse">Analyse Service</a></li> + <li><a href="/docs/authentication">Authentication Service</a></li> + <li><a href="/docs/container">Container Service</a></li> + <li><a href="/docs/database">Database Service</a></li> + <li><a href="/docs/identifier">Identifier Service</a></li> + <li><a href="/docs/metadata">Metadata Service</a></li> + <li><a href="/docs/query">Query Service</a></li> + <li><a href="/docs/table">Table Service</a></li> + <li><a href="/docs/units">Units Service</a></li> </ul> </body> \ No newline at end of file diff --git a/swagger/nginx.conf b/swagger/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..412056150d6b0fff4d55248113fe1f1fbbe4aa8c --- /dev/null +++ b/swagger/nginx.conf @@ -0,0 +1,60 @@ +# For more information on configuration, see: +# * Official English Documentation: http://nginx.org/en/docs/ +# * Official Russian Documentation: http://nginx.org/ru/docs/ + +user nginx; +worker_processes auto; +error_log /var/log/nginx/error_log; +pid /var/run/nginx.pid; + +# Load dynamic modules. See /usr/share/nginx/README.dynamic. +# include /etc/nginx/modules.d/*.conf; + +events { + worker_connections 1024; +} + +http { + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access_log main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + client_max_body_size 1G; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # Load modular configuration files from the /etc/nginx/conf.d directory. + # See http://nginx.org/en/docs/ngx_core_module.html#include + # for more information. + include /etc/nginx/conf.d/*.conf; + + + ## + # Connection header for WebSocket reverse proxy + ## + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + + server { + listen 80 default_server; + server_name _; + root /usr/share/nginx/html/; + index index.html index.htm; + + location / { + } + + } + +} +