|
| 1 | +""" |
| 2 | + Lob |
| 3 | +
|
| 4 | + The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 |
| 5 | +
|
| 6 | + The version of the OpenAPI document: 1.3.0 |
| 7 | + Contact: lob-openapi@lob.com |
| 8 | + Generated by: https://openapi-generator.tech |
| 9 | +""" |
| 10 | + |
| 11 | + |
| 12 | +import re # noqa: F401 |
| 13 | +import sys # noqa: F401 |
| 14 | + |
| 15 | +from lob_python.api_client import ApiClient, Endpoint as _Endpoint |
| 16 | +from lob_python.model_utils import ( # noqa: F401 |
| 17 | + check_allowed_values, |
| 18 | + check_validations, |
| 19 | + date, |
| 20 | + datetime, |
| 21 | + file_type, |
| 22 | + none_type, |
| 23 | + validate_and_convert_types |
| 24 | +) |
| 25 | +from lob_python.model.buckslip_id import BuckslipId |
| 26 | +from lob_python.model.buckslip_order import BuckslipOrder |
| 27 | +from lob_python.model.buckslip_order_editable import BuckslipOrderEditable |
| 28 | +from lob_python.model.buckslip_orders_list import BuckslipOrdersList |
| 29 | +from lob_python.model.lob_error import LobError |
| 30 | + |
| 31 | + |
| 32 | +class BuckslipOrdersApi(object): |
| 33 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 34 | + Ref: https://openapi-generator.tech |
| 35 | +
|
| 36 | + Do not edit the class manually. |
| 37 | + """ |
| 38 | + |
| 39 | + def __init__(self, api_client=None): |
| 40 | + if api_client is None: |
| 41 | + api_client = ApiClient() |
| 42 | + self.api_client = api_client |
| 43 | + self.Create_endpoint = _Endpoint( |
| 44 | + settings={ |
| 45 | + 'response_type': (BuckslipOrder,), |
| 46 | + 'auth': [ |
| 47 | + 'basicAuth' |
| 48 | + ], |
| 49 | + 'endpoint_path': '/buckslips/{buckslip_id}/orders', |
| 50 | + 'operation_id': 'Create', |
| 51 | + 'http_method': 'POST', |
| 52 | + 'servers': None, |
| 53 | + }, |
| 54 | + params_map={ |
| 55 | + 'all': [ |
| 56 | + 'buckslip_id', |
| 57 | + 'buckslip_order_editable', |
| 58 | + ], |
| 59 | + 'required': [ |
| 60 | + 'buckslip_id', |
| 61 | + 'buckslip_order_editable', |
| 62 | + ], |
| 63 | + 'nullable': [ |
| 64 | + ], |
| 65 | + 'enum': [ |
| 66 | + ], |
| 67 | + 'validation': [ |
| 68 | + ] |
| 69 | + }, |
| 70 | + root_map={ |
| 71 | + 'validations': { |
| 72 | + }, |
| 73 | + 'allowed_values': { |
| 74 | + }, |
| 75 | + 'openapi_types': { |
| 76 | + 'buckslip_id': |
| 77 | + (BuckslipId,), |
| 78 | + 'buckslip_order_editable': |
| 79 | + (BuckslipOrderEditable,), |
| 80 | + }, |
| 81 | + 'attribute_map': { |
| 82 | + 'buckslip_id': 'buckslip_id', |
| 83 | + }, |
| 84 | + 'location_map': { |
| 85 | + 'buckslip_id': 'path', |
| 86 | + 'buckslip_order_editable': 'body', |
| 87 | + }, |
| 88 | + 'collection_format_map': { |
| 89 | + } |
| 90 | + }, |
| 91 | + headers_map={ |
| 92 | + 'accept': [ |
| 93 | + 'application/json' |
| 94 | + ], |
| 95 | + 'content_type': [ |
| 96 | + 'application/json', |
| 97 | + 'application/x-www-form-urlencoded', |
| 98 | + 'multipart/form-data' |
| 99 | + ] |
| 100 | + }, |
| 101 | + api_client=api_client |
| 102 | + ) |
| 103 | + self.Retrieve_endpoint = _Endpoint( |
| 104 | + settings={ |
| 105 | + 'response_type': (BuckslipOrdersList,), |
| 106 | + 'auth': [ |
| 107 | + 'basicAuth' |
| 108 | + ], |
| 109 | + 'endpoint_path': '/buckslips/{buckslip_id}/orders', |
| 110 | + 'operation_id': 'Retrieve', |
| 111 | + 'http_method': 'GET', |
| 112 | + 'servers': None, |
| 113 | + }, |
| 114 | + params_map={ |
| 115 | + 'all': [ |
| 116 | + 'buckslip_id', |
| 117 | + 'limit', |
| 118 | + 'offset', |
| 119 | + ], |
| 120 | + 'required': [ |
| 121 | + 'buckslip_id', |
| 122 | + ], |
| 123 | + 'nullable': [ |
| 124 | + ], |
| 125 | + 'enum': [ |
| 126 | + ], |
| 127 | + 'validation': [ |
| 128 | + 'limit', |
| 129 | + ] |
| 130 | + }, |
| 131 | + root_map={ |
| 132 | + 'validations': { |
| 133 | + ('limit',): { |
| 134 | + |
| 135 | + 'inclusive_maximum': 100, |
| 136 | + 'inclusive_minimum': 1, |
| 137 | + }, |
| 138 | + }, |
| 139 | + 'allowed_values': { |
| 140 | + }, |
| 141 | + 'openapi_types': { |
| 142 | + 'buckslip_id': |
| 143 | + (BuckslipId,), |
| 144 | + 'limit': |
| 145 | + (int,), |
| 146 | + 'offset': |
| 147 | + (int,), |
| 148 | + }, |
| 149 | + 'attribute_map': { |
| 150 | + 'buckslip_id': 'buckslip_id', |
| 151 | + 'limit': 'limit', |
| 152 | + 'offset': 'offset', |
| 153 | + }, |
| 154 | + 'location_map': { |
| 155 | + 'buckslip_id': 'path', |
| 156 | + 'limit': 'query', |
| 157 | + 'offset': 'query', |
| 158 | + }, |
| 159 | + 'collection_format_map': { |
| 160 | + } |
| 161 | + }, |
| 162 | + headers_map={ |
| 163 | + 'accept': [ |
| 164 | + 'application/json' |
| 165 | + ], |
| 166 | + 'content_type': [], |
| 167 | + }, |
| 168 | + api_client=api_client |
| 169 | + ) |
| 170 | + |
| 171 | + def Create( |
| 172 | + self, |
| 173 | + buckslip_id, |
| 174 | + buckslip_order_editable, |
| 175 | + **kwargs |
| 176 | + ): |
| 177 | + """Create # noqa: E501 |
| 178 | +
|
| 179 | + Creates a new buckslip order given information # noqa: E501 |
| 180 | + This method makes a synchronous HTTP request by default. To make an |
| 181 | + asynchronous HTTP request, please pass async_req=True |
| 182 | +
|
| 183 | + >>> thread = api.Create(buckslip_id, buckslip_order_editable, async_req=True) |
| 184 | + >>> result = thread.get() |
| 185 | +
|
| 186 | + Args: |
| 187 | + buckslip_id (BuckslipId): The ID of the buckslip to which the buckslip orders belong. |
| 188 | + buckslip_order_editable (BuckslipOrderEditable): |
| 189 | +
|
| 190 | + Keyword Args: |
| 191 | + _return_http_data_only (bool): response data without head status |
| 192 | + code and headers. Default is True. |
| 193 | + _preload_content (bool): if False, the urllib3.HTTPResponse object |
| 194 | + will be returned without reading/decoding response data. |
| 195 | + Default is True. |
| 196 | + _request_timeout (int/float/tuple): timeout setting for this request. If |
| 197 | + one number provided, it will be total request timeout. It can also |
| 198 | + be a pair (tuple) of (connection, read) timeouts. |
| 199 | + Default is None. |
| 200 | + _check_input_type (bool): specifies if type checking |
| 201 | + should be done one the data sent to the server. |
| 202 | + Default is True. |
| 203 | + _check_return_type (bool): specifies if type checking |
| 204 | + should be done one the data received from the server. |
| 205 | + Default is True. |
| 206 | + _spec_property_naming (bool): True if the variable names in the input data |
| 207 | + are serialized names, as specified in the OpenAPI document. |
| 208 | + False if the variable names in the input data |
| 209 | + are pythonic names, e.g. snake case (default) |
| 210 | + _content_type (str/None): force body content-type. |
| 211 | + Default is None and content-type will be predicted by allowed |
| 212 | + content-types and body. |
| 213 | + _host_index (int/None): specifies the index of the server |
| 214 | + that we want to use. |
| 215 | + Default is read from the configuration. |
| 216 | + async_req (bool): execute request asynchronously |
| 217 | +
|
| 218 | + Returns: |
| 219 | + BuckslipOrder |
| 220 | + If the method is called asynchronously, returns the request |
| 221 | + thread. |
| 222 | + """ |
| 223 | + kwargs['async_req'] = kwargs.get( |
| 224 | + 'async_req', False |
| 225 | + ) |
| 226 | + kwargs['_return_http_data_only'] = kwargs.get( |
| 227 | + '_return_http_data_only', True |
| 228 | + ) |
| 229 | + kwargs['_preload_content'] = kwargs.get( |
| 230 | + '_preload_content', True |
| 231 | + ) |
| 232 | + kwargs['_request_timeout'] = kwargs.get( |
| 233 | + '_request_timeout', None |
| 234 | + ) |
| 235 | + kwargs['_check_input_type'] = kwargs.get( |
| 236 | + '_check_input_type', True |
| 237 | + ) |
| 238 | + kwargs['_check_return_type'] = kwargs.get( |
| 239 | + '_check_return_type', True |
| 240 | + ) |
| 241 | + kwargs['_spec_property_naming'] = kwargs.get( |
| 242 | + '_spec_property_naming', False |
| 243 | + ) |
| 244 | + kwargs['_content_type'] = kwargs.get( |
| 245 | + '_content_type') |
| 246 | + kwargs['_host_index'] = kwargs.get('_host_index') |
| 247 | + kwargs['buckslip_id'] = \ |
| 248 | + buckslip_id |
| 249 | + kwargs['buckslip_order_editable'] = \ |
| 250 | + buckslip_order_editable |
| 251 | + return self.Create_endpoint.call_with_http_info(**kwargs) |
| 252 | + |
| 253 | + def Retrieve( |
| 254 | + self, |
| 255 | + buckslip_id, |
| 256 | + **kwargs |
| 257 | + ): |
| 258 | + """Retrieve # noqa: E501 |
| 259 | +
|
| 260 | + Retrieves the buckslip orders associated with the given buckslip id. # noqa: E501 |
| 261 | + This method makes a synchronous HTTP request by default. To make an |
| 262 | + asynchronous HTTP request, please pass async_req=True |
| 263 | +
|
| 264 | + >>> thread = api.Retrieve(buckslip_id, async_req=True) |
| 265 | + >>> result = thread.get() |
| 266 | +
|
| 267 | + Args: |
| 268 | + buckslip_id (BuckslipId): The ID of the buckslip to which the buckslip orders belong. |
| 269 | +
|
| 270 | + Keyword Args: |
| 271 | + limit (int): How many results to return.. [optional] if omitted the server will use the default value of 10 |
| 272 | + offset (int): An integer that designates the offset at which to begin returning results. Defaults to 0.. [optional] if omitted the server will use the default value of 0 |
| 273 | + _return_http_data_only (bool): response data without head status |
| 274 | + code and headers. Default is True. |
| 275 | + _preload_content (bool): if False, the urllib3.HTTPResponse object |
| 276 | + will be returned without reading/decoding response data. |
| 277 | + Default is True. |
| 278 | + _request_timeout (int/float/tuple): timeout setting for this request. If |
| 279 | + one number provided, it will be total request timeout. It can also |
| 280 | + be a pair (tuple) of (connection, read) timeouts. |
| 281 | + Default is None. |
| 282 | + _check_input_type (bool): specifies if type checking |
| 283 | + should be done one the data sent to the server. |
| 284 | + Default is True. |
| 285 | + _check_return_type (bool): specifies if type checking |
| 286 | + should be done one the data received from the server. |
| 287 | + Default is True. |
| 288 | + _spec_property_naming (bool): True if the variable names in the input data |
| 289 | + are serialized names, as specified in the OpenAPI document. |
| 290 | + False if the variable names in the input data |
| 291 | + are pythonic names, e.g. snake case (default) |
| 292 | + _content_type (str/None): force body content-type. |
| 293 | + Default is None and content-type will be predicted by allowed |
| 294 | + content-types and body. |
| 295 | + _host_index (int/None): specifies the index of the server |
| 296 | + that we want to use. |
| 297 | + Default is read from the configuration. |
| 298 | + async_req (bool): execute request asynchronously |
| 299 | +
|
| 300 | + Returns: |
| 301 | + BuckslipOrdersList |
| 302 | + If the method is called asynchronously, returns the request |
| 303 | + thread. |
| 304 | + """ |
| 305 | + kwargs['async_req'] = kwargs.get( |
| 306 | + 'async_req', False |
| 307 | + ) |
| 308 | + kwargs['_return_http_data_only'] = kwargs.get( |
| 309 | + '_return_http_data_only', True |
| 310 | + ) |
| 311 | + kwargs['_preload_content'] = kwargs.get( |
| 312 | + '_preload_content', True |
| 313 | + ) |
| 314 | + kwargs['_request_timeout'] = kwargs.get( |
| 315 | + '_request_timeout', None |
| 316 | + ) |
| 317 | + kwargs['_check_input_type'] = kwargs.get( |
| 318 | + '_check_input_type', True |
| 319 | + ) |
| 320 | + kwargs['_check_return_type'] = kwargs.get( |
| 321 | + '_check_return_type', True |
| 322 | + ) |
| 323 | + kwargs['_spec_property_naming'] = kwargs.get( |
| 324 | + '_spec_property_naming', False |
| 325 | + ) |
| 326 | + kwargs['_content_type'] = kwargs.get( |
| 327 | + '_content_type') |
| 328 | + kwargs['_host_index'] = kwargs.get('_host_index') |
| 329 | + kwargs['buckslip_id'] = \ |
| 330 | + buckslip_id |
| 331 | + return self.Retrieve_endpoint.call_with_http_info(**kwargs) |
| 332 | + |
0 commit comments