Skip to content

Commit bcd628e

Browse files
authored
Merge pull request #21 from merge-api/add-create-attachments
add create_attachment
2 parents 047f4be + ed47c16 commit bcd628e

12 files changed

+482
-17
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ MergeATSClient/model/activity_type_enum.py
3838
MergeATSClient/model/application.py
3939
MergeATSClient/model/application_request.py
4040
MergeATSClient/model/attachment.py
41+
MergeATSClient/model/attachment_request.py
4142
MergeATSClient/model/available_actions.py
4243
MergeATSClient/model/candidate.py
4344
MergeATSClient/model/candidate_request.py
@@ -114,6 +115,7 @@ docs/Application.md
114115
docs/ApplicationRequest.md
115116
docs/ApplicationsApi.md
116117
docs/Attachment.md
118+
docs/AttachmentRequest.md
117119
docs/AttachmentsApi.md
118120
docs/AvailableActions.md
119121
docs/AvailableActionsApi.md
@@ -199,15 +201,5 @@ setup.cfg
199201
setup.py
200202
test-requirements.txt
201203
test/__init__.py
202-
test/test_application_request.py
203-
test/test_candidate_request.py
204-
test/test_email_address_request.py
205-
test/test_generate_key_api.py
206-
test/test_generate_remote_key_request.py
207-
test/test_patched_application_request.py
208-
test/test_phone_number_request.py
209-
test/test_remote_data_request.py
210-
test/test_sync_status.py
211-
test/test_sync_status_api.py
212-
test/test_url_request.py
204+
test/test_attachment_request.py
213205
tox.ini

MergeATSClient/api/attachments_api.py

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
validate_and_convert_types
2424
)
2525
from MergeATSClient.model.attachment import Attachment
26+
from MergeATSClient.model.attachment_request import AttachmentRequest
2627
from MergeATSClient.model.paginated_attachment_list import PaginatedAttachmentList
2728

2829

@@ -38,6 +39,150 @@ def __init__(self, api_client=None):
3839
api_client = ApiClient()
3940
self.api_client = api_client
4041

