memos-script/memos/api/memo_service_api.py
2024-04-30 10:31:09 +08:00

1687 lines
66 KiB
Python

# coding: utf-8
"""
api/v1/activity_service.proto
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: version not set
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 memos.api_client import ApiClient
class MemoServiceApi(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 memo_service_create_memo(self, body, **kwargs): # noqa: E501
"""CreateMemo creates a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_create_memo(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1CreateMemoRequest body: (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_create_memo_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.memo_service_create_memo_with_http_info(body, **kwargs) # noqa: E501
return data
def memo_service_create_memo_with_http_info(self, body, **kwargs): # noqa: E501
"""CreateMemo creates a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_create_memo_with_http_info(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1CreateMemoRequest body: (required)
:return: V1Memo
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 memo_service_create_memo" % 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 `memo_service_create_memo`") # 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(
['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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/memos', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Memo', # 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 memo_service_create_memo_comment(self, body, name, **kwargs): # noqa: E501
"""CreateMemoComment creates a comment for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_create_memo_comment(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1CreateMemoRequest body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_create_memo_comment_with_http_info(body, name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_create_memo_comment_with_http_info(body, name, **kwargs) # noqa: E501
return data
def memo_service_create_memo_comment_with_http_info(self, body, name, **kwargs): # noqa: E501
"""CreateMemoComment creates a comment for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_create_memo_comment_with_http_info(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1CreateMemoRequest body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body', 'name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_create_memo_comment" % 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 `memo_service_create_memo_comment`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_create_memo_comment`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/comments', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Memo', # 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 memo_service_delete_memo(self, name_4, **kwargs): # noqa: E501
"""DeleteMemo deletes a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_delete_memo(name_4, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name_4: The name of the memo. Format: memos/{id} (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_delete_memo_with_http_info(name_4, **kwargs) # noqa: E501
else:
(data) = self.memo_service_delete_memo_with_http_info(name_4, **kwargs) # noqa: E501
return data
def memo_service_delete_memo_with_http_info(self, name_4, **kwargs): # noqa: E501
"""DeleteMemo deletes a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_delete_memo_with_http_info(name_4, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name_4: The name of the memo. Format: memos/{id} (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name_4'] # 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 memo_service_delete_memo" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name_4' is set
if ('name_4' not in params or
params['name_4'] is None):
raise ValueError("Missing the required parameter `name_4` when calling `memo_service_delete_memo`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name_4' in params:
path_params['name_4'] = params['name_4'] # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name_4}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def memo_service_delete_memo_reaction(self, reaction_id, **kwargs): # noqa: E501
"""DeleteMemoReaction deletes a reaction for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_delete_memo_reaction(reaction_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param int reaction_id: (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_delete_memo_reaction_with_http_info(reaction_id, **kwargs) # noqa: E501
else:
(data) = self.memo_service_delete_memo_reaction_with_http_info(reaction_id, **kwargs) # noqa: E501
return data
def memo_service_delete_memo_reaction_with_http_info(self, reaction_id, **kwargs): # noqa: E501
"""DeleteMemoReaction deletes a reaction for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_delete_memo_reaction_with_http_info(reaction_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param int reaction_id: (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['reaction_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 memo_service_delete_memo_reaction" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'reaction_id' is set
if ('reaction_id' not in params or
params['reaction_id'] is None):
raise ValueError("Missing the required parameter `reaction_id` when calling `memo_service_delete_memo_reaction`") # noqa: E501
collection_formats = {}
path_params = {}
if 'reaction_id' in params:
path_params['reactionId'] = params['reaction_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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/reactions/{reactionId}', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def memo_service_export_memos(self, body, **kwargs): # noqa: E501
"""ExportMemos exports memos. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_export_memos(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1ExportMemosRequest body: (required)
:return: V1ExportMemosResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_export_memos_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.memo_service_export_memos_with_http_info(body, **kwargs) # noqa: E501
return data
def memo_service_export_memos_with_http_info(self, body, **kwargs): # noqa: E501
"""ExportMemos exports memos. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_export_memos_with_http_info(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1ExportMemosRequest body: (required)
:return: V1ExportMemosResponse
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 memo_service_export_memos" % 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 `memo_service_export_memos`") # 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(
['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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/memos:export', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1ExportMemosResponse', # 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 memo_service_get_memo(self, name_3, **kwargs): # noqa: E501
"""GetMemo gets a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_get_memo(name_3, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name_3: The name of the memo. Format: memos/{id} (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_get_memo_with_http_info(name_3, **kwargs) # noqa: E501
else:
(data) = self.memo_service_get_memo_with_http_info(name_3, **kwargs) # noqa: E501
return data
def memo_service_get_memo_with_http_info(self, name_3, **kwargs): # noqa: E501
"""GetMemo gets a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_get_memo_with_http_info(name_3, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name_3: The name of the memo. Format: memos/{id} (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name_3'] # 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 memo_service_get_memo" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name_3' is set
if ('name_3' not in params or
params['name_3'] is None):
raise ValueError("Missing the required parameter `name_3` when calling `memo_service_get_memo`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name_3' in params:
path_params['name_3'] = params['name_3'] # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name_3}', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Memo', # 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 memo_service_get_user_memos_stats(self, **kwargs): # noqa: E501
"""GetUserMemosStats gets stats of memos for 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.memo_service_get_user_memos_stats(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name is the name of the user to get stats for. Format: users/{id}
:param str timezone: timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
:param str filter: Same as ListMemosRequest.filter
:return: V1GetUserMemosStatsResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_get_user_memos_stats_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.memo_service_get_user_memos_stats_with_http_info(**kwargs) # noqa: E501
return data
def memo_service_get_user_memos_stats_with_http_info(self, **kwargs): # noqa: E501
"""GetUserMemosStats gets stats of memos for 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.memo_service_get_user_memos_stats_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: name is the name of the user to get stats for. Format: users/{id}
:param str timezone: timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
:param str filter: Same as ListMemosRequest.filter
:return: V1GetUserMemosStatsResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name', 'timezone', 'filter'] # 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 memo_service_get_user_memos_stats" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'name' in params:
query_params.append(('name', params['name'])) # noqa: E501
if 'timezone' in params:
query_params.append(('timezone', params['timezone'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/memos/stats', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1GetUserMemosStatsResponse', # 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 memo_service_list_memo_comments(self, name, **kwargs): # noqa: E501
"""ListMemoComments lists comments for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_comments(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoCommentsResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_list_memo_comments_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_list_memo_comments_with_http_info(name, **kwargs) # noqa: E501
return data
def memo_service_list_memo_comments_with_http_info(self, name, **kwargs): # noqa: E501
"""ListMemoComments lists comments for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_comments_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoCommentsResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_list_memo_comments" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_list_memo_comments`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/comments', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1ListMemoCommentsResponse', # 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 memo_service_list_memo_reactions(self, name, **kwargs): # noqa: E501
"""ListMemoReactions lists reactions for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_reactions(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoReactionsResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_list_memo_reactions_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_list_memo_reactions_with_http_info(name, **kwargs) # noqa: E501
return data
def memo_service_list_memo_reactions_with_http_info(self, name, **kwargs): # noqa: E501
"""ListMemoReactions lists reactions for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_reactions_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoReactionsResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_list_memo_reactions" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_list_memo_reactions`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/reactions', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1ListMemoReactionsResponse', # 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 memo_service_list_memo_relations(self, name, **kwargs): # noqa: E501
"""ListMemoRelations lists relations for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_relations(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoRelationsResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_list_memo_relations_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_list_memo_relations_with_http_info(name, **kwargs) # noqa: E501
return data
def memo_service_list_memo_relations_with_http_info(self, name, **kwargs): # noqa: E501
"""ListMemoRelations lists relations for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_relations_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoRelationsResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_list_memo_relations" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_list_memo_relations`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/relations', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1ListMemoRelationsResponse', # 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 memo_service_list_memo_resources(self, name, **kwargs): # noqa: E501
"""ListMemoResources lists resources for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_resources(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoResourcesResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_list_memo_resources_with_http_info(name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_list_memo_resources_with_http_info(name, **kwargs) # noqa: E501
return data
def memo_service_list_memo_resources_with_http_info(self, name, **kwargs): # noqa: E501
"""ListMemoResources lists resources for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memo_resources_with_http_info(name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1ListMemoResourcesResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_list_memo_resources" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_list_memo_resources`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/resources', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1ListMemoResourcesResponse', # 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 memo_service_list_memos(self, **kwargs): # noqa: E501
"""ListMemos lists memos with pagination and filter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memos(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page_size: The maximum number of memos to return.
:param str page_token: A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page.
:param str filter: Filter is used to filter memos returned in the list. Format: \"creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']\"
:return: V1ListMemosResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_list_memos_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.memo_service_list_memos_with_http_info(**kwargs) # noqa: E501
return data
def memo_service_list_memos_with_http_info(self, **kwargs): # noqa: E501
"""ListMemos lists memos with pagination and filter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_list_memos_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param int page_size: The maximum number of memos to return.
:param str page_token: A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page.
:param str filter: Filter is used to filter memos returned in the list. Format: \"creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']\"
:return: V1ListMemosResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['page_size', 'page_token', 'filter'] # 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 memo_service_list_memos" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'page_size' in params:
query_params.append(('pageSize', params['page_size'])) # noqa: E501
if 'page_token' in params:
query_params.append(('pageToken', params['page_token'])) # noqa: E501
if 'filter' in params:
query_params.append(('filter', params['filter'])) # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/memos', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1ListMemosResponse', # 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 memo_service_search_memos(self, **kwargs): # noqa: E501
"""SearchMemos searches memos. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_search_memos(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str filter: Filter is used to filter memos returned. Format: \"creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']\"
:return: V1SearchMemosResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_search_memos_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.memo_service_search_memos_with_http_info(**kwargs) # noqa: E501
return data
def memo_service_search_memos_with_http_info(self, **kwargs): # noqa: E501
"""SearchMemos searches memos. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_search_memos_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str filter: Filter is used to filter memos returned. Format: \"creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']\"
:return: V1SearchMemosResponse
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['filter'] # 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 memo_service_search_memos" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
if 'filter' in params:
query_params.append(('filter', params['filter'])) # 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
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/memos:search', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1SearchMemosResponse', # 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 memo_service_set_memo_relations(self, body, name, **kwargs): # noqa: E501
"""SetMemoRelations sets relations for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_set_memo_relations(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param MemoServiceSetMemoRelationsBody body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_set_memo_relations_with_http_info(body, name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_set_memo_relations_with_http_info(body, name, **kwargs) # noqa: E501
return data
def memo_service_set_memo_relations_with_http_info(self, body, name, **kwargs): # noqa: E501
"""SetMemoRelations sets relations for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_set_memo_relations_with_http_info(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param MemoServiceSetMemoRelationsBody body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body', 'name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_set_memo_relations" % 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 `memo_service_set_memo_relations`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_set_memo_relations`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/relations', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def memo_service_set_memo_resources(self, body, name, **kwargs): # noqa: E501
"""SetMemoResources sets resources for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_set_memo_resources(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param MemoServiceSetMemoResourcesBody body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_set_memo_resources_with_http_info(body, name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_set_memo_resources_with_http_info(body, name, **kwargs) # noqa: E501
return data
def memo_service_set_memo_resources_with_http_info(self, body, name, **kwargs): # noqa: E501
"""SetMemoResources sets resources for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_set_memo_resources_with_http_info(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param MemoServiceSetMemoResourcesBody body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body', 'name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_set_memo_resources" % 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 `memo_service_set_memo_resources`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_set_memo_resources`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/resources', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def memo_service_update_memo(self, body, memo_name, **kwargs): # noqa: E501
"""UpdateMemo updates a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_update_memo(body, memo_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1MemoNameBody body: (required)
:param str memo_name: The name of the memo. Format: memos/{id} id is the system generated id. (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_update_memo_with_http_info(body, memo_name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_update_memo_with_http_info(body, memo_name, **kwargs) # noqa: E501
return data
def memo_service_update_memo_with_http_info(self, body, memo_name, **kwargs): # noqa: E501
"""UpdateMemo updates a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_update_memo_with_http_info(body, memo_name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param V1MemoNameBody body: (required)
:param str memo_name: The name of the memo. Format: memos/{id} id is the system generated id. (required)
:return: V1Memo
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body', 'memo_name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_update_memo" % 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 `memo_service_update_memo`") # noqa: E501
# verify the required parameter 'memo_name' is set
if ('memo_name' not in params or
params['memo_name'] is None):
raise ValueError("Missing the required parameter `memo_name` when calling `memo_service_update_memo`") # noqa: E501
collection_formats = {}
path_params = {}
if 'memo_name' in params:
path_params['memo.name'] = params['memo_name'] # 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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{memo.name}', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Memo', # 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 memo_service_upsert_memo_reaction(self, body, name, **kwargs): # noqa: E501
"""UpsertMemoReaction upserts a reaction for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_upsert_memo_reaction(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param MemoServiceUpsertMemoReactionBody body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1Reaction
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.memo_service_upsert_memo_reaction_with_http_info(body, name, **kwargs) # noqa: E501
else:
(data) = self.memo_service_upsert_memo_reaction_with_http_info(body, name, **kwargs) # noqa: E501
return data
def memo_service_upsert_memo_reaction_with_http_info(self, body, name, **kwargs): # noqa: E501
"""UpsertMemoReaction upserts a reaction for a memo. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.memo_service_upsert_memo_reaction_with_http_info(body, name, async_req=True)
>>> result = thread.get()
:param async_req bool
:param MemoServiceUpsertMemoReactionBody body: (required)
:param str name: The name of the memo. Format: memos/{id} (required)
:return: V1Reaction
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body', 'name'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method memo_service_upsert_memo_reaction" % 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 `memo_service_upsert_memo_reaction`") # noqa: E501
# verify the required parameter 'name' is set
if ('name' not in params or
params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `memo_service_upsert_memo_reaction`") # noqa: E501
collection_formats = {}
path_params = {}
if 'name' in params:
path_params['name'] = params['name'] # 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 = [] # noqa: E501
return self.api_client.call_api(
'/api/v1/{name}/reactions', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Reaction', # 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)