gitlab-to-gitea/gitea/api/admin_api.py

1440 lines
57 KiB
Python

# coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.17.0+rc1
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 gitea.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_adopt_repository(self, owner, repo, **kwargs): # noqa: E501
"""Adopt unadopted files as a repository # 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_adopt_repository(owner, repo, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: owner of the repo (required)
:param str repo: name of the repo (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_adopt_repository_with_http_info(owner, repo, **kwargs) # noqa: E501
else:
(data) = self.admin_adopt_repository_with_http_info(owner, repo, **kwargs) # noqa: E501
return data
def admin_adopt_repository_with_http_info(self, owner, repo, **kwargs): # noqa: E501
"""Adopt unadopted files as a repository # 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_adopt_repository_with_http_info(owner, repo, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: owner of the repo (required)
:param str repo: name of the repo (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['owner', 'repo'] # 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_adopt_repository" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'owner' is set
if self.api_client.client_side_validation and ('owner' not in params or
params['owner'] is None): # noqa: E501
raise ValueError("Missing the required parameter `owner` when calling `admin_adopt_repository`") # noqa: E501
# verify the required parameter 'repo' is set
if self.api_client.client_side_validation and ('repo' not in params or
params['repo'] is None): # noqa: E501
raise ValueError("Missing the required parameter `repo` when calling `admin_adopt_repository`") # noqa: E501
collection_formats = {}
path_params = {}
if 'owner' in params:
path_params['owner'] = params['owner'] # noqa: E501
if 'repo' in params:
path_params['repo'] = params['repo'] # 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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/unadopted/{owner}/{repo}', '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 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 self.api_client.client_side_validation and ('username' not in params or
params['username'] is None): # noqa: E501
raise ValueError("Missing the required parameter `username` when calling `admin_create_org`") # noqa: E501
# verify the required parameter 'organization' is set
if self.api_client.client_side_validation and ('organization' not in params or
params['organization'] is None): # noqa: E501
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', 'TOTPHeader', '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 self.api_client.client_side_validation and ('username' not in params or
params['username'] is None): # noqa: E501
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', 'TOTPHeader', '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 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_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 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_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 self.api_client.client_side_validation and ('username' not in params or
params['username'] is None): # noqa: E501
raise ValueError("Missing the required parameter `username` when calling `admin_create_repo`") # noqa: E501
# verify the required parameter 'repository' is set
if self.api_client.client_side_validation and ('repository' not in params or
params['repository'] is None): # noqa: E501
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', 'TOTPHeader', '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', 'TOTPHeader', '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_cron_list(self, **kwargs): # noqa: E501
"""List cron tasks # 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_cron_list(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:return: list[Cron]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.admin_cron_list_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.admin_cron_list_with_http_info(**kwargs) # noqa: E501
return data
def admin_cron_list_with_http_info(self, **kwargs): # noqa: E501
"""List cron tasks # 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_cron_list_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:return: list[Cron]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page', 'limit'] # 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_cron_list" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/cron', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[Cron]', # 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_cron_run(self, task, **kwargs): # noqa: E501
"""Run cron task # 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_cron_run(task, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str task: task to run (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_cron_run_with_http_info(task, **kwargs) # noqa: E501
else:
(data) = self.admin_cron_run_with_http_info(task, **kwargs) # noqa: E501
return data
def admin_cron_run_with_http_info(self, task, **kwargs): # noqa: E501
"""Run cron task # 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_cron_run_with_http_info(task, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str task: task to run (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['task'] # 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_cron_run" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'task' is set
if self.api_client.client_side_validation and ('task' not in params or
params['task'] is None): # noqa: E501
raise ValueError("Missing the required parameter `task` when calling `admin_cron_run`") # noqa: E501
collection_formats = {}
path_params = {}
if 'task' in params:
path_params['task'] = params['task'] # 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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/cron/{task}', '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 admin_delete_unadopted_repository(self, owner, repo, **kwargs): # noqa: E501
"""Delete unadopted files # 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_unadopted_repository(owner, repo, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: owner of the repo (required)
:param str repo: name of the repo (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_unadopted_repository_with_http_info(owner, repo, **kwargs) # noqa: E501
else:
(data) = self.admin_delete_unadopted_repository_with_http_info(owner, repo, **kwargs) # noqa: E501
return data
def admin_delete_unadopted_repository_with_http_info(self, owner, repo, **kwargs): # noqa: E501
"""Delete unadopted files # 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_unadopted_repository_with_http_info(owner, repo, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str owner: owner of the repo (required)
:param str repo: name of the repo (required)
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['owner', 'repo'] # 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_unadopted_repository" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'owner' is set
if self.api_client.client_side_validation and ('owner' not in params or
params['owner'] is None): # noqa: E501
raise ValueError("Missing the required parameter `owner` when calling `admin_delete_unadopted_repository`") # noqa: E501
# verify the required parameter 'repo' is set
if self.api_client.client_side_validation and ('repo' not in params or
params['repo'] is None): # noqa: E501
raise ValueError("Missing the required parameter `repo` when calling `admin_delete_unadopted_repository`") # noqa: E501
collection_formats = {}
path_params = {}
if 'owner' in params:
path_params['owner'] = params['owner'] # noqa: E501
if 'repo' in params:
path_params['repo'] = params['repo'] # 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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/unadopted/{owner}/{repo}', '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(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 self.api_client.client_side_validation and ('username' not in params or
params['username'] is None): # noqa: E501
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', 'TOTPHeader', '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 self.api_client.client_side_validation and ('username' not in params or
params['username'] is None): # noqa: E501
raise ValueError("Missing the required parameter `username` when calling `admin_delete_user_public_key`") # noqa: E501
# verify the required parameter 'id' is set
if self.api_client.client_side_validation and ('id' not in params or
params['id'] is None): # noqa: E501
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', 'TOTPHeader', '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 self.api_client.client_side_validation and ('username' not in params or
params['username'] is None): # noqa: E501
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', 'TOTPHeader', '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)
def admin_get_all_orgs(self, **kwargs): # noqa: E501
"""List all organizations # 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_get_all_orgs(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:return: list[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_get_all_orgs_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.admin_get_all_orgs_with_http_info(**kwargs) # noqa: E501
return data
def admin_get_all_orgs_with_http_info(self, **kwargs): # noqa: E501
"""List all organizations # 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_get_all_orgs_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:return: list[Organization]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page', 'limit'] # 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_get_all_orgs" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/orgs', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[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_get_all_users(self, **kwargs): # noqa: E501
"""List all users # 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_get_all_users(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:return: list[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_get_all_users_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.admin_get_all_users_with_http_info(**kwargs) # noqa: E501
return data
def admin_get_all_users_with_http_info(self, **kwargs): # noqa: E501
"""List all users # 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_get_all_users_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:return: list[User]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page', 'limit'] # 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_get_all_users" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/users', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[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_unadopted_list(self, **kwargs): # noqa: E501
"""List unadopted repositories # 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_unadopted_list(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:param str pattern: pattern of repositories to search for
:return: list[str]
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.admin_unadopted_list_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.admin_unadopted_list_with_http_info(**kwargs) # noqa: E501
return data
def admin_unadopted_list_with_http_info(self, **kwargs): # noqa: E501
"""List unadopted repositories # 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_unadopted_list_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page: page number of results to return (1-based)
:param int limit: page size of results
:param str pattern: pattern of repositories to search for
:return: list[str]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page', 'limit', 'pattern'] # 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_unadopted_list" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'page' in params:
query_params.append(('page', params['page'])) # noqa: E501
if 'limit' in params:
query_params.append(('limit', params['limit'])) # noqa: E501
if 'pattern' in params:
query_params.append(('pattern', params['pattern'])) # noqa: E501
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', 'TOTPHeader', 'Token'] # noqa: E501
return self.api_client.call_api(
'/admin/unadopted', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='list[str]', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)