42+
def __attachments_create(
43+
self,
44+
x_account_token,
45+
remote_user_id,
46+
**kwargs
47+
):
48+
"""attachments_create # noqa: E501
49+
50+
Creates an `Attachment` object with the given values. # noqa: E501
51+
This method makes a synchronous HTTP request by default. To make an
52+
asynchronous HTTP request, please pass async_req=True
53+
54+
>>> thread = api.attachments_create(x_account_token, remote_user_id, async_req=True)
55+
>>> result = thread.get()
56+
57+
Args:
58+
x_account_token (str): Token identifying the end user.
59+
remote_user_id (str): The ID of the RemoteUser deleting the resource. This can be found in the ID field (not remote_id) in the RemoteUser table.
60+
61+
Keyword Args:
62+
run_async (bool): Whether or not third-party updates should be run asynchronously.. [optional]
63+
attachment_request (AttachmentRequest): [optional]
64+
_return_http_data_only (bool): response data without head status
65+
code and headers. Default is True.
66+
_preload_content (bool): if False, the urllib3.HTTPResponse object
67+
will be returned without reading/decoding response data.
68+
Default is True.
69+
_request_timeout (float/tuple): timeout setting for this request. If one
70+
number provided, it will be total request timeout. It can also
71+
be a pair (tuple) of (connection, read) timeouts.
72+
Default is None.
73+
_check_input_type (bool): specifies if type checking
74+
should be done one the data sent to the server.
75+
Default is True.
76+
_check_return_type (bool): specifies if type checking
77+
should be done one the data received from the server.
78+
Default is True.
79+
_host_index (int/None): specifies the index of the server
80+
that we want to use.
81+
Default is read from the configuration.
82+
async_req (bool): execute request asynchronously
83+
84+
Returns:
85+
Attachment
86+
If the method is called asynchronously, returns the request
87+
thread.
88+
"""
89+
kwargs['async_req'] = kwargs.get(
90+
'async_req', False
91+
)
92+
kwargs['_return_http_data_only'] = kwargs.get(
93+
'_return_http_data_only', True
94+
)
95+
kwargs['_preload_content'] = kwargs.get(
96+
'_preload_content', True
97+
)
98+
kwargs['_request_timeout'] = kwargs.get(
99+
'_request_timeout', None
100+
)
101+
kwargs['_check_input_type'] = kwargs.get(
102+
'_check_input_type', True
103+
)
104+
kwargs['_check_return_type'] = kwargs.get(
105+
'_check_return_type', True
106+
)
107+
kwargs['_host_index'] = kwargs.get('_host_index')
108+
kwargs['x_account_token'] = \
109+
x_account_token
110+
kwargs['remote_user_id'] = \
111+
remote_user_id
112+
return self.call_with_http_info(**kwargs)
113+
114+
self.attachments_create = Endpoint(
115+
settings={
116+
'response_type': (Attachment,),
117+
'auth': [
118+
'tokenAuth'
119+
],
120+
'endpoint_path': '/attachments',
121+
'operation_id': 'attachments_create',
122+
'http_method': 'POST',
123+
'servers': None,
124+
},
125+
params_map={
126+
'all': [
127+
'x_account_token',
128+
'remote_user_id',
129+
'run_async',
130+
'attachment_request',
131+
],
132+
'required': [
133+
'x_account_token',
134+
'remote_user_id',
135+
],
136+
'nullable': [
137+
],
138+
'enum': [
139+
],
140+
'validation': [
141+
]
142+
},
143+
root_map={
144+
'validations': {
145+
},
146+
'allowed_values': {
147+
},
148+
'openapi_types': {
149+
'x_account_token':
150+
(str,),
151+
'remote_user_id':
152+
(str,),
153+
'run_async':
154+
(bool,),
155+
'attachment_request':
156+
(AttachmentRequest,),
157+
},
158+
'attribute_map': {
159+
'x_account_token': 'X-Account-Token',
160+
'remote_user_id': 'remote_user_id',
161+
'run_async': 'run_async',
162+
},
163+
'location_map': {
164+
'x_account_token': 'header',
165+
'remote_user_id': 'query',
166+
'run_async': 'query',
167+
'attachment_request': 'body',
168+
},
169+
'collection_format_map': {
170+
}
171+
},
172+
headers_map={
173+
'accept': [
174+
'application/json'
175+
],
176+
'content_type': [
177+
'application/json',
178+
'application/x-www-form-urlencoded',
179+
'multipart/form-data'
180+
]
181+
},
182+
api_client=api_client,
183+
callable=__attachments_create
184+
)
185+
41186
def __attachments_list(
42187
self,
43188
x_account_token,
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
"""
2+
Merge ATS API
3+
4+
The unified API for building rich integrations with multiple Applicant Tracking System platforms. # noqa: E501
5+
6+
The version of the OpenAPI document: 1.0
7+
8+
Generated by: https://openapi-generator.tech
9+
"""
10+
11+
12+
import re # noqa: F401
13+
import sys # noqa: F401
14+
15+
import nulltype # noqa: F401
16+
17+
from MergeATSClient.model_utils import ( # noqa: F401
18+
ApiTypeError,
19+
ModelComposed,
20+
ModelNormal,
21+
ModelSimple,
22+
cached_property,
23+
change_keys_js_to_python,
24+
convert_js_args_to_python_args,
25+
date,
26+
datetime,
27+
file_type,
28+
none_type,
29+
validate_get_composed_info,
30+
)
31+
32+
33+
class AttachmentRequest(ModelNormal):
34+
"""NOTE: This class is auto generated by OpenAPI Generator.
35+
Ref: https://openapi-generator.tech
36+
37+
Do not edit the class manually.
38+
39+
Attributes:
40+
allowed_values (dict): The key is the tuple path to the attribute
41+
and the for var_name this is (var_name,). The value is a dict
42+
with a capitalized key describing the allowed value and an allowed
43+
value. These dicts store the allowed enum values.
44+
attribute_map (dict): The key is attribute name
45+
and the value is json key in definition.
46+
discriminator_value_class_map (dict): A dict to go from the discriminator
47+
variable value to the discriminator class name.
48+
validations (dict): The key is the tuple path to the attribute
49+
and the for var_name this is (var_name,). The value is a dict
50+
that stores validations for max_length, min_length, max_items,
51+
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
52+
inclusive_minimum, and regex.
53+
additional_properties_type (tuple): A tuple of classes accepted
54+
as additional properties values.
55+
"""
56+
57+
allowed_values = {
58+
}
59+
60+
validations = {
61+
('file_url',): {
62+
'max_length': 2000,
63+
},
64+
}
65+
66+
additional_properties_type = None
67+
68+
_nullable = False
69+
70+
@cached_property
71+
def openapi_types():
72+
"""
73+
This must be a method because a model may have properties that are
74+
of type self, this must run after the class is loaded
75+
76+
Returns
77+
openapi_types (dict): The key is attribute name
78+
and the value is attribute type.
79+
"""
80+
return {
81+
'remote_id': (str, none_type,), # noqa: E501
82+
'file_name': (str, none_type,), # noqa: E501
83+
'file_url': (str, none_type,), # noqa: E501
84+
'candidate': (str, none_type,), # noqa: E501
85+
}
86+
87+
@cached_property
88+
def discriminator():
89+
return None
90+
91+
92+
attribute_map = {
93+
'remote_id': 'remote_id', # noqa: E501
94+
'file_name': 'file_name', # noqa: E501
95+
'file_url': 'file_url', # noqa: E501
96+
'candidate': 'candidate', # noqa: E501
97+
}
98+
99+
_composed_schemas = {}
100+
101+
required_properties = set([
102+
'_data_store',
103+
'_check_type',
104+
'_spec_property_naming',
105+
'_path_to_item',
106+
'_configuration',
107+
'_visited_composed_classes',
108+
])
109+
110+
@convert_js_args_to_python_args
111+
def __init__(self, *args, **kwargs): # noqa: E501
112+
"""AttachmentRequest - a model defined in OpenAPI
113+
114+
Keyword Args:
115+
_check_type (bool): if True, values for parameters in openapi_types
116+
will be type checked and a TypeError will be
117+
raised if the wrong type is input.
118+
Defaults to True
119+
_path_to_item (tuple/list): This is a list of keys or values to
120+
drill down to the model in received_data
121+
when deserializing a response
122+
_spec_property_naming (bool): True if the variable names in the input data
123+
are serialized names, as specified in the OpenAPI document.
124+
False if the variable names in the input data
125+
are pythonic names, e.g. snake case (default)
126+
_configuration (Configuration): the instance to use when
127+
deserializing a file_type parameter.
128+
If passed, type conversion is attempted
129+
If omitted no type conversion is done.
130+
_visited_composed_classes (tuple): This stores a tuple of
131+
classes that we have traveled through so that
132+
if we see that class again we will not use its
133+
discriminator again.
134+
When traveling through a discriminator, the
135+
composed schema that is
136+
is traveled through is added to this set.
137+
For example if Animal has a discriminator
138+
petType and we pass in "Dog", and the class Dog
139+
allOf includes Animal, we move through Animal
140+
once using the discriminator, and pick Dog.
141+
Then in Dog, we will make an instance of the
142+
Animal class but this time we won't travel
143+
through its discriminator because we passed in
144+
_visited_composed_classes = (Animal,)
145+
remote_id (str, none_type): The third-party API ID of the matching object.. [optional] # noqa: E501
146+
file_name (str, none_type): The attachment's name.. [optional] # noqa: E501
147+
file_url (str, none_type): The attachment's url.. [optional] # noqa: E501
148+
candidate (str, none_type): [optional] # noqa: E501
149+
"""
150+
151+
_check_type = kwargs.pop('_check_type', True)
152+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
153+
_path_to_item = kwargs.pop('_path_to_item', ())
154+
_configuration = kwargs.pop('_configuration', None)
155+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
156+
157+
if args:
158+
raise ApiTypeError(
159+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
160+
args,
161+
self.__class__.__name__,
162+
),
163+
path_to_item=_path_to_item,
164+
valid_classes=(self.__class__,),
165+
)
166+
167+
self._data_store = {}
168+
self._check_type = _check_type
169+
self._spec_property_naming = _spec_property_naming
170+
self._path_to_item = _path_to_item
171+
self._configuration = _configuration
172+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
173+
174+
for var_name, var_value in kwargs.items():
175+
if var_name not in self.attribute_map and \
176+
self._configuration is not None and \
177+
self._configuration.discard_unknown_keys and \
178+
self.additional_properties_type is None:
179+
# discard variable.
180+
continue
181+
setattr(self, var_name, var_value)

MergeATSClient/model/data_passthrough_request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def openapi_types():
7777
return {
7878
'method': (object,), # noqa: E501
7979
'path': (str,), # noqa: E501
80-
'base_url_override': (str,), # noqa: E501
80+
'base_url_override': (str, none_type,), # noqa: E501
8181
'data': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501
8282
'headers': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501
8383
}
@@ -145,7 +145,7 @@ def __init__(self, method, path, *args, **kwargs): # noqa: E501
145145
Animal class but this time we won't travel
146146
through its discriminator because we passed in
147147
_visited_composed_classes = (Animal,)
148-
base_url_override (str): [optional] # noqa: E501
148+
base_url_override (str, none_type): [optional] # noqa: E501
149149
data ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
150150
headers ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
151151
"""

0 commit comments

Comments
 (0)