commit
db10cf7f02
254 changed files with 54712 additions and 0 deletions
@ -0,0 +1,64 @@ |
|||||
|
# Byte-compiled / optimized / DLL files |
||||
|
__pycache__/ |
||||
|
*.py[cod] |
||||
|
*$py.class |
||||
|
|
||||
|
# C extensions |
||||
|
*.so |
||||
|
|
||||
|
# Distribution / packaging |
||||
|
.Python |
||||
|
env/ |
||||
|
build/ |
||||
|
develop-eggs/ |
||||
|
dist/ |
||||
|
downloads/ |
||||
|
eggs/ |
||||
|
.eggs/ |
||||
|
lib/ |
||||
|
lib64/ |
||||
|
parts/ |
||||
|
sdist/ |
||||
|
var/ |
||||
|
*.egg-info/ |
||||
|
.installed.cfg |
||||
|
*.egg |
||||
|
|
||||
|
# PyInstaller |
||||
|
# Usually these files are written by a python script from a template |
||||
|
# before PyInstaller builds the exe, so as to inject date/other infos into it. |
||||
|
*.manifest |
||||
|
*.spec |
||||
|
|
||||
|
# Installer logs |
||||
|
pip-log.txt |
||||
|
pip-delete-this-directory.txt |
||||
|
|
||||
|
# Unit test / coverage reports |
||||
|
htmlcov/ |
||||
|
.tox/ |
||||
|
.coverage |
||||
|
.coverage.* |
||||
|
.cache |
||||
|
nosetests.xml |
||||
|
coverage.xml |
||||
|
*,cover |
||||
|
.hypothesis/ |
||||
|
venv/ |
||||
|
.python-version |
||||
|
|
||||
|
# Translations |
||||
|
*.mo |
||||
|
*.pot |
||||
|
|
||||
|
# Django stuff: |
||||
|
*.log |
||||
|
|
||||
|
# Sphinx documentation |
||||
|
docs/_build/ |
||||
|
|
||||
|
# PyBuilder |
||||
|
target/ |
||||
|
|
||||
|
#Ipython Notebook |
||||
|
.ipynb_checkpoints |
@ -0,0 +1,23 @@ |
|||||
|
# Swagger Codegen Ignore |
||||
|
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen |
||||
|
|
||||
|
# Use this file to prevent files from being overwritten by the generator. |
||||
|
# The patterns follow closely to .gitignore or .dockerignore. |
||||
|
|
||||
|
# As an example, the C# client generator defines ApiClient.cs. |
||||
|
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: |
||||
|
#ApiClient.cs |
||||
|
|
||||
|
# You can match any string of characters against a directory, file or extension with a single asterisk (*): |
||||
|
#foo/*/qux |
||||
|
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux |
||||
|
|
||||
|
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): |
||||
|
#foo/**/qux |
||||
|
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux |
||||
|
|
||||
|
# You can also negate patterns with an exclamation (!). |
||||
|
# For example, you can ignore all files in a docs folder with the file extension .md: |
||||
|
#docs/*.md |
||||
|
# Then explicitly reverse the ignore rule for a single file: |
||||
|
#!docs/README.md |
@ -0,0 +1 @@ |
|||||
|
2.4.3-SNAPSHOT |
@ -0,0 +1,14 @@ |
|||||
|
# ref: https://docs.travis-ci.com/user/languages/python |
||||
|
language: python |
||||
|
python: |
||||
|
- "2.7" |
||||
|
- "3.2" |
||||
|
- "3.3" |
||||
|
- "3.4" |
||||
|
- "3.5" |
||||
|
#- "3.5-dev" # 3.5 development branch |
||||
|
#- "nightly" # points to the latest development branch e.g. 3.6-dev |
||||
|
# command to install dependencies |
||||
|
install: "pip install -r requirements.txt" |
||||
|
# command to run tests |
||||
|
script: nosetests |
@ -0,0 +1,391 @@ |
|||||
|
# swagger-client |
||||
|
This documentation describes the Gitea API. |
||||
|
|
||||
|
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: |
||||
|
|
||||
|
- API version: 1.1.1 |
||||
|
- Package version: 1.0.0 |
||||
|
- Build package: io.swagger.codegen.languages.PythonClientCodegen |
||||
|
|
||||
|
## Requirements. |
||||
|
|
||||
|
Python 2.7 and 3.4+ |
||||
|
|
||||
|
## Installation & Usage |
||||
|
### pip install |
||||
|
|
||||
|
If the python package is hosted on Github, you can install directly from Github |
||||
|
|
||||
|
```sh |
||||
|
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
||||
|
``` |
||||
|
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
||||
|
|
||||
|
Then import the package: |
||||
|
```python |
||||
|
import swagger_client |
||||
|
``` |
||||
|
|
||||
|
### Setuptools |
||||
|
|
||||
|
Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
||||
|
|
||||
|
```sh |
||||
|
python setup.py install --user |
||||
|
``` |
||||
|
(or `sudo python setup.py install` to install the package for all users) |
||||
|
|
||||
|
Then import the package: |
||||
|
```python |
||||
|
import swagger_client |
||||
|
``` |
||||
|
|
||||
|
## Getting Started |
||||
|
|
||||
|
Please follow the [installation procedure](#installation--usage) and then run the following: |
||||
|
|
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of the user that will own the created organization |
||||
|
organization = swagger_client.CreateOrgOption() # CreateOrgOption | |
||||
|
|
||||
|
try: |
||||
|
# Create an organization |
||||
|
api_response = api_instance.admin_create_org(username, organization) |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_create_org: %s\n" % e) |
||||
|
|
||||
|
``` |
||||
|
|
||||
|
## Documentation for API Endpoints |
||||
|
|
||||
|
All URIs are relative to *http://localhost/api/v1* |
||||
|
|
||||
|
Class | Method | HTTP request | Description |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
*AdminApi* | [**admin_create_org**](docs/AdminApi.md#admin_create_org) | **POST** /admin/users/{username}/orgs | Create an organization |
||||
|
*AdminApi* | [**admin_create_public_key**](docs/AdminApi.md#admin_create_public_key) | **POST** /admin/users/{username}/keys | Add a public key on behalf of a user |
||||
|
*AdminApi* | [**admin_create_repo**](docs/AdminApi.md#admin_create_repo) | **POST** /admin/users/{username}/repos | Create a repository on behalf a user |
||||
|
*AdminApi* | [**admin_create_user**](docs/AdminApi.md#admin_create_user) | **POST** /admin/users | Create a user |
||||
|
*AdminApi* | [**admin_delete_user**](docs/AdminApi.md#admin_delete_user) | **DELETE** /admin/users/{username} | Delete a user |
||||
|
*AdminApi* | [**admin_delete_user_public_key**](docs/AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Delete a user's public key |
||||
|
*AdminApi* | [**admin_edit_user**](docs/AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user |
||||
|
*IssueApi* | [**issue_add_label**](docs/IssueApi.md#issue_add_label) | **POST** /repos/{owner}/{repo}/issues/{index}/labels | Add a label to an issue |
||||
|
*IssueApi* | [**issue_add_time**](docs/IssueApi.md#issue_add_time) | **POST** /repos/{owner}/{repo}/issues/{id}/times | Add a tracked time to a issue |
||||
|
*IssueApi* | [**issue_clear_labels**](docs/IssueApi.md#issue_clear_labels) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels | Remove all labels from an issue |
||||
|
*IssueApi* | [**issue_create_comment**](docs/IssueApi.md#issue_create_comment) | **POST** /repos/{owner}/{repo}/issues/{index}/comments | Add a comment to an issue |
||||
|
*IssueApi* | [**issue_create_issue**](docs/IssueApi.md#issue_create_issue) | **POST** /repos/{owner}/{repo}/issues | Create an issue. If using deadline only the date will be taken into account, and time of day ignored. |
||||
|
*IssueApi* | [**issue_create_label**](docs/IssueApi.md#issue_create_label) | **POST** /repos/{owner}/{repo}/labels | Create a label |
||||
|
*IssueApi* | [**issue_create_milestone**](docs/IssueApi.md#issue_create_milestone) | **POST** /repos/{owner}/{repo}/milestones | Create a milestone |
||||
|
*IssueApi* | [**issue_delete_comment**](docs/IssueApi.md#issue_delete_comment) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id} | Delete a comment |
||||
|
*IssueApi* | [**issue_delete_comment_deprecated**](docs/IssueApi.md#issue_delete_comment_deprecated) | **DELETE** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Delete a comment |
||||
|
*IssueApi* | [**issue_delete_label**](docs/IssueApi.md#issue_delete_label) | **DELETE** /repos/{owner}/{repo}/labels/{id} | Delete a label |
||||
|
*IssueApi* | [**issue_delete_milestone**](docs/IssueApi.md#issue_delete_milestone) | **DELETE** /repos/{owner}/{repo}/milestones/{id} | Delete a milestone |
||||
|
*IssueApi* | [**issue_edit_comment**](docs/IssueApi.md#issue_edit_comment) | **PATCH** /repos/{owner}/{repo}/issues/comments/{id} | Edit a comment |
||||
|
*IssueApi* | [**issue_edit_comment_deprecated**](docs/IssueApi.md#issue_edit_comment_deprecated) | **PATCH** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Edit a comment |
||||
|
*IssueApi* | [**issue_edit_issue**](docs/IssueApi.md#issue_edit_issue) | **PATCH** /repos/{owner}/{repo}/issues/{index} | Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. |
||||
|
*IssueApi* | [**issue_edit_issue_deadline**](docs/IssueApi.md#issue_edit_issue_deadline) | **POST** /repos/{owner}/{repo}/issues/{index}/deadline | Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. |
||||
|
*IssueApi* | [**issue_edit_label**](docs/IssueApi.md#issue_edit_label) | **PATCH** /repos/{owner}/{repo}/labels/{id} | Update a label |
||||
|
*IssueApi* | [**issue_edit_milestone**](docs/IssueApi.md#issue_edit_milestone) | **PATCH** /repos/{owner}/{repo}/milestones/{id} | Update a milestone |
||||
|
*IssueApi* | [**issue_get_comments**](docs/IssueApi.md#issue_get_comments) | **GET** /repos/{owner}/{repo}/issues/{index}/comments | List all comments on an issue |
||||
|
*IssueApi* | [**issue_get_issue**](docs/IssueApi.md#issue_get_issue) | **GET** /repos/{owner}/{repo}/issues/{index} | Get an issue |
||||
|
*IssueApi* | [**issue_get_label**](docs/IssueApi.md#issue_get_label) | **GET** /repos/{owner}/{repo}/labels/{id} | Get a single label |
||||
|
*IssueApi* | [**issue_get_labels**](docs/IssueApi.md#issue_get_labels) | **GET** /repos/{owner}/{repo}/issues/{index}/labels | Get an issue's labels |
||||
|
*IssueApi* | [**issue_get_milestone**](docs/IssueApi.md#issue_get_milestone) | **GET** /repos/{owner}/{repo}/milestones/{id} | Get a milestone |
||||
|
*IssueApi* | [**issue_get_milestones_list**](docs/IssueApi.md#issue_get_milestones_list) | **GET** /repos/{owner}/{repo}/milestones | Get all of a repository's opened milestones |
||||
|
*IssueApi* | [**issue_get_repo_comments**](docs/IssueApi.md#issue_get_repo_comments) | **GET** /repos/{owner}/{repo}/issues/comments | List all comments in a repository |
||||
|
*IssueApi* | [**issue_list_issues**](docs/IssueApi.md#issue_list_issues) | **GET** /repos/{owner}/{repo}/issues | List a repository's issues |
||||
|
*IssueApi* | [**issue_list_labels**](docs/IssueApi.md#issue_list_labels) | **GET** /repos/{owner}/{repo}/labels | Get all of a repository's labels |
||||
|
*IssueApi* | [**issue_remove_label**](docs/IssueApi.md#issue_remove_label) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels/{id} | Remove a label from an issue |
||||
|
*IssueApi* | [**issue_replace_labels**](docs/IssueApi.md#issue_replace_labels) | **PUT** /repos/{owner}/{repo}/issues/{index}/labels | Replace an issue's labels |
||||
|
*IssueApi* | [**issue_tracked_times**](docs/IssueApi.md#issue_tracked_times) | **GET** /repos/{owner}/{repo}/issues/{id}/times | List an issue's tracked times |
||||
|
*MiscellaneousApi* | [**get_version**](docs/MiscellaneousApi.md#get_version) | **GET** /version | Returns the version of the Gitea application |
||||
|
*MiscellaneousApi* | [**render_markdown**](docs/MiscellaneousApi.md#render_markdown) | **POST** /markdown | Render a markdown document as HTML |
||||
|
*MiscellaneousApi* | [**render_markdown_raw**](docs/MiscellaneousApi.md#render_markdown_raw) | **POST** /markdown/raw | Render raw markdown as HTML |
||||
|
*OrganizationApi* | [**create_org_repo**](docs/OrganizationApi.md#create_org_repo) | **POST** /org/{org}/repos | Create a repository in an organization |
||||
|
*OrganizationApi* | [**org_add_team_member**](docs/OrganizationApi.md#org_add_team_member) | **PUT** /teams/{id}/members/{username} | Add a team member |
||||
|
*OrganizationApi* | [**org_add_team_repository**](docs/OrganizationApi.md#org_add_team_repository) | **PUT** /teams/{id}/repos/{org}/{repo} | Add a repository to a team |
||||
|
*OrganizationApi* | [**org_conceal_member**](docs/OrganizationApi.md#org_conceal_member) | **DELETE** /orgs/{org}/public_members/{username} | Conceal a user's membership |
||||
|
*OrganizationApi* | [**org_create**](docs/OrganizationApi.md#org_create) | **POST** /orgs | Create an organization |
||||
|
*OrganizationApi* | [**org_create_hook**](docs/OrganizationApi.md#org_create_hook) | **POST** /orgs/{org}/hooks/ | Create a hook |
||||
|
*OrganizationApi* | [**org_create_team**](docs/OrganizationApi.md#org_create_team) | **POST** /orgs/{org}/teams | Create a team |
||||
|
*OrganizationApi* | [**org_delete**](docs/OrganizationApi.md#org_delete) | **DELETE** /orgs/{org} | Delete an organization |
||||
|
*OrganizationApi* | [**org_delete_hook**](docs/OrganizationApi.md#org_delete_hook) | **DELETE** /orgs/{org}/hooks/{id} | Delete a hook |
||||
|
*OrganizationApi* | [**org_delete_member**](docs/OrganizationApi.md#org_delete_member) | **DELETE** /orgs/{org}/members/{username} | Remove a member from an organization |
||||
|
*OrganizationApi* | [**org_delete_team**](docs/OrganizationApi.md#org_delete_team) | **DELETE** /teams/{id} | Delete a team |
||||
|
*OrganizationApi* | [**org_edit**](docs/OrganizationApi.md#org_edit) | **PATCH** /orgs/{org} | Edit an organization |
||||
|
*OrganizationApi* | [**org_edit_hook**](docs/OrganizationApi.md#org_edit_hook) | **PATCH** /orgs/{org}/hooks/{id} | Update a hook |
||||
|
*OrganizationApi* | [**org_edit_team**](docs/OrganizationApi.md#org_edit_team) | **PATCH** /teams/{id} | Edit a team |
||||
|
*OrganizationApi* | [**org_get**](docs/OrganizationApi.md#org_get) | **GET** /orgs/{org} | Get an organization |
||||
|
*OrganizationApi* | [**org_get_hook**](docs/OrganizationApi.md#org_get_hook) | **GET** /orgs/{org}/hooks/{id} | Get a hook |
||||
|
*OrganizationApi* | [**org_get_team**](docs/OrganizationApi.md#org_get_team) | **GET** /teams/{id} | Get a team |
||||
|
*OrganizationApi* | [**org_is_member**](docs/OrganizationApi.md#org_is_member) | **GET** /orgs/{org}/members/{username} | Check if a user is a member of an organization |
||||
|
*OrganizationApi* | [**org_is_public_member**](docs/OrganizationApi.md#org_is_public_member) | **GET** /orgs/{org}/public_members/{username} | Check if a user is a public member of an organization |
||||
|
*OrganizationApi* | [**org_list_current_user_orgs**](docs/OrganizationApi.md#org_list_current_user_orgs) | **GET** /user/orgs | List the current user's organizations |
||||
|
*OrganizationApi* | [**org_list_hooks**](docs/OrganizationApi.md#org_list_hooks) | **GET** /orgs/{org}/hooks | List an organization's webhooks |
||||
|
*OrganizationApi* | [**org_list_members**](docs/OrganizationApi.md#org_list_members) | **GET** /orgs/{org}/members | List an organization's members |
||||
|
*OrganizationApi* | [**org_list_public_members**](docs/OrganizationApi.md#org_list_public_members) | **GET** /orgs/{org}/public_members | List an organization's public members |
||||
|
*OrganizationApi* | [**org_list_repos**](docs/OrganizationApi.md#org_list_repos) | **GET** /orgs/{org}/repos | List an organization's repos |
||||
|
*OrganizationApi* | [**org_list_team_members**](docs/OrganizationApi.md#org_list_team_members) | **GET** /teams/{id}/members | List a team's members |
||||
|
*OrganizationApi* | [**org_list_team_repos**](docs/OrganizationApi.md#org_list_team_repos) | **GET** /teams/{id}/repos | List a team's repos |
||||
|
*OrganizationApi* | [**org_list_teams**](docs/OrganizationApi.md#org_list_teams) | **GET** /orgs/{org}/teams | List an organization's teams |
||||
|
*OrganizationApi* | [**org_list_user_orgs**](docs/OrganizationApi.md#org_list_user_orgs) | **GET** /users/{username}/orgs | List a user's organizations |
||||
|
*OrganizationApi* | [**org_publicize_member**](docs/OrganizationApi.md#org_publicize_member) | **PUT** /orgs/{org}/public_members/{username} | Publicize a user's membership |
||||
|
*OrganizationApi* | [**org_remove_team_member**](docs/OrganizationApi.md#org_remove_team_member) | **DELETE** /teams/{id}/members/{username} | Remove a team member |
||||
|
*OrganizationApi* | [**org_remove_team_repository**](docs/OrganizationApi.md#org_remove_team_repository) | **DELETE** /teams/{id}/repos/{org}/{repo} | Remove a repository from a team |
||||
|
*RepositoryApi* | [**create_current_user_repo**](docs/RepositoryApi.md#create_current_user_repo) | **POST** /user/repos | Create a repository |
||||
|
*RepositoryApi* | [**create_fork**](docs/RepositoryApi.md#create_fork) | **POST** /repos/{owner}/{repo}/forks | Fork a repository |
||||
|
*RepositoryApi* | [**get_tree**](docs/RepositoryApi.md#get_tree) | **GET** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. |
||||
|
*RepositoryApi* | [**list_forks**](docs/RepositoryApi.md#list_forks) | **GET** /repos/{owner}/{repo}/forks | List a repository's forks |
||||
|
*RepositoryApi* | [**repo_add_collaborator**](docs/RepositoryApi.md#repo_add_collaborator) | **PUT** /repos/{owner}/{repo}/collaborators/{collaborator} | Add a collaborator to a repository |
||||
|
*RepositoryApi* | [**repo_check_collaborator**](docs/RepositoryApi.md#repo_check_collaborator) | **GET** /repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository |
||||
|
*RepositoryApi* | [**repo_create_hook**](docs/RepositoryApi.md#repo_create_hook) | **POST** /repos/{owner}/{repo}/hooks | Create a hook |
||||
|
*RepositoryApi* | [**repo_create_key**](docs/RepositoryApi.md#repo_create_key) | **POST** /repos/{owner}/{repo}/keys | Add a key to a repository |
||||
|
*RepositoryApi* | [**repo_create_pull_request**](docs/RepositoryApi.md#repo_create_pull_request) | **POST** /repos/{owner}/{repo}/pulls | Create a pull request |
||||
|
*RepositoryApi* | [**repo_create_release**](docs/RepositoryApi.md#repo_create_release) | **POST** /repos/{owner}/{repo}/releases | Create a release |
||||
|
*RepositoryApi* | [**repo_create_release_attachment**](docs/RepositoryApi.md#repo_create_release_attachment) | **POST** /repos/{owner}/{repo}/releases/{id}/assets | Create a release attachment |
||||
|
*RepositoryApi* | [**repo_create_status**](docs/RepositoryApi.md#repo_create_status) | **POST** /repos/{owner}/{repo}/statuses/{sha} | Create a commit status |
||||
|
*RepositoryApi* | [**repo_delete**](docs/RepositoryApi.md#repo_delete) | **DELETE** /repos/{owner}/{repo} | Delete a repository |
||||
|
*RepositoryApi* | [**repo_delete_collaborator**](docs/RepositoryApi.md#repo_delete_collaborator) | **DELETE** /repos/{owner}/{repo}/collaborators/{collaborator} | Delete a collaborator from a repository |
||||
|
*RepositoryApi* | [**repo_delete_hook**](docs/RepositoryApi.md#repo_delete_hook) | **DELETE** /repos/{owner}/{repo}/hooks/{id} | Delete a hook in a repository |
||||
|
*RepositoryApi* | [**repo_delete_key**](docs/RepositoryApi.md#repo_delete_key) | **DELETE** /repos/{owner}/{repo}/keys/{id} | Delete a key from a repository |
||||
|
*RepositoryApi* | [**repo_delete_release**](docs/RepositoryApi.md#repo_delete_release) | **DELETE** /repos/{owner}/{repo}/releases/{id} | Delete a release |
||||
|
*RepositoryApi* | [**repo_delete_release_attachment**](docs/RepositoryApi.md#repo_delete_release_attachment) | **DELETE** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Delete a release attachment |
||||
|
*RepositoryApi* | [**repo_edit_hook**](docs/RepositoryApi.md#repo_edit_hook) | **PATCH** /repos/{owner}/{repo}/hooks/{id} | Edit a hook in a repository |
||||
|
*RepositoryApi* | [**repo_edit_pull_request**](docs/RepositoryApi.md#repo_edit_pull_request) | **PATCH** /repos/{owner}/{repo}/pulls/{index} | Update a pull request |
||||
|
*RepositoryApi* | [**repo_edit_release**](docs/RepositoryApi.md#repo_edit_release) | **PATCH** /repos/{owner}/{repo}/releases/{id} | Update a release |
||||
|
*RepositoryApi* | [**repo_edit_release_attachment**](docs/RepositoryApi.md#repo_edit_release_attachment) | **PATCH** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Edit a release attachment |
||||
|
*RepositoryApi* | [**repo_get**](docs/RepositoryApi.md#repo_get) | **GET** /repos/{owner}/{repo} | Get a repository |
||||
|
*RepositoryApi* | [**repo_get_archive**](docs/RepositoryApi.md#repo_get_archive) | **GET** /repos/{owner}/{repo}/archive/{archive} | Get an archive of a repository |
||||
|
*RepositoryApi* | [**repo_get_branch**](docs/RepositoryApi.md#repo_get_branch) | **GET** /repos/{owner}/{repo}/branches/{branch} | Retrieve a specific branch from a repository |
||||
|
*RepositoryApi* | [**repo_get_by_id**](docs/RepositoryApi.md#repo_get_by_id) | **GET** /repositories/{id} | Get a repository by id |
||||
|
*RepositoryApi* | [**repo_get_combined_status_by_ref**](docs/RepositoryApi.md#repo_get_combined_status_by_ref) | **GET** /repos/{owner}/{repo}/commits/{ref}/statuses | Get a commit's combined status, by branch/tag/commit reference |
||||
|
*RepositoryApi* | [**repo_get_editor_config**](docs/RepositoryApi.md#repo_get_editor_config) | **GET** /repos/{owner}/{repo}/editorconfig/{filepath} | Get the EditorConfig definitions of a file in a repository |
||||
|
*RepositoryApi* | [**repo_get_hook**](docs/RepositoryApi.md#repo_get_hook) | **GET** /repos/{owner}/{repo}/hooks/{id} | Get a hook |
||||
|
*RepositoryApi* | [**repo_get_key**](docs/RepositoryApi.md#repo_get_key) | **GET** /repos/{owner}/{repo}/keys/{id} | Get a repository's key by id |
||||
|
*RepositoryApi* | [**repo_get_pull_request**](docs/RepositoryApi.md#repo_get_pull_request) | **GET** /repos/{owner}/{repo}/pulls/{index} | Get a pull request |
||||
|
*RepositoryApi* | [**repo_get_raw_file**](docs/RepositoryApi.md#repo_get_raw_file) | **GET** /repos/{owner}/{repo}/raw/{filepath} | Get a file from a repository |
||||
|
*RepositoryApi* | [**repo_get_release**](docs/RepositoryApi.md#repo_get_release) | **GET** /repos/{owner}/{repo}/releases/{id} | Get a release |
||||
|
*RepositoryApi* | [**repo_get_release_attachment**](docs/RepositoryApi.md#repo_get_release_attachment) | **GET** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Get a release attachment |
||||
|
*RepositoryApi* | [**repo_list_all_git_refs**](docs/RepositoryApi.md#repo_list_all_git_refs) | **GET** /repos/{owner}/{repo}/git/refs | Get specified ref or filtered repository's refs |
||||
|
*RepositoryApi* | [**repo_list_branches**](docs/RepositoryApi.md#repo_list_branches) | **GET** /repos/{owner}/{repo}/branches | List a repository's branches |
||||
|
*RepositoryApi* | [**repo_list_collaborators**](docs/RepositoryApi.md#repo_list_collaborators) | **GET** /repos/{owner}/{repo}/collaborators | List a repository's collaborators |
||||
|
*RepositoryApi* | [**repo_list_git_refs**](docs/RepositoryApi.md#repo_list_git_refs) | **GET** /repos/{owner}/{repo}/git/refs/{ref} | Get specified ref or filtered repository's refs |
||||
|
*RepositoryApi* | [**repo_list_hooks**](docs/RepositoryApi.md#repo_list_hooks) | **GET** /repos/{owner}/{repo}/hooks | List the hooks in a repository |
||||
|
*RepositoryApi* | [**repo_list_keys**](docs/RepositoryApi.md#repo_list_keys) | **GET** /repos/{owner}/{repo}/keys | List a repository's keys |
||||
|
*RepositoryApi* | [**repo_list_pull_requests**](docs/RepositoryApi.md#repo_list_pull_requests) | **GET** /repos/{owner}/{repo}/pulls | List a repo's pull requests |
||||
|
*RepositoryApi* | [**repo_list_release_attachments**](docs/RepositoryApi.md#repo_list_release_attachments) | **GET** /repos/{owner}/{repo}/releases/{id}/assets | List release's attachments |
||||
|
*RepositoryApi* | [**repo_list_releases**](docs/RepositoryApi.md#repo_list_releases) | **GET** /repos/{owner}/{repo}/releases | List a repo's releases |
||||
|
*RepositoryApi* | [**repo_list_stargazers**](docs/RepositoryApi.md#repo_list_stargazers) | **GET** /repos/{owner}/{repo}/stargazers | List a repo's stargazers |
||||
|
*RepositoryApi* | [**repo_list_statuses**](docs/RepositoryApi.md#repo_list_statuses) | **GET** /repos/{owner}/{repo}/statuses/{sha} | Get a commit's statuses |
||||
|
*RepositoryApi* | [**repo_list_subscribers**](docs/RepositoryApi.md#repo_list_subscribers) | **GET** /repos/{owner}/{repo}/subscribers | List a repo's watchers |
||||
|
*RepositoryApi* | [**repo_merge_pull_request**](docs/RepositoryApi.md#repo_merge_pull_request) | **POST** /repos/{owner}/{repo}/pulls/{index}/merge | Merge a pull request |
||||
|
*RepositoryApi* | [**repo_migrate**](docs/RepositoryApi.md#repo_migrate) | **POST** /repos/migrate | Migrate a remote git repository |
||||
|
*RepositoryApi* | [**repo_mirror_sync**](docs/RepositoryApi.md#repo_mirror_sync) | **POST** /repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository |
||||
|
*RepositoryApi* | [**repo_pull_request_is_merged**](docs/RepositoryApi.md#repo_pull_request_is_merged) | **GET** /repos/{owner}/{repo}/pulls/{index}/merge | Check if a pull request has been merged |
||||
|
*RepositoryApi* | [**repo_search**](docs/RepositoryApi.md#repo_search) | **GET** /repos/search | Search for repositories |
||||
|
*RepositoryApi* | [**repo_test_hook**](docs/RepositoryApi.md#repo_test_hook) | **POST** /repos/{owner}/{repo}/hooks/{id}/tests | Test a push webhook |
||||
|
*RepositoryApi* | [**repo_tracked_times**](docs/RepositoryApi.md#repo_tracked_times) | **GET** /repos/{owner}/{repo}/times | List a repo's tracked times |
||||
|
*RepositoryApi* | [**topic_search**](docs/RepositoryApi.md#topic_search) | **GET** /topics/search | search topics via keyword |
||||
|
*RepositoryApi* | [**user_current_check_subscription**](docs/RepositoryApi.md#user_current_check_subscription) | **GET** /repos/{owner}/{repo}/subscription | Check if the current user is watching a repo |
||||
|
*RepositoryApi* | [**user_current_delete_subscription**](docs/RepositoryApi.md#user_current_delete_subscription) | **DELETE** /repos/{owner}/{repo}/subscription | Unwatch a repo |
||||
|
*RepositoryApi* | [**user_current_put_subscription**](docs/RepositoryApi.md#user_current_put_subscription) | **PUT** /repos/{owner}/{repo}/subscription | Watch a repo |
||||
|
*UserApi* | [**create_current_user_repo**](docs/UserApi.md#create_current_user_repo) | **POST** /user/repos | Create a repository |
||||
|
*UserApi* | [**user_add_email**](docs/UserApi.md#user_add_email) | **POST** /user/emails | Add email addresses |
||||
|
*UserApi* | [**user_check_following**](docs/UserApi.md#user_check_following) | **GET** /users/{follower}/following/{followee} | Check if one user is following another user |
||||
|
*UserApi* | [**user_create_token**](docs/UserApi.md#user_create_token) | **POST** /users/{username}/tokens | Create an access token |
||||
|
*UserApi* | [**user_current_check_following**](docs/UserApi.md#user_current_check_following) | **GET** /user/following/{username} | Check whether a user is followed by the authenticated user |
||||
|
*UserApi* | [**user_current_check_starring**](docs/UserApi.md#user_current_check_starring) | **GET** /user/starred/{owner}/{repo} | Whether the authenticated is starring the repo |
||||
|
*UserApi* | [**user_current_delete_follow**](docs/UserApi.md#user_current_delete_follow) | **DELETE** /user/following/{username} | Unfollow a user |
||||
|
*UserApi* | [**user_current_delete_gpg_key**](docs/UserApi.md#user_current_delete_gpg_key) | **DELETE** /user/gpg_keys/{id} | Remove a GPG key |
||||
|
*UserApi* | [**user_current_delete_key**](docs/UserApi.md#user_current_delete_key) | **DELETE** /user/keys/{id} | Delete a public key |
||||
|
*UserApi* | [**user_current_delete_star**](docs/UserApi.md#user_current_delete_star) | **DELETE** /user/starred/{owner}/{repo} | Unstar the given repo |
||||
|
*UserApi* | [**user_current_get_gpg_key**](docs/UserApi.md#user_current_get_gpg_key) | **GET** /user/gpg_keys/{id} | Get a GPG key |
||||
|
*UserApi* | [**user_current_get_key**](docs/UserApi.md#user_current_get_key) | **GET** /user/keys/{id} | Get a public key |
||||
|
*UserApi* | [**user_current_list_followers**](docs/UserApi.md#user_current_list_followers) | **GET** /user/followers | List the authenticated user's followers |
||||
|
*UserApi* | [**user_current_list_following**](docs/UserApi.md#user_current_list_following) | **GET** /user/following | List the users that the authenticated user is following |
||||
|
*UserApi* | [**user_current_list_gpg_keys**](docs/UserApi.md#user_current_list_gpg_keys) | **GET** /user/gpg_keys | List the authenticated user's GPG keys |
||||
|
*UserApi* | [**user_current_list_keys**](docs/UserApi.md#user_current_list_keys) | **GET** /user/keys | List the authenticated user's public keys |
||||
|
*UserApi* | [**user_current_list_repos**](docs/UserApi.md#user_current_list_repos) | **GET** /user/repos | List the repos that the authenticated user owns or has access to |
||||
|
*UserApi* | [**user_current_list_starred**](docs/UserApi.md#user_current_list_starred) | **GET** /user/starred | The repos that the authenticated user has starred |
||||
|
*UserApi* | [**user_current_list_subscriptions**](docs/UserApi.md#user_current_list_subscriptions) | **GET** /user/subscriptions | List repositories watched by the authenticated user |
||||
|
*UserApi* | [**user_current_post_gpg_key**](docs/UserApi.md#user_current_post_gpg_key) | **POST** /user/gpg_keys | Create a GPG key |
||||
|
*UserApi* | [**user_current_post_key**](docs/UserApi.md#user_current_post_key) | **POST** /user/keys | Create a public key |
||||
|
*UserApi* | [**user_current_put_follow**](docs/UserApi.md#user_current_put_follow) | **PUT** /user/following/{username} | Follow a user |
||||
|
*UserApi* | [**user_current_put_star**](docs/UserApi.md#user_current_put_star) | **PUT** /user/starred/{owner}/{repo} | Star the given repo |
||||
|
*UserApi* | [**user_current_tracked_times**](docs/UserApi.md#user_current_tracked_times) | **GET** /user/times | List the current user's tracked times |
||||
|
*UserApi* | [**user_delete_access_token**](docs/UserApi.md#user_delete_access_token) | **DELETE** /users/{username}/tokens/{token} | delete an access token |
||||
|
*UserApi* | [**user_delete_email**](docs/UserApi.md#user_delete_email) | **DELETE** /user/emails | Delete email addresses |
||||
|
*UserApi* | [**user_get**](docs/UserApi.md#user_get) | **GET** /users/{username} | Get a user |
||||
|
*UserApi* | [**user_get_current**](docs/UserApi.md#user_get_current) | **GET** /user | Get the authenticated user |
||||
|
*UserApi* | [**user_get_heatmap_data**](docs/UserApi.md#user_get_heatmap_data) | **GET** /users/{username}/heatmap | Get a user's heatmap |
||||
|
*UserApi* | [**user_get_tokens**](docs/UserApi.md#user_get_tokens) | **GET** /users/{username}/tokens | List the authenticated user's access tokens |
||||
|
*UserApi* | [**user_list_emails**](docs/UserApi.md#user_list_emails) | **GET** /user/emails | List the authenticated user's email addresses |
||||
|
*UserApi* | [**user_list_followers**](docs/UserApi.md#user_list_followers) | **GET** /users/{username}/followers | List the given user's followers |
||||
|
*UserApi* | [**user_list_following**](docs/UserApi.md#user_list_following) | **GET** /users/{username}/following | List the users that the given user is following |
||||
|
*UserApi* | [**user_list_gpg_keys**](docs/UserApi.md#user_list_gpg_keys) | **GET** /users/{username}/gpg_keys | List the given user's GPG keys |
||||
|
*UserApi* | [**user_list_keys**](docs/UserApi.md#user_list_keys) | **GET** /users/{username}/keys | List the given user's public keys |
||||
|
*UserApi* | [**user_list_repos**](docs/UserApi.md#user_list_repos) | **GET** /users/{username}/repos | List the repos owned by the given user |
||||
|
*UserApi* | [**user_list_starred**](docs/UserApi.md#user_list_starred) | **GET** /users/{username}/starred | The repos that the given user has starred |
||||
|
*UserApi* | [**user_list_subscriptions**](docs/UserApi.md#user_list_subscriptions) | **GET** /users/{username}/subscriptions | List the repositories watched by a user |
||||
|
*UserApi* | [**user_search**](docs/UserApi.md#user_search) | **GET** /users/search | Search for users |
||||
|
*UserApi* | [**user_tracked_times**](docs/UserApi.md#user_tracked_times) | **GET** /repos/{owner}/{repo}/times/{user} | List a user's tracked times in a repo |
||||
|
|
||||
|
|
||||
|
## Documentation For Models |
||||
|
|
||||
|
- [AccessToken](docs/AccessToken.md) |
||||
|
- [AddCollaboratorOption](docs/AddCollaboratorOption.md) |
||||
|
- [AddTimeOption](docs/AddTimeOption.md) |
||||
|
- [Attachment](docs/Attachment.md) |
||||
|
- [Branch](docs/Branch.md) |
||||
|
- [Comment](docs/Comment.md) |
||||
|
- [CreateEmailOption](docs/CreateEmailOption.md) |
||||
|
- [CreateForkOption](docs/CreateForkOption.md) |
||||
|
- [CreateGPGKeyOption](docs/CreateGPGKeyOption.md) |
||||
|
- [CreateHookOption](docs/CreateHookOption.md) |
||||
|
- [CreateIssueCommentOption](docs/CreateIssueCommentOption.md) |
||||
|
- [CreateIssueOption](docs/CreateIssueOption.md) |
||||
|
- [CreateKeyOption](docs/CreateKeyOption.md) |
||||
|
- [CreateLabelOption](docs/CreateLabelOption.md) |
||||
|
- [CreateMilestoneOption](docs/CreateMilestoneOption.md) |
||||
|
- [CreateOrgOption](docs/CreateOrgOption.md) |
||||
|
- [CreatePullRequestOption](docs/CreatePullRequestOption.md) |
||||
|
- [CreateReleaseOption](docs/CreateReleaseOption.md) |
||||
|
- [CreateRepoOption](docs/CreateRepoOption.md) |
||||
|
- [CreateStatusOption](docs/CreateStatusOption.md) |
||||
|
- [CreateTeamOption](docs/CreateTeamOption.md) |
||||
|
- [CreateUserOption](docs/CreateUserOption.md) |
||||
|
- [DeleteEmailOption](docs/DeleteEmailOption.md) |
||||
|
- [DeployKey](docs/DeployKey.md) |
||||
|
- [EditAttachmentOptions](docs/EditAttachmentOptions.md) |
||||
|
- [EditDeadlineOption](docs/EditDeadlineOption.md) |
||||
|
- [EditHookOption](docs/EditHookOption.md) |
||||
|
- [EditIssueCommentOption](docs/EditIssueCommentOption.md) |
||||
|
- [EditIssueOption](docs/EditIssueOption.md) |
||||
|
- [EditLabelOption](docs/EditLabelOption.md) |
||||
|
- [EditMilestoneOption](docs/EditMilestoneOption.md) |
||||
|
- [EditOrgOption](docs/EditOrgOption.md) |
||||
|
- [EditPullRequestOption](docs/EditPullRequestOption.md) |
||||
|
- [EditReleaseOption](docs/EditReleaseOption.md) |
||||
|
- [EditTeamOption](docs/EditTeamOption.md) |
||||
|
- [EditUserOption](docs/EditUserOption.md) |
||||
|
- [Email](docs/Email.md) |
||||
|
- [GPGKey](docs/GPGKey.md) |
||||
|
- [GPGKeyEmail](docs/GPGKeyEmail.md) |
||||
|
- [GitEntry](docs/GitEntry.md) |
||||
|
- [GitObject](docs/GitObject.md) |
||||
|
- [GitTreeResponse](docs/GitTreeResponse.md) |
||||
|
- [InlineResponse200](docs/InlineResponse200.md) |
||||
|
- [Issue](docs/Issue.md) |
||||
|
- [IssueDeadline](docs/IssueDeadline.md) |
||||
|
- [IssueLabelsOption](docs/IssueLabelsOption.md) |
||||
|
- [Label](docs/Label.md) |
||||
|
- [MarkdownOption](docs/MarkdownOption.md) |
||||
|
- [MigrateRepoForm](docs/MigrateRepoForm.md) |
||||
|
- [Milestone](docs/Milestone.md) |
||||
|
- [Organization](docs/Organization.md) |
||||
|
- [PRBranchInfo](docs/PRBranchInfo.md) |
||||
|
- [PayloadCommit](docs/PayloadCommit.md) |
||||
|
- [PayloadCommitVerification](docs/PayloadCommitVerification.md) |
||||
|
- [PayloadUser](docs/PayloadUser.md) |
||||
|
- [Permission](docs/Permission.md) |
||||
|
- [PublicKey](docs/PublicKey.md) |
||||
|
- [PullRequest](docs/PullRequest.md) |
||||
|
- [PullRequestMeta](docs/PullRequestMeta.md) |
||||
|
- [Reference](docs/Reference.md) |
||||
|
- [Release](docs/Release.md) |
||||
|
- [Repository](docs/Repository.md) |
||||
|
- [SearchResults](docs/SearchResults.md) |
||||
|
- [ServerVersion](docs/ServerVersion.md) |
||||
|
- [StateType](docs/StateType.md) |
||||
|
- [Status](docs/Status.md) |
||||
|
- [StatusState](docs/StatusState.md) |
||||
|
- [Team](docs/Team.md) |
||||
|
- [TimeStamp](docs/TimeStamp.md) |
||||
|
- [TrackedTime](docs/TrackedTime.md) |
||||
|
- [User](docs/User.md) |
||||
|
- [UserHeatmapData](docs/UserHeatmapData.md) |
||||
|
- [WatchInfo](docs/WatchInfo.md) |
||||
|
|
||||
|
|
||||
|
## Documentation For Authorization |
||||
|
|
||||
|
|
||||
|
## AccessToken |
||||
|
|
||||
|
- **Type**: API key |
||||
|
- **API key parameter name**: access_token |
||||
|
- **Location**: URL query string |
||||
|
|
||||
|
## AuthorizationHeaderToken |
||||
|
|
||||
|
- **Type**: API key |
||||
|
- **API key parameter name**: Authorization |
||||
|
- **Location**: HTTP header |
||||
|
|
||||
|
## BasicAuth |
||||
|
|
||||
|
- **Type**: HTTP basic authentication |
||||
|
|
||||
|
## SudoHeader |
||||
|
|
||||
|
- **Type**: API key |
||||
|
- **API key parameter name**: Sudo |
||||
|
- **Location**: HTTP header |
||||
|
|
||||
|
## SudoParam |
||||
|
|
||||
|
- **Type**: API key |
||||
|
- **API key parameter name**: sudo |
||||
|
- **Location**: URL query string |
||||
|
|
||||
|
## Token |
||||
|
|
||||
|
- **Type**: API key |
||||
|
- **API key parameter name**: token |
||||
|
- **Location**: URL query string |
||||
|
|
||||
|
|
||||
|
## Author |
||||
|
|
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# AccessToken |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**name** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# AddCollaboratorOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**permission** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# AddTimeOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**time** | **int** | time in seconds | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,555 @@ |
|||||
|
# swagger_client.AdminApi |
||||
|
|
||||
|
All URIs are relative to *http://localhost/api/v1* |
||||
|
|
||||
|
Method | HTTP request | Description |
||||
|
------------- | ------------- | ------------- |
||||
|
[**admin_create_org**](AdminApi.md#admin_create_org) | **POST** /admin/users/{username}/orgs | Create an organization |
||||
|
[**admin_create_public_key**](AdminApi.md#admin_create_public_key) | **POST** /admin/users/{username}/keys | Add a public key on behalf of a user |
||||
|
[**admin_create_repo**](AdminApi.md#admin_create_repo) | **POST** /admin/users/{username}/repos | Create a repository on behalf a user |
||||
|
[**admin_create_user**](AdminApi.md#admin_create_user) | **POST** /admin/users | Create a user |
||||
|
[**admin_delete_user**](AdminApi.md#admin_delete_user) | **DELETE** /admin/users/{username} | Delete a user |
||||
|
[**admin_delete_user_public_key**](AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Delete a user's public key |
||||
|
[**admin_edit_user**](AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user |
||||
|
|
||||
|
|
||||
|
# **admin_create_org** |
||||
|
> Organization admin_create_org(username, organization) |
||||
|
|
||||
|
Create an organization |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of the user that will own the created organization |
||||
|
organization = swagger_client.CreateOrgOption() # CreateOrgOption | |
||||
|
|
||||
|
try: |
||||
|
# Create an organization |
||||
|
api_response = api_instance.admin_create_org(username, organization) |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_create_org: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**username** | **str**| username of the user that will own the created organization | |
||||
|
**organization** | [**CreateOrgOption**](CreateOrgOption.md)| | |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
[**Organization**](Organization.md) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **admin_create_public_key** |
||||
|
> PublicKey admin_create_public_key(username, key=key) |
||||
|
|
||||
|
Add a public key on behalf of a user |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of the user |
||||
|
key = swagger_client.CreateKeyOption() # CreateKeyOption | (optional) |
||||
|
|
||||
|
try: |
||||
|
# Add a public key on behalf of a user |
||||
|
api_response = api_instance.admin_create_public_key(username, key=key) |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_create_public_key: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**username** | **str**| username of the user | |
||||
|
**key** | [**CreateKeyOption**](CreateKeyOption.md)| | [optional] |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
[**PublicKey**](PublicKey.md) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **admin_create_repo** |
||||
|
> Repository admin_create_repo(username, repository) |
||||
|
|
||||
|
Create a repository on behalf a user |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of the user. This user will own the created repository |
||||
|
repository = swagger_client.CreateRepoOption() # CreateRepoOption | |
||||
|
|
||||
|
try: |
||||
|
# Create a repository on behalf a user |
||||
|
api_response = api_instance.admin_create_repo(username, repository) |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_create_repo: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**username** | **str**| username of the user. This user will own the created repository | |
||||
|
**repository** | [**CreateRepoOption**](CreateRepoOption.md)| | |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
[**Repository**](Repository.md) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **admin_create_user** |
||||
|
> User admin_create_user(body=body) |
||||
|
|
||||
|
Create a user |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
body = swagger_client.CreateUserOption() # CreateUserOption | (optional) |
||||
|
|
||||
|
try: |
||||
|
# Create a user |
||||
|
api_response = api_instance.admin_create_user(body=body) |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_create_user: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**body** | [**CreateUserOption**](CreateUserOption.md)| | [optional] |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
[**User**](User.md) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **admin_delete_user** |
||||
|
> admin_delete_user(username) |
||||
|
|
||||
|
Delete a user |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of user to delete |
||||
|
|
||||
|
try: |
||||
|
# Delete a user |
||||
|
api_instance.admin_delete_user(username) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_delete_user: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**username** | **str**| username of user to delete | |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
void (empty response body) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json, text/plain |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **admin_delete_user_public_key** |
||||
|
> admin_delete_user_public_key(username, id) |
||||
|
|
||||
|
Delete a user's public key |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of user |
||||
|
id = 789 # int | id of the key to delete |
||||
|
|
||||
|
try: |
||||
|
# Delete a user's public key |
||||
|
api_instance.admin_delete_user_public_key(username, id) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_delete_user_public_key: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**username** | **str**| username of user | |
||||
|
**id** | **int**| id of the key to delete | |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
void (empty response body) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json, text/plain |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **admin_edit_user** |
||||
|
> User admin_edit_user(username, body=body) |
||||
|
|
||||
|
Edit an existing user |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.AdminApi(swagger_client.ApiClient(configuration)) |
||||
|
username = 'username_example' # str | username of user to edit |
||||
|
body = swagger_client.EditUserOption() # EditUserOption | (optional) |
||||
|
|
||||
|
try: |
||||
|
# Edit an existing user |
||||
|
api_response = api_instance.admin_edit_user(username, body=body) |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling AdminApi->admin_edit_user: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**username** | **str**| username of user to edit | |
||||
|
**body** | [**EditUserOption**](EditUserOption.md)| | [optional] |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
[**User**](User.md) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# Attachment |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**browser_download_url** | **str** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**download_count** | **int** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**size** | **int** | | [optional] |
||||
|
**uuid** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# Branch |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**commit** | [**PayloadCommit**](PayloadCommit.md) | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
# Comment |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**body** | **str** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**html_url** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**issue_url** | **str** | | [optional] |
||||
|
**pull_request_url** | **str** | | [optional] |
||||
|
**updated_at** | **datetime** | | [optional] |
||||
|
**user** | [**User**](User.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# CreateEmailOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**emails** | **list[str]** | email addresses to add | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# CreateForkOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**organization** | **str** | organization name, if forking into an organization | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# CreateGPGKeyOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**armored_public_key** | **str** | An armored GPG key to add | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# CreateHookOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**active** | **bool** | | [optional] [default to False] |
||||
|
**config** | **dict(str, str)** | | |
||||
|
**events** | **list[str]** | | [optional] |
||||
|
**type** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# CreateIssueCommentOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**body** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
# CreateIssueOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assignee** | **str** | username of assignee | [optional] |
||||
|
**assignees** | **list[str]** | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**closed** | **bool** | | [optional] |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
**labels** | **list[int]** | list of label ids | [optional] |
||||
|
**milestone** | **int** | milestone id | [optional] |
||||
|
**title** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# CreateKeyOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**key** | **str** | An armored SSH key to add | |
||||
|
**read_only** | **bool** | Describe if the key has only read access or read/write | [optional] |
||||
|
**title** | **str** | Title of the key to add | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# CreateLabelOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**color** | **str** | | |
||||
|
**name** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# CreateMilestoneOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**due_on** | **datetime** | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
# CreateOrgOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**full_name** | **str** | | [optional] |
||||
|
**location** | **str** | | [optional] |
||||
|
**username** | **str** | | |
||||
|
**website** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
# CreatePullRequestOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assignee** | **str** | | [optional] |
||||
|
**assignees** | **list[str]** | | [optional] |
||||
|
**base** | **str** | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
**head** | **str** | | [optional] |
||||
|
**labels** | **list[int]** | | [optional] |
||||
|
**milestone** | **int** | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
# CreateReleaseOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**body** | **str** | | [optional] |
||||
|
**draft** | **bool** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**prerelease** | **bool** | | [optional] |
||||
|
**tag_name** | **str** | | |
||||
|
**target_commitish** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# CreateRepoOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**auto_init** | **bool** | Whether the repository should be auto-intialized? | [optional] |
||||
|
**description** | **str** | Description of the repository to create | [optional] |
||||
|
**gitignores** | **str** | Gitignores to use | [optional] |
||||
|
**license** | **str** | License to use | [optional] |
||||
|
**name** | **str** | Name of the repository to create | |
||||
|
**private** | **bool** | Whether the repository is private | [optional] |
||||
|
**readme** | **str** | Readme of the repository to create | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# CreateStatusOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**context** | **str** | | [optional] |
||||
|
**description** | **str** | | [optional] |
||||
|
**state** | [**StatusState**](StatusState.md) | | [optional] |
||||
|
**target_url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# CreateTeamOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**name** | **str** | | |
||||
|
**permission** | **str** | | [optional] |
||||
|
**units** | **list[str]** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# CreateUserOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**email** | **str** | | |
||||
|
**full_name** | **str** | | [optional] |
||||
|
**login_name** | **str** | | [optional] |
||||
|
**password** | **str** | | |
||||
|
**send_notify** | **bool** | | [optional] |
||||
|
**source_id** | **int** | | [optional] |
||||
|
**username** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# DeleteEmailOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**emails** | **list[str]** | email addresses to delete | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
# DeployKey |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**fingerprint** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**key** | **str** | | [optional] |
||||
|
**key_id** | **int** | | [optional] |
||||
|
**read_only** | **bool** | | [optional] |
||||
|
**repository** | [**Repository**](Repository.md) | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# EditAttachmentOptions |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**name** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# EditDeadlineOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**due_date** | **datetime** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# EditHookOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**active** | **bool** | | [optional] |
||||
|
**config** | **dict(str, str)** | | [optional] |
||||
|
**events** | **list[str]** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# EditIssueCommentOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**body** | **str** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# EditIssueOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assignee** | **str** | | [optional] |
||||
|
**assignees** | **list[str]** | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
**milestone** | **int** | | [optional] |
||||
|
**state** | **str** | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# EditLabelOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**color** | **str** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# EditMilestoneOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**due_on** | **datetime** | | [optional] |
||||
|
**state** | **str** | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# EditOrgOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**full_name** | **str** | | [optional] |
||||
|
**location** | **str** | | [optional] |
||||
|
**website** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
# EditPullRequestOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assignee** | **str** | | [optional] |
||||
|
**assignees** | **list[str]** | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
**labels** | **list[int]** | | [optional] |
||||
|
**milestone** | **int** | | [optional] |
||||
|
**state** | **str** | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
# EditReleaseOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**body** | **str** | | [optional] |
||||
|
**draft** | **bool** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**prerelease** | **bool** | | [optional] |
||||
|
**tag_name** | **str** | | [optional] |
||||
|
**target_commitish** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# EditTeamOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**name** | **str** | | |
||||
|
**permission** | **str** | | [optional] |
||||
|
**units** | **list[str]** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
# EditUserOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**active** | **bool** | | [optional] |
||||
|
**admin** | **bool** | | [optional] |
||||
|
**allow_create_organization** | **bool** | | [optional] |
||||
|
**allow_git_hook** | **bool** | | [optional] |
||||
|
**allow_import_local** | **bool** | | [optional] |
||||
|
**email** | **str** | | |
||||
|
**full_name** | **str** | | [optional] |
||||
|
**location** | **str** | | [optional] |
||||
|
**login_name** | **str** | | [optional] |
||||
|
**max_repo_creation** | **int** | | [optional] |
||||
|
**password** | **str** | | [optional] |
||||
|
**prohibit_login** | **bool** | | [optional] |
||||
|
**source_id** | **int** | | [optional] |
||||
|
**website** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# Email |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**email** | **str** | | [optional] |
||||
|
**primary** | **bool** | | [optional] |
||||
|
**verified** | **bool** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,21 @@ |
|||||
|
# GPGKey |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**can_certify** | **bool** | | [optional] |
||||
|
**can_encrypt_comms** | **bool** | | [optional] |
||||
|
**can_encrypt_storage** | **bool** | | [optional] |
||||
|
**can_sign** | **bool** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**emails** | [**list[GPGKeyEmail]**](GPGKeyEmail.md) | | [optional] |
||||
|
**expires_at** | **datetime** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**key_id** | **str** | | [optional] |
||||
|
**primary_key_id** | **str** | | [optional] |
||||
|
**public_key** | **str** | | [optional] |
||||
|
**subkeys** | [**list[GPGKey]**](GPGKey.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# GPGKeyEmail |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**email** | **str** | | [optional] |
||||
|
**verified** | **bool** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
# GitEntry |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**mode** | **str** | | [optional] |
||||
|
**path** | **str** | | [optional] |
||||
|
**sha** | **str** | | [optional] |
||||
|
**size** | **int** | | [optional] |
||||
|
**type** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# GitObject |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**sha** | **str** | | [optional] |
||||
|
**type** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# GitTreeResponse |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**sha** | **str** | | [optional] |
||||
|
**tree** | [**list[GitEntry]**](GitEntry.md) | | [optional] |
||||
|
**truncated** | **bool** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# InlineResponse200 |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**data** | [**list[User]**](User.md) | | [optional] |
||||
|
**ok** | **bool** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,26 @@ |
|||||
|
# Issue |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assignee** | [**User**](User.md) | | [optional] |
||||
|
**assignees** | [**list[User]**](User.md) | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**closed_at** | **datetime** | | [optional] |
||||
|
**comments** | **int** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**labels** | [**list[Label]**](Label.md) | | [optional] |
||||
|
**milestone** | [**Milestone**](Milestone.md) | | [optional] |
||||
|
**number** | **int** | | [optional] |
||||
|
**pull_request** | [**PullRequestMeta**](PullRequestMeta.md) | | [optional] |
||||
|
**state** | [**StateType**](StateType.md) | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
**updated_at** | **datetime** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
**user** | [**User**](User.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
File diff suppressed because it is too large
@ -0,0 +1,10 @@ |
|||||
|
# IssueDeadline |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# IssueLabelsOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**labels** | **list[int]** | list of label IDs | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# Label |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**color** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# MarkdownOption |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**context** | **str** | Context to render in: body | [optional] |
||||
|
**mode** | **str** | Mode to render in: body | [optional] |
||||
|
**text** | **str** | Text markdown to render in: body | [optional] |
||||
|
**wiki** | **bool** | Is it a wiki page ? in: body | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
# MigrateRepoForm |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**auth_password** | **str** | | [optional] |
||||
|
**auth_username** | **str** | | [optional] |
||||
|
**clone_addr** | **str** | | |
||||
|
**description** | **str** | | [optional] |
||||
|
**mirror** | **bool** | | [optional] |
||||
|
**private** | **bool** | | [optional] |
||||
|
**repo_name** | **str** | | |
||||
|
**uid** | **int** | | |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
# Milestone |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**closed_at** | **datetime** | | [optional] |
||||
|
**closed_issues** | **int** | | [optional] |
||||
|
**description** | **str** | | [optional] |
||||
|
**due_on** | **datetime** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**open_issues** | **int** | | [optional] |
||||
|
**state** | [**StateType**](StateType.md) | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,233 @@ |
|||||
|
# swagger_client.MiscellaneousApi |
||||
|
|
||||
|
All URIs are relative to *http://localhost/api/v1* |
||||
|
|
||||
|
Method | HTTP request | Description |
||||
|
------------- | ------------- | ------------- |
||||
|
[**get_version**](MiscellaneousApi.md#get_version) | **GET** /version | Returns the version of the Gitea application |
||||
|
[**render_markdown**](MiscellaneousApi.md#render_markdown) | **POST** /markdown | Render a markdown document as HTML |
||||
|
[**render_markdown_raw**](MiscellaneousApi.md#render_markdown_raw) | **POST** /markdown/raw | Render raw markdown as HTML |
||||
|
|
||||
|
|
||||
|
# **get_version** |
||||
|
> ServerVersion get_version() |
||||
|
|
||||
|
Returns the version of the Gitea application |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.MiscellaneousApi(swagger_client.ApiClient(configuration)) |
||||
|
|
||||
|
try: |
||||
|
# Returns the version of the Gitea application |
||||
|
api_response = api_instance.get_version() |
||||
|
pprint(api_response) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling MiscellaneousApi->get_version: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
This endpoint does not need any parameter. |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
[**ServerVersion**](ServerVersion.md) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json, text/plain |
||||
|
- **Accept**: application/json |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **render_markdown** |
||||
|
> render_markdown(body=body) |
||||
|
|
||||
|
Render a markdown document as HTML |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.MiscellaneousApi(swagger_client.ApiClient(configuration)) |
||||
|
body = swagger_client.MarkdownOption() # MarkdownOption | (optional) |
||||
|
|
||||
|
try: |
||||
|
# Render a markdown document as HTML |
||||
|
api_instance.render_markdown(body=body) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling MiscellaneousApi->render_markdown: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**body** | [**MarkdownOption**](MarkdownOption.md)| | [optional] |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
void (empty response body) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: application/json |
||||
|
- **Accept**: text/html |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
||||
|
# **render_markdown_raw** |
||||
|
> render_markdown_raw(body) |
||||
|
|
||||
|
Render raw markdown as HTML |
||||
|
|
||||
|
### Example |
||||
|
```python |
||||
|
from __future__ import print_function |
||||
|
import time |
||||
|
import swagger_client |
||||
|
from swagger_client.rest import ApiException |
||||
|
from pprint import pprint |
||||
|
|
||||
|
# Configure API key authorization: AccessToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['access_token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['access_token'] = 'Bearer' |
||||
|
# Configure API key authorization: AuthorizationHeaderToken |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Authorization'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Authorization'] = 'Bearer' |
||||
|
# Configure HTTP basic authorization: BasicAuth |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.username = 'YOUR_USERNAME' |
||||
|
configuration.password = 'YOUR_PASSWORD' |
||||
|
# Configure API key authorization: SudoHeader |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['Sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['Sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: SudoParam |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['sudo'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['sudo'] = 'Bearer' |
||||
|
# Configure API key authorization: Token |
||||
|
configuration = swagger_client.Configuration() |
||||
|
configuration.api_key['token'] = 'YOUR_API_KEY' |
||||
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
||||
|
# configuration.api_key_prefix['token'] = 'Bearer' |
||||
|
|
||||
|
# create an instance of the API class |
||||
|
api_instance = swagger_client.MiscellaneousApi(swagger_client.ApiClient(configuration)) |
||||
|
body = 'body_example' # str | Request body to render |
||||
|
|
||||
|
try: |
||||
|
# Render raw markdown as HTML |
||||
|
api_instance.render_markdown_raw(body) |
||||
|
except ApiException as e: |
||||
|
print("Exception when calling MiscellaneousApi->render_markdown_raw: %s\n" % e) |
||||
|
``` |
||||
|
|
||||
|
### Parameters |
||||
|
|
||||
|
Name | Type | Description | Notes |
||||
|
------------- | ------------- | ------------- | ------------- |
||||
|
**body** | **str**| Request body to render | |
||||
|
|
||||
|
### Return type |
||||
|
|
||||
|
void (empty response body) |
||||
|
|
||||
|
### Authorization |
||||
|
|
||||
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) |
||||
|
|
||||
|
### HTTP request headers |
||||
|
|
||||
|
- **Content-Type**: text/plain |
||||
|
- **Accept**: text/html |
||||
|
|
||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# Organization |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**avatar_url** | **str** | | [optional] |
||||
|
**description** | **str** | | [optional] |
||||
|
**full_name** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**location** | **str** | | [optional] |
||||
|
**username** | **str** | | [optional] |
||||
|
**website** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
File diff suppressed because it is too large
@ -0,0 +1,14 @@ |
|||||
|
# PRBranchInfo |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**label** | **str** | | [optional] |
||||
|
**ref** | **str** | | [optional] |
||||
|
**repo** | [**Repository**](Repository.md) | | [optional] |
||||
|
**repo_id** | **int** | | [optional] |
||||
|
**sha** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# PayloadCommit |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**author** | [**PayloadUser**](PayloadUser.md) | | [optional] |
||||
|
**committer** | [**PayloadUser**](PayloadUser.md) | | [optional] |
||||
|
**id** | **str** | sha1 hash of the commit | [optional] |
||||
|
**message** | **str** | | [optional] |
||||
|
**timestamp** | **datetime** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
**verification** | [**PayloadCommitVerification**](PayloadCommitVerification.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
# PayloadCommitVerification |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**payload** | **str** | | [optional] |
||||
|
**reason** | **str** | | [optional] |
||||
|
**signature** | **str** | | [optional] |
||||
|
**verified** | **bool** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# PayloadUser |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**email** | **str** | | [optional] |
||||
|
**name** | **str** | Full name of the commit author | [optional] |
||||
|
**username** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# Permission |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**admin** | **bool** | | [optional] |
||||
|
**pull** | **bool** | | [optional] |
||||
|
**push** | **bool** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
# PublicKey |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**fingerprint** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**key** | **str** | | [optional] |
||||
|
**key_type** | **str** | | [optional] |
||||
|
**read_only** | **bool** | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
**user** | [**User**](User.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,36 @@ |
|||||
|
# PullRequest |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assignee** | [**User**](User.md) | | [optional] |
||||
|
**assignees** | [**list[User]**](User.md) | | [optional] |
||||
|
**base** | [**PRBranchInfo**](PRBranchInfo.md) | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**closed_at** | **datetime** | | [optional] |
||||
|
**comments** | **int** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**diff_url** | **str** | | [optional] |
||||
|
**due_date** | **datetime** | | [optional] |
||||
|
**head** | [**PRBranchInfo**](PRBranchInfo.md) | | [optional] |
||||
|
**html_url** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**labels** | [**list[Label]**](Label.md) | | [optional] |
||||
|
**merge_base** | **str** | | [optional] |
||||
|
**merge_commit_sha** | **str** | | [optional] |
||||
|
**mergeable** | **bool** | | [optional] |
||||
|
**merged** | **bool** | | [optional] |
||||
|
**merged_at** | **datetime** | | [optional] |
||||
|
**merged_by** | [**User**](User.md) | | [optional] |
||||
|
**milestone** | [**Milestone**](Milestone.md) | | [optional] |
||||
|
**number** | **int** | | [optional] |
||||
|
**patch_url** | **str** | | [optional] |
||||
|
**state** | [**StateType**](StateType.md) | | [optional] |
||||
|
**title** | **str** | | [optional] |
||||
|
**updated_at** | **datetime** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
**user** | [**User**](User.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# PullRequestMeta |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**merged** | **bool** | | [optional] |
||||
|
**merged_at** | **datetime** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
# Reference |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**object** | [**GitObject**](GitObject.md) | | [optional] |
||||
|
**ref** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,23 @@ |
|||||
|
# Release |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**assets** | [**list[Attachment]**](Attachment.md) | | [optional] |
||||
|
**author** | [**User**](User.md) | | [optional] |
||||
|
**body** | **str** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**draft** | **bool** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**prerelease** | **bool** | | [optional] |
||||
|
**published_at** | **datetime** | | [optional] |
||||
|
**tag_name** | **str** | | [optional] |
||||
|
**tarball_url** | **str** | | [optional] |
||||
|
**target_commitish** | **str** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
**zipball_url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
# Repository |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**archived** | **bool** | | [optional] |
||||
|
**clone_url** | **str** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**default_branch** | **str** | | [optional] |
||||
|
**description** | **str** | | [optional] |
||||
|
**empty** | **bool** | | [optional] |
||||
|
**fork** | **bool** | | [optional] |
||||
|
**forks_count** | **int** | | [optional] |
||||
|
**full_name** | **str** | | [optional] |
||||
|
**html_url** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**mirror** | **bool** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**open_issues_count** | **int** | | [optional] |
||||
|
**owner** | [**User**](User.md) | | [optional] |
||||
|
**parent** | [**Repository**](Repository.md) | | [optional] |
||||
|
**permissions** | [**Permission**](Permission.md) | | [optional] |
||||
|
**private** | **bool** | | [optional] |
||||
|
**size** | **int** | | [optional] |
||||
|
**ssh_url** | **str** | | [optional] |
||||
|
**stars_count** | **int** | | [optional] |
||||
|
**updated_at** | **datetime** | | [optional] |
||||
|
**watchers_count** | **int** | | [optional] |
||||
|
**website** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
File diff suppressed because it is too large
@ -0,0 +1,11 @@ |
|||||
|
# SearchResults |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**data** | [**list[Repository]**](Repository.md) | | [optional] |
||||
|
**ok** | **bool** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,10 @@ |
|||||
|
# ServerVersion |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**version** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,9 @@ |
|||||
|
# StateType |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
# Status |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**context** | **str** | | [optional] |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**creator** | [**User**](User.md) | | [optional] |
||||
|
**description** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**status** | [**StatusState**](StatusState.md) | | [optional] |
||||
|
**target_url** | **str** | | [optional] |
||||
|
**updated_at** | **datetime** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,9 @@ |
|||||
|
# StatusState |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
# Team |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**description** | **str** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**name** | **str** | | [optional] |
||||
|
**permission** | **str** | | [optional] |
||||
|
**units** | **list[str]** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,9 @@ |
|||||
|
# TimeStamp |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,14 @@ |
|||||
|
# TrackedTime |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**created** | **datetime** | | [optional] |
||||
|
**id** | **int** | | [optional] |
||||
|
**issue_id** | **int** | | [optional] |
||||
|
**time** | **int** | Time in seconds | [optional] |
||||
|
**user_id** | **int** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
# User |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**avatar_url** | **str** | URL to the user's avatar | [optional] |
||||
|
**email** | **str** | | [optional] |
||||
|
**full_name** | **str** | the user's full name | [optional] |
||||
|
**id** | **int** | the user's id | [optional] |
||||
|
**language** | **str** | User locale | [optional] |
||||
|
**login** | **str** | the user's username | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
File diff suppressed because it is too large
@ -0,0 +1,11 @@ |
|||||
|
# UserHeatmapData |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**contributions** | **int** | | [optional] |
||||
|
**timestamp** | [**TimeStamp**](TimeStamp.md) | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,15 @@ |
|||||
|
# WatchInfo |
||||
|
|
||||
|
## Properties |
||||
|
Name | Type | Description | Notes |
||||
|
------------ | ------------- | ------------- | ------------- |
||||
|
**created_at** | **datetime** | | [optional] |
||||
|
**ignored** | **bool** | | [optional] |
||||
|
**reason** | **object** | | [optional] |
||||
|
**repository_url** | **str** | | [optional] |
||||
|
**subscribed** | **bool** | | [optional] |
||||
|
**url** | **str** | | [optional] |
||||
|
|
||||
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
||||
|
|
||||
|
|
@ -0,0 +1,52 @@ |
|||||
|
#!/bin/sh |
||||
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ |
||||
|
# |
||||
|
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" |
||||
|
|
||||
|
git_user_id=$1 |
||||
|
git_repo_id=$2 |
||||
|
release_note=$3 |
||||
|
|
||||
|
if [ "$git_user_id" = "" ]; then |
||||
|
git_user_id="GIT_USER_ID" |
||||
|
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" |
||||
|
fi |
||||
|
|
||||
|
if [ "$git_repo_id" = "" ]; then |
||||
|
git_repo_id="GIT_REPO_ID" |
||||
|
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" |
||||
|
fi |
||||
|
|
||||
|
if [ "$release_note" = "" ]; then |
||||
|
release_note="Minor update" |
||||
|
echo "[INFO] No command line input provided. Set \$release_note to $release_note" |
||||
|
fi |
||||
|
|
||||
|
# Initialize the local directory as a Git repository |
||||
|
git init |
||||
|
|
||||
|
# Adds the files in the local repository and stages them for commit. |
||||
|
git add . |
||||
|
|
||||
|
# Commits the tracked changes and prepares them to be pushed to a remote repository. |
||||
|
git commit -m "$release_note" |
||||
|
|
||||
|
# Sets the new remote |
||||
|
git_remote=`git remote` |
||||
|
if [ "$git_remote" = "" ]; then # git remote not defined |
||||
|
|
||||
|
if [ "$GIT_TOKEN" = "" ]; then |
||||
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." |
||||
|
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git |
||||
|
else |
||||
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git |
||||
|
fi |
||||
|
|
||||
|
fi |
||||
|
|
||||
|
git pull origin master |
||||
|
|
||||
|
# Pushes (Forces) the changes in the local repository up to the remote repository |
||||
|
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" |
||||
|
git push origin master 2>&1 | grep -v 'To https' |
||||
|
|
@ -0,0 +1,5 @@ |
|||||
|
certifi >= 14.05.14 |
||||
|
six >= 1.10 |
||||
|
python_dateutil >= 2.5.3 |
||||
|
setuptools >= 21.0.0 |
||||
|
urllib3 >= 1.15.1 |
@ -0,0 +1,46 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
||||
|
""" |
||||
|
|
||||
|
|
||||
|
from setuptools import setup, find_packages # noqa: H301 |
||||
|
|
||||
|
NAME = "swagger-client" |
||||
|
VERSION = "1.0.0" |
||||
|
# To install the library, run the following |
||||
|
# |
||||
|
# python setup.py install |
||||
|
# |
||||
|
# prerequisite: setuptools |
||||
|
# http://pypi.python.org/pypi/setuptools |
||||
|
|
||||
|
REQUIRES = [ |
||||
|
"certifi>=2017.4.17", |
||||
|
"python-dateutil>=2.1", |
||||
|
"six>=1.10", |
||||
|
"urllib3>=1.23" |
||||
|
] |
||||
|
|
||||
|
|
||||
|
setup( |
||||
|
name=NAME, |
||||
|
version=VERSION, |
||||
|
description="Gitea API.", |
||||
|
author_email="", |
||||
|
url="", |
||||
|
keywords=["Swagger", "Gitea API."], |
||||
|
install_requires=REQUIRES, |
||||
|
packages=find_packages(), |
||||
|
include_package_data=True, |
||||
|
long_description="""\ |
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
""" |
||||
|
) |
@ -0,0 +1,102 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
# flake8: noqa |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
||||
|
""" |
||||
|
|
||||
|
|
||||
|
from __future__ import absolute_import |
||||
|
|
||||
|
# import apis into sdk package |
||||
|
from swagger_client.api.admin_api import AdminApi |
||||
|
from swagger_client.api.issue_api import IssueApi |
||||
|
from swagger_client.api.miscellaneous_api import MiscellaneousApi |
||||
|
from swagger_client.api.organization_api import OrganizationApi |
||||
|
from swagger_client.api.repository_api import RepositoryApi |
||||
|
from swagger_client.api.user_api import UserApi |
||||
|
|
||||
|
# import ApiClient |
||||
|
from swagger_client.api_client import ApiClient |
||||
|
from swagger_client.configuration import Configuration |
||||
|
# import models into sdk package |
||||
|
from swagger_client.models.access_token import AccessToken |
||||
|
from swagger_client.models.add_collaborator_option import AddCollaboratorOption |
||||
|
from swagger_client.models.add_time_option import AddTimeOption |
||||
|
from swagger_client.models.attachment import Attachment |
||||
|
from swagger_client.models.branch import Branch |
||||
|
from swagger_client.models.comment import Comment |
||||
|
from swagger_client.models.create_email_option import CreateEmailOption |
||||
|
from swagger_client.models.create_fork_option import CreateForkOption |
||||
|
from swagger_client.models.create_gpg_key_option import CreateGPGKeyOption |
||||
|
from swagger_client.models.create_hook_option import CreateHookOption |
||||
|
from swagger_client.models.create_issue_comment_option import CreateIssueCommentOption |
||||
|
from swagger_client.models.create_issue_option import CreateIssueOption |
||||
|
from swagger_client.models.create_key_option import CreateKeyOption |
||||
|
from swagger_client.models.create_label_option import CreateLabelOption |
||||
|
from swagger_client.models.create_milestone_option import CreateMilestoneOption |
||||
|
from swagger_client.models.create_org_option import CreateOrgOption |
||||
|
from swagger_client.models.create_pull_request_option import CreatePullRequestOption |
||||
|
from swagger_client.models.create_release_option import CreateReleaseOption |
||||
|
from swagger_client.models.create_repo_option import CreateRepoOption |
||||
|
from swagger_client.models.create_status_option import CreateStatusOption |
||||
|
from swagger_client.models.create_team_option import CreateTeamOption |
||||
|
from swagger_client.models.create_user_option import CreateUserOption |
||||
|
from swagger_client.models.delete_email_option import DeleteEmailOption |
||||
|
from swagger_client.models.deploy_key import DeployKey |
||||
|
from swagger_client.models.edit_attachment_options import EditAttachmentOptions |
||||
|
from swagger_client.models.edit_deadline_option import EditDeadlineOption |
||||
|
from swagger_client.models.edit_hook_option import EditHookOption |
||||
|
from swagger_client.models.edit_issue_comment_option import EditIssueCommentOption |
||||
|
from swagger_client.models.edit_issue_option import EditIssueOption |
||||
|
from swagger_client.models.edit_label_option import EditLabelOption |
||||
|
from swagger_client.models.edit_milestone_option import EditMilestoneOption |
||||
|
from swagger_client.models.edit_org_option import EditOrgOption |
||||
|
from swagger_client.models.edit_pull_request_option import EditPullRequestOption |
||||
|
from swagger_client.models.edit_release_option import EditReleaseOption |
||||
|
from swagger_client.models.edit_team_option import EditTeamOption |
||||
|
from swagger_client.models.edit_user_option import EditUserOption |
||||
|
from swagger_client.models.email import Email |
||||
|
from swagger_client.models.gpg_key import GPGKey |
||||
|
from swagger_client.models.gpg_key_email import GPGKeyEmail |
||||
|
from swagger_client.models.git_entry import GitEntry |
||||
|
from swagger_client.models.git_object import GitObject |
||||
|
from swagger_client.models.git_tree_response import GitTreeResponse |
||||
|
from swagger_client.models.inline_response200 import InlineResponse200 |
||||
|
from swagger_client.models.issue import Issue |
||||
|
from swagger_client.models.issue_deadline import IssueDeadline |
||||
|
from swagger_client.models.issue_labels_option import IssueLabelsOption |
||||
|
from swagger_client.models.label import Label |
||||
|
from swagger_client.models.markdown_option import MarkdownOption |
||||
|
from swagger_client.models.migrate_repo_form import MigrateRepoForm |
||||
|
from swagger_client.models.milestone import Milestone |
||||
|
from swagger_client.models.organization import Organization |
||||
|
from swagger_client.models.pr_branch_info import PRBranchInfo |
||||
|
from swagger_client.models.payload_commit import PayloadCommit |
||||
|
from swagger_client.models.payload_commit_verification import PayloadCommitVerification |
||||
|
from swagger_client.models.payload_user import PayloadUser |
||||
|
from swagger_client.models.permission import Permission |
||||
|
from swagger_client.models.public_key import PublicKey |
||||
|
from swagger_client.models.pull_request import PullRequest |
||||
|
from swagger_client.models.pull_request_meta import PullRequestMeta |
||||
|
from swagger_client.models.reference import Reference |
||||
|
from swagger_client.models.release import Release |
||||
|
from swagger_client.models.repository import Repository |
||||
|
from swagger_client.models.search_results import SearchResults |
||||
|
from swagger_client.models.server_version import ServerVersion |
||||
|
from swagger_client.models.state_type import StateType |
||||
|
from swagger_client.models.status import Status |
||||
|
from swagger_client.models.status_state import StatusState |
||||
|
from swagger_client.models.team import Team |
||||
|
from swagger_client.models.time_stamp import TimeStamp |
||||
|
from swagger_client.models.tracked_time import TrackedTime |
||||
|
from swagger_client.models.user import User |
||||
|
from swagger_client.models.user_heatmap_data import UserHeatmapData |
||||
|
from swagger_client.models.watch_info import WatchInfo |
@ -0,0 +1,11 @@ |
|||||
|
from __future__ import absolute_import |
||||
|
|
||||
|
# flake8: noqa |
||||
|
|
||||
|
# import apis into api package |
||||
|
from swagger_client.api.admin_api import AdminApi |
||||
|
from swagger_client.api.issue_api import IssueApi |
||||
|
from swagger_client.api.miscellaneous_api import MiscellaneousApi |
||||
|
from swagger_client.api.organization_api import OrganizationApi |
||||
|
from swagger_client.api.repository_api import RepositoryApi |
||||
|
from swagger_client.api.user_api import UserApi |
@ -0,0 +1,741 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
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 swagger_client.api_client import ApiClient |
||||
|
|
||||
|
|
||||
|
class AdminApi(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 admin_create_org(self, username, organization, **kwargs): # noqa: E501 |
||||
|
"""Create an organization # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.admin_create_org(username, organization, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of the user that will own the created organization (required) |
||||
|
:param CreateOrgOption organization: (required) |
||||
|
:return: Organization |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.admin_create_org_with_http_info(username, organization, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_create_org_with_http_info(username, organization, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_create_org_with_http_info(self, username, organization, **kwargs): # noqa: E501 |
||||
|
"""Create an organization # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.admin_create_org_with_http_info(username, organization, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of the user that will own the created organization (required) |
||||
|
:param CreateOrgOption organization: (required) |
||||
|
:return: Organization |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['username', 'organization'] # 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 admin_create_org" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
# verify the required parameter 'username' is set |
||||
|
if ('username' not in params or |
||||
|
params['username'] is None): |
||||
|
raise ValueError("Missing the required parameter `username` when calling `admin_create_org`") # noqa: E501 |
||||
|
# verify the required parameter 'organization' is set |
||||
|
if ('organization' not in params or |
||||
|
params['organization'] is None): |
||||
|
raise ValueError("Missing the required parameter `organization` when calling `admin_create_org`") # noqa: E501 |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
if 'username' in params: |
||||
|
path_params['username'] = params['username'] # noqa: E501 |
||||
|
|
||||
|
query_params = [] |
||||
|
|
||||
|
header_params = {} |
||||
|
|
||||
|
form_params = [] |
||||
|
local_var_files = {} |
||||
|
|
||||
|
body_params = None |
||||
|
if 'organization' in params: |
||||
|
body_params = params['organization'] |
||||
|
# HTTP header `Accept` |
||||
|
header_params['Accept'] = self.api_client.select_header_accept( |
||||
|
['application/json']) # 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 = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users/{username}/orgs', 'POST', |
||||
|
path_params, |
||||
|
query_params, |
||||
|
header_params, |
||||
|
body=body_params, |
||||
|
post_params=form_params, |
||||
|
files=local_var_files, |
||||
|
response_type='Organization', # 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 admin_create_public_key(self, username, **kwargs): # noqa: E501 |
||||
|
"""Add a public key on behalf of a 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.admin_create_public_key(username, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of the user (required) |
||||
|
:param CreateKeyOption key: |
||||
|
:return: PublicKey |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.admin_create_public_key_with_http_info(username, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_create_public_key_with_http_info(username, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_create_public_key_with_http_info(self, username, **kwargs): # noqa: E501 |
||||
|
"""Add a public key on behalf of a 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.admin_create_public_key_with_http_info(username, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of the user (required) |
||||
|
:param CreateKeyOption key: |
||||
|
:return: PublicKey |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['username', 'key'] # 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 admin_create_public_key" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
# verify the required parameter 'username' is set |
||||
|
if ('username' not in params or |
||||
|
params['username'] is None): |
||||
|
raise ValueError("Missing the required parameter `username` when calling `admin_create_public_key`") # noqa: E501 |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
if 'username' in params: |
||||
|
path_params['username'] = params['username'] # noqa: E501 |
||||
|
|
||||
|
query_params = [] |
||||
|
|
||||
|
header_params = {} |
||||
|
|
||||
|
form_params = [] |
||||
|
local_var_files = {} |
||||
|
|
||||
|
body_params = None |
||||
|
if 'key' in params: |
||||
|
body_params = params['key'] |
||||
|
# HTTP header `Accept` |
||||
|
header_params['Accept'] = self.api_client.select_header_accept( |
||||
|
['application/json']) # 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 = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users/{username}/keys', 'POST', |
||||
|
path_params, |
||||
|
query_params, |
||||
|
header_params, |
||||
|
body=body_params, |
||||
|
post_params=form_params, |
||||
|
files=local_var_files, |
||||
|
response_type='PublicKey', # 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 admin_create_repo(self, username, repository, **kwargs): # noqa: E501 |
||||
|
"""Create a repository on behalf a 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.admin_create_repo(username, repository, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of the user. This user will own the created repository (required) |
||||
|
:param CreateRepoOption repository: (required) |
||||
|
:return: Repository |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.admin_create_repo_with_http_info(username, repository, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_create_repo_with_http_info(username, repository, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_create_repo_with_http_info(self, username, repository, **kwargs): # noqa: E501 |
||||
|
"""Create a repository on behalf a 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.admin_create_repo_with_http_info(username, repository, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of the user. This user will own the created repository (required) |
||||
|
:param CreateRepoOption repository: (required) |
||||
|
:return: Repository |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['username', 'repository'] # 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 admin_create_repo" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
# verify the required parameter 'username' is set |
||||
|
if ('username' not in params or |
||||
|
params['username'] is None): |
||||
|
raise ValueError("Missing the required parameter `username` when calling `admin_create_repo`") # noqa: E501 |
||||
|
# verify the required parameter 'repository' is set |
||||
|
if ('repository' not in params or |
||||
|
params['repository'] is None): |
||||
|
raise ValueError("Missing the required parameter `repository` when calling `admin_create_repo`") # noqa: E501 |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
if 'username' in params: |
||||
|
path_params['username'] = params['username'] # noqa: E501 |
||||
|
|
||||
|
query_params = [] |
||||
|
|
||||
|
header_params = {} |
||||
|
|
||||
|
form_params = [] |
||||
|
local_var_files = {} |
||||
|
|
||||
|
body_params = None |
||||
|
if 'repository' in params: |
||||
|
body_params = params['repository'] |
||||
|
# HTTP header `Accept` |
||||
|
header_params['Accept'] = self.api_client.select_header_accept( |
||||
|
['application/json']) # 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 = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users/{username}/repos', 'POST', |
||||
|
path_params, |
||||
|
query_params, |
||||
|
header_params, |
||||
|
body=body_params, |
||||
|
post_params=form_params, |
||||
|
files=local_var_files, |
||||
|
response_type='Repository', # 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 admin_create_user(self, **kwargs): # noqa: E501 |
||||
|
"""Create a 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.admin_create_user(async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param CreateUserOption body: |
||||
|
:return: User |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.admin_create_user_with_http_info(**kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_create_user_with_http_info(**kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_create_user_with_http_info(self, **kwargs): # noqa: E501 |
||||
|
"""Create a 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.admin_create_user_with_http_info(async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param CreateUserOption body: |
||||
|
:return: User |
||||
|
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 admin_create_user" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
|
||||
|
query_params = [] |
||||
|
|
||||
|
header_params = {} |
||||
|
|
||||
|
form_params = [] |
||||
|
local_var_files = {} |
||||
|
|
||||
|
body_params = None |
||||
|
if 'body' in params: |
||||
|
body_params = params['body'] |
||||
|
# HTTP header `Accept` |
||||
|
header_params['Accept'] = self.api_client.select_header_accept( |
||||
|
['application/json']) # 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 = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users', 'POST', |
||||
|
path_params, |
||||
|
query_params, |
||||
|
header_params, |
||||
|
body=body_params, |
||||
|
post_params=form_params, |
||||
|
files=local_var_files, |
||||
|
response_type='User', # 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 admin_delete_user(self, username, **kwargs): # noqa: E501 |
||||
|
"""Delete a 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.admin_delete_user(username, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of user to delete (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.admin_delete_user_with_http_info(username, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_delete_user_with_http_info(username, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_delete_user_with_http_info(self, username, **kwargs): # noqa: E501 |
||||
|
"""Delete a 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.admin_delete_user_with_http_info(username, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of user to delete (required) |
||||
|
:return: None |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['username'] # 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 admin_delete_user" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
# verify the required parameter 'username' is set |
||||
|
if ('username' not in params or |
||||
|
params['username'] is None): |
||||
|
raise ValueError("Missing the required parameter `username` when calling `admin_delete_user`") # noqa: E501 |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
if 'username' in params: |
||||
|
path_params['username'] = params['username'] # 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( |
||||
|
['application/json']) # noqa: E501 |
||||
|
|
||||
|
# HTTP header `Content-Type` |
||||
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 |
||||
|
['application/json', 'text/plain']) # noqa: E501 |
||||
|
|
||||
|
# Authentication setting |
||||
|
auth_settings = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users/{username}', 'DELETE', |
||||
|
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 admin_delete_user_public_key(self, username, id, **kwargs): # noqa: E501 |
||||
|
"""Delete a user's public key # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.admin_delete_user_public_key(username, id, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of user (required) |
||||
|
:param int id: id of the key to delete (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.admin_delete_user_public_key_with_http_info(username, id, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_delete_user_public_key_with_http_info(username, id, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_delete_user_public_key_with_http_info(self, username, id, **kwargs): # noqa: E501 |
||||
|
"""Delete a user's public key # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.admin_delete_user_public_key_with_http_info(username, id, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of user (required) |
||||
|
:param int id: id of the key to delete (required) |
||||
|
:return: None |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['username', '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 admin_delete_user_public_key" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
# verify the required parameter 'username' is set |
||||
|
if ('username' not in params or |
||||
|
params['username'] is None): |
||||
|
raise ValueError("Missing the required parameter `username` when calling `admin_delete_user_public_key`") # 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 `admin_delete_user_public_key`") # noqa: E501 |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
if 'username' in params: |
||||
|
path_params['username'] = params['username'] # noqa: E501 |
||||
|
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( |
||||
|
['application/json']) # noqa: E501 |
||||
|
|
||||
|
# HTTP header `Content-Type` |
||||
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 |
||||
|
['application/json', 'text/plain']) # noqa: E501 |
||||
|
|
||||
|
# Authentication setting |
||||
|
auth_settings = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users/{username}/keys/{id}', 'DELETE', |
||||
|
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 admin_edit_user(self, username, **kwargs): # noqa: E501 |
||||
|
"""Edit an existing 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.admin_edit_user(username, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of user to edit (required) |
||||
|
:param EditUserOption body: |
||||
|
:return: User |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.admin_edit_user_with_http_info(username, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.admin_edit_user_with_http_info(username, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def admin_edit_user_with_http_info(self, username, **kwargs): # noqa: E501 |
||||
|
"""Edit an existing 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.admin_edit_user_with_http_info(username, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str username: username of user to edit (required) |
||||
|
:param EditUserOption body: |
||||
|
:return: User |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['username', '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 admin_edit_user" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
# verify the required parameter 'username' is set |
||||
|
if ('username' not in params or |
||||
|
params['username'] is None): |
||||
|
raise ValueError("Missing the required parameter `username` when calling `admin_edit_user`") # noqa: E501 |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
if 'username' in params: |
||||
|
path_params['username'] = params['username'] # noqa: E501 |
||||
|
|
||||
|
query_params = [] |
||||
|
|
||||
|
header_params = {} |
||||
|
|
||||
|
form_params = [] |
||||
|
local_var_files = {} |
||||
|
|
||||
|
body_params = None |
||||
|
if 'body' in params: |
||||
|
body_params = params['body'] |
||||
|
# HTTP header `Accept` |
||||
|
header_params['Accept'] = self.api_client.select_header_accept( |
||||
|
['application/json']) # 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 = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/admin/users/{username}', 'PATCH', |
||||
|
path_params, |
||||
|
query_params, |
||||
|
header_params, |
||||
|
body=body_params, |
||||
|
post_params=form_params, |
||||
|
files=local_var_files, |
||||
|
response_type='User', # 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) |
File diff suppressed because it is too large
@ -0,0 +1,313 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
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 swagger_client.api_client import ApiClient |
||||
|
|
||||
|
|
||||
|
class MiscellaneousApi(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 get_version(self, **kwargs): # noqa: E501 |
||||
|
"""Returns the version of the Gitea application # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.get_version(async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:return: ServerVersion |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.get_version_with_http_info(**kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.get_version_with_http_info(**kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def get_version_with_http_info(self, **kwargs): # noqa: E501 |
||||
|
"""Returns the version of the Gitea application # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.get_version_with_http_info(async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:return: ServerVersion |
||||
|
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 get_version" % 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( |
||||
|
['application/json']) # noqa: E501 |
||||
|
|
||||
|
# HTTP header `Content-Type` |
||||
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 |
||||
|
['application/json', 'text/plain']) # noqa: E501 |
||||
|
|
||||
|
# Authentication setting |
||||
|
auth_settings = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/version', 'GET', |
||||
|
path_params, |
||||
|
query_params, |
||||
|
header_params, |
||||
|
body=body_params, |
||||
|
post_params=form_params, |
||||
|
files=local_var_files, |
||||
|
response_type='ServerVersion', # 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 render_markdown(self, **kwargs): # noqa: E501 |
||||
|
"""Render a markdown document as HTML # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.render_markdown(async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param MarkdownOption body: |
||||
|
:return: None |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
kwargs['_return_http_data_only'] = True |
||||
|
if kwargs.get('async_req'): |
||||
|
return self.render_markdown_with_http_info(**kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.render_markdown_with_http_info(**kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def render_markdown_with_http_info(self, **kwargs): # noqa: E501 |
||||
|
"""Render a markdown document as HTML # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.render_markdown_with_http_info(async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param MarkdownOption body: |
||||
|
:return: None |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['body'] # noqa: E501 |
||||
|
all_params.append('async_req') |
||||
|
all_params.append('_return_http_data_only') |
||||
|
all_params.append('_preload_content') |
||||
|
all_params.append('_request_timeout') |
||||
|
|
||||
|
params = locals() |
||||
|
for key, val in six.iteritems(params['kwargs']): |
||||
|
if key not in all_params: |
||||
|
raise TypeError( |
||||
|
"Got an unexpected keyword argument '%s'" |
||||
|
" to method render_markdown" % key |
||||
|
) |
||||
|
params[key] = val |
||||
|
del params['kwargs'] |
||||
|
|
||||
|
collection_formats = {} |
||||
|
|
||||
|
path_params = {} |
||||
|
|
||||
|
query_params = [] |
||||
|
|
||||
|
header_params = {} |
||||
|
|
||||
|
form_params = [] |
||||
|
local_var_files = {} |
||||
|
|
||||
|
body_params = None |
||||
|
if 'body' in params: |
||||
|
body_params = params['body'] |
||||
|
# HTTP header `Accept` |
||||
|
header_params['Accept'] = self.api_client.select_header_accept( |
||||
|
['text/html']) # 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 = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/markdown', '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 render_markdown_raw(self, body, **kwargs): # noqa: E501 |
||||
|
"""Render raw markdown as HTML # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.render_markdown_raw(body, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str body: Request body to render (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.render_markdown_raw_with_http_info(body, **kwargs) # noqa: E501 |
||||
|
else: |
||||
|
(data) = self.render_markdown_raw_with_http_info(body, **kwargs) # noqa: E501 |
||||
|
return data |
||||
|
|
||||
|
def render_markdown_raw_with_http_info(self, body, **kwargs): # noqa: E501 |
||||
|
"""Render raw markdown as HTML # noqa: E501 |
||||
|
|
||||
|
This method makes a synchronous HTTP request by default. To make an |
||||
|
asynchronous HTTP request, please pass async_req=True |
||||
|
>>> thread = api.render_markdown_raw_with_http_info(body, async_req=True) |
||||
|
>>> result = thread.get() |
||||
|
|
||||
|
:param async_req bool |
||||
|
:param str body: Request body to render (required) |
||||
|
:return: None |
||||
|
If the method is called asynchronously, |
||||
|
returns the request thread. |
||||
|
""" |
||||
|
|
||||
|
all_params = ['body'] # noqa: E501 |
||||
|
all_params.append('async_req') |
||||
|
all_params.append('_return_http_data_only') |
||||
|
all_params.append('_preload_content') |
||||
|
all_params.append('_request_timeout') |
||||
|
|
||||
|
params = locals() |
||||
|
for key, val in six.iteritems(params['kwargs']): |
||||
|
if key not in all_params: |
||||
|
raise TypeError( |
||||
|
"Got an unexpected keyword argument '%s'" |
||||
|
" to method render_markdown_raw" % 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 `render_markdown_raw`") # 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( |
||||
|
['text/html']) # noqa: E501 |
||||
|
|
||||
|
# HTTP header `Content-Type` |
||||
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 |
||||
|
['text/plain']) # noqa: E501 |
||||
|
|
||||
|
# Authentication setting |
||||
|
auth_settings = ['AccessToken', 'AuthorizationHeaderToken', 'BasicAuth', 'SudoHeader', 'SudoParam', 'Token'] # noqa: E501 |
||||
|
|
||||
|
return self.api_client.call_api( |
||||
|
'/markdown/raw', '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) |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,638 @@ |
|||||
|
# coding: utf-8 |
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
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 swagger_client.configuration import Configuration |
||||
|
import swagger_client.models |
||||
|
from swagger_client 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 |
||||
|
|
||||
|
# Use the pool property to lazily initialize the ThreadPool. |
||||
|
self._pool = None |
||||
|
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): |
||||
|
if self._pool is not None: |
||||
|
self._pool.close() |
||||
|
self._pool.join() |
||||
|
|
||||
|
@property |
||||
|
def pool(self): |
||||
|
if self._pool is None: |
||||
|
self._pool = ThreadPool() |
||||
|
return self._pool |
||||
|
|
||||
|
@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(swagger_client.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) |
||||
|
|
||||
|
with open(path, "wb") as f: |
||||
|
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 |
@ -0,0 +1,279 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
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 Configuration(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. |
||||
|
""" |
||||
|
|
||||
|
_default = None |
||||
|
|
||||
|
def __init__(self): |
||||
|
"""Constructor""" |
||||
|
if self._default: |
||||
|
for key in self._default.__dict__.keys(): |
||||
|
self.__dict__[key] = copy.copy(self._default.__dict__[key]) |
||||
|
return |
||||
|
|
||||
|
# Default Base url |
||||
|
self.host = "http://localhost/api/v1" |
||||
|
# 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 = {} |
||||
|
# Username for HTTP basic authentication |
||||
|
self.username = "" |
||||
|
# Password for HTTP basic authentication |
||||
|
self.password = "" |
||||
|
|
||||
|
# Logging Settings |
||||
|
self.logger = {} |
||||
|
self.logger["package_logger"] = logging.getLogger("swagger_client") |
||||
|
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 = '' |
||||
|
|
||||
|
@classmethod |
||||
|
def set_default(cls, default): |
||||
|
cls._default = default |
||||
|
|
||||
|
@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.api_key.get(identifier) and |
||||
|
self.api_key_prefix.get(identifier)): |
||||
|
return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 |
||||
|
elif self.api_key.get(identifier): |
||||
|
return self.api_key[identifier] |
||||
|
|
||||
|
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 { |
||||
|
'AccessToken': |
||||
|
{ |
||||
|
'type': 'api_key', |
||||
|
'in': 'query', |
||||
|
'key': 'access_token', |
||||
|
'value': self.get_api_key_with_prefix('access_token') |
||||
|
}, |
||||
|
'AuthorizationHeaderToken': |
||||
|
{ |
||||
|
'type': 'api_key', |
||||
|
'in': 'header', |
||||
|
'key': 'Authorization', |
||||
|
'value': self.get_api_key_with_prefix('Authorization') |
||||
|
}, |
||||
|
'BasicAuth': |
||||
|
{ |
||||
|
'type': 'basic', |
||||
|
'in': 'header', |
||||
|
'key': 'Authorization', |
||||
|
'value': self.get_basic_auth_token() |
||||
|
}, |
||||
|
'SudoHeader': |
||||
|
{ |
||||
|
'type': 'api_key', |
||||
|
'in': 'header', |
||||
|
'key': 'Sudo', |
||||
|
'value': self.get_api_key_with_prefix('Sudo') |
||||
|
}, |
||||
|
'SudoParam': |
||||
|
{ |
||||
|
'type': 'api_key', |
||||
|
'in': 'query', |
||||
|
'key': 'sudo', |
||||
|
'value': self.get_api_key_with_prefix('sudo') |
||||
|
}, |
||||
|
'Token': |
||||
|
{ |
||||
|
'type': 'api_key', |
||||
|
'in': 'query', |
||||
|
'key': 'token', |
||||
|
'value': self.get_api_key_with_prefix('token') |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
|
||||
|
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.1\n"\ |
||||
|
"SDK Package Version: 1.0.0".\ |
||||
|
format(env=sys.platform, pyversion=sys.version) |
@ -0,0 +1,90 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
# flake8: noqa |
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
||||
|
""" |
||||
|
|
||||
|
|
||||
|
from __future__ import absolute_import |
||||
|
|
||||
|
# import models into model package |
||||
|
from swagger_client.models.access_token import AccessToken |
||||
|
from swagger_client.models.add_collaborator_option import AddCollaboratorOption |
||||
|
from swagger_client.models.add_time_option import AddTimeOption |
||||
|
from swagger_client.models.attachment import Attachment |
||||
|
from swagger_client.models.branch import Branch |
||||
|
from swagger_client.models.comment import Comment |
||||
|
from swagger_client.models.create_email_option import CreateEmailOption |
||||
|
from swagger_client.models.create_fork_option import CreateForkOption |
||||
|
from swagger_client.models.create_gpg_key_option import CreateGPGKeyOption |
||||
|
from swagger_client.models.create_hook_option import CreateHookOption |
||||
|
from swagger_client.models.create_issue_comment_option import CreateIssueCommentOption |
||||
|
from swagger_client.models.create_issue_option import CreateIssueOption |
||||
|
from swagger_client.models.create_key_option import CreateKeyOption |
||||
|
from swagger_client.models.create_label_option import CreateLabelOption |
||||
|
from swagger_client.models.create_milestone_option import CreateMilestoneOption |
||||
|
from swagger_client.models.create_org_option import CreateOrgOption |
||||
|
from swagger_client.models.create_pull_request_option import CreatePullRequestOption |
||||
|
from swagger_client.models.create_release_option import CreateReleaseOption |
||||
|
from swagger_client.models.create_repo_option import CreateRepoOption |
||||
|
from swagger_client.models.create_status_option import CreateStatusOption |
||||
|
from swagger_client.models.create_team_option import CreateTeamOption |
||||
|
from swagger_client.models.create_user_option import CreateUserOption |
||||
|
from swagger_client.models.delete_email_option import DeleteEmailOption |
||||
|
from swagger_client.models.deploy_key import DeployKey |
||||
|
from swagger_client.models.edit_attachment_options import EditAttachmentOptions |
||||
|
from swagger_client.models.edit_deadline_option import EditDeadlineOption |
||||
|
from swagger_client.models.edit_hook_option import EditHookOption |
||||
|
from swagger_client.models.edit_issue_comment_option import EditIssueCommentOption |
||||
|
from swagger_client.models.edit_issue_option import EditIssueOption |
||||
|
from swagger_client.models.edit_label_option import EditLabelOption |
||||
|
from swagger_client.models.edit_milestone_option import EditMilestoneOption |
||||
|
from swagger_client.models.edit_org_option import EditOrgOption |
||||
|
from swagger_client.models.edit_pull_request_option import EditPullRequestOption |
||||
|
from swagger_client.models.edit_release_option import EditReleaseOption |
||||
|
from swagger_client.models.edit_team_option import EditTeamOption |
||||
|
from swagger_client.models.edit_user_option import EditUserOption |
||||
|
from swagger_client.models.email import Email |
||||
|
from swagger_client.models.gpg_key import GPGKey |
||||
|
from swagger_client.models.gpg_key_email import GPGKeyEmail |
||||
|
from swagger_client.models.git_entry import GitEntry |
||||
|
from swagger_client.models.git_object import GitObject |
||||
|
from swagger_client.models.git_tree_response import GitTreeResponse |
||||
|
from swagger_client.models.inline_response200 import InlineResponse200 |
||||
|
from swagger_client.models.issue import Issue |
||||
|
from swagger_client.models.issue_deadline import IssueDeadline |
||||
|
from swagger_client.models.issue_labels_option import IssueLabelsOption |
||||
|
from swagger_client.models.label import Label |
||||
|
from swagger_client.models.markdown_option import MarkdownOption |
||||
|
from swagger_client.models.migrate_repo_form import MigrateRepoForm |
||||
|
from swagger_client.models.milestone import Milestone |
||||
|
from swagger_client.models.organization import Organization |
||||
|
from swagger_client.models.pr_branch_info import PRBranchInfo |
||||
|
from swagger_client.models.payload_commit import PayloadCommit |
||||
|
from swagger_client.models.payload_commit_verification import PayloadCommitVerification |
||||
|
from swagger_client.models.payload_user import PayloadUser |
||||
|
from swagger_client.models.permission import Permission |
||||
|
from swagger_client.models.public_key import PublicKey |
||||
|
from swagger_client.models.pull_request import PullRequest |
||||
|
from swagger_client.models.pull_request_meta import PullRequestMeta |
||||
|
from swagger_client.models.reference import Reference |
||||
|
from swagger_client.models.release import Release |
||||
|
from swagger_client.models.repository import Repository |
||||
|
from swagger_client.models.search_results import SearchResults |
||||
|
from swagger_client.models.server_version import ServerVersion |
||||
|
from swagger_client.models.state_type import StateType |
||||
|
from swagger_client.models.status import Status |
||||
|
from swagger_client.models.status_state import StatusState |
||||
|
from swagger_client.models.team import Team |
||||
|
from swagger_client.models.time_stamp import TimeStamp |
||||
|
from swagger_client.models.tracked_time import TrackedTime |
||||
|
from swagger_client.models.user import User |
||||
|
from swagger_client.models.user_heatmap_data import UserHeatmapData |
||||
|
from swagger_client.models.watch_info import WatchInfo |
@ -0,0 +1,116 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
||||
|
""" |
||||
|
|
||||
|
|
||||
|
import pprint |
||||
|
import re # noqa: F401 |
||||
|
|
||||
|
import six |
||||
|
|
||||
|
|
||||
|
class AccessToken(object): |
||||
|
"""NOTE: This class is auto generated by the swagger code generator program. |
||||
|
|
||||
|
Do not edit the class manually. |
||||
|
""" |
||||
|
|
||||
|
""" |
||||
|
Attributes: |
||||
|
swagger_types (dict): The key is attribute name |
||||
|
and the value is attribute type. |
||||
|
attribute_map (dict): The key is attribute name |
||||
|
and the value is json key in definition. |
||||
|
""" |
||||
|
swagger_types = { |
||||
|
'name': 'str' |
||||
|
} |
||||
|
|
||||
|
attribute_map = { |
||||
|
'name': 'name' |
||||
|
} |
||||
|
|
||||
|
def __init__(self, name=None): # noqa: E501 |
||||
|
"""AccessToken - a model defined in Swagger""" # noqa: E501 |
||||
|
|
||||
|
self._name = None |
||||
|
self.discriminator = None |
||||
|
|
||||
|
self.name = name |
||||
|
|
||||
|
@property |
||||
|
def name(self): |
||||
|
"""Gets the name of this AccessToken. # noqa: E501 |
||||
|
|
||||
|
|
||||
|
:return: The name of this AccessToken. # noqa: E501 |
||||
|
:rtype: str |
||||
|
""" |
||||
|
return self._name |
||||
|
|
||||
|
@name.setter |
||||
|
def name(self, name): |
||||
|
"""Sets the name of this AccessToken. |
||||
|
|
||||
|
|
||||
|
:param name: The name of this AccessToken. # noqa: E501 |
||||
|
:type: str |
||||
|
""" |
||||
|
if name is None: |
||||
|
raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 |
||||
|
|
||||
|
self._name = name |
||||
|
|
||||
|
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(AccessToken, 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, AccessToken): |
||||
|
return False |
||||
|
|
||||
|
return self.__dict__ == other.__dict__ |
||||
|
|
||||
|
def __ne__(self, other): |
||||
|
"""Returns true if both objects are not equal""" |
||||
|
return not self == other |
@ -0,0 +1,115 @@ |
|||||
|
# coding: utf-8 |
||||
|
|
||||
|
""" |
||||
|
Gitea API. |
||||
|
|
||||
|
This documentation describes the Gitea API. # noqa: E501 |
||||
|
|
||||
|
OpenAPI spec version: 1.1.1 |
||||
|
|
||||
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
||||
|
""" |
||||
|
|
||||
|
|
||||
|
import pprint |
||||
|
import re # noqa: F401 |
||||
|
|
||||
|
import six |
||||
|
|
||||
|
|
||||
|
class AddCollaboratorOption(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 = { |
||||
|
'permission': 'str' |
||||
|
} |
||||
|
|
||||
|
attribute_map = { |
||||
|
'permission': 'permission' |
||||
|
} |
||||
|
|
||||
|
def __init__(self, permission=None): # noqa: E501 |
||||
|
"""AddCollaboratorOption - a model defined in Swagger""" # noqa: E501 |
||||
|
|
||||
|
self._permission = None |
||||
|
self.discriminator = None |
||||
|
|
||||
|
if permission is not None: |
||||
|
self.permission = permission |
||||
|
|
||||
|
@property |
||||
|
def permission(self): |
||||
|
"""Gets the permission of this AddCollaboratorOption. # noqa: E501 |
||||
|
|
||||
|
|
||||
|
:return: The permission of this AddCollaboratorOption. # noqa: E501 |
||||
|
:rtype: str |
||||
|
""" |
||||
|
return self._permission |
||||
|
|
||||
|
@permission.setter |
||||
|
def permission(self, permission): |
||||
|
"""Sets the permission of this AddCollaboratorOption. |
||||
|
|
||||
|
|
||||
|
:param permission: The permission of this AddCollaboratorOption. # noqa: E501 |
||||
|
:type: str |
||||
|
""" |
||||
|
|
||||
|
self._permission = permission |
||||
|
|
||||
|
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(AddCollaboratorOption, 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, AddCollaboratorOption): |
||||
|
return False |
||||
|
|
||||
|
return self.__dict__ == other.__dict__ |
||||
|
|
||||
|
def __ne__(self, other): |
||||
|
"""Returns true if both objects are not equal""" |
||||
|
return not self == other |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue