From bc0266a4d40b77a03a71c48e38ad6a53d886df7f Mon Sep 17 00:00:00 2001 From: BennyKitchell Date: Sat, 5 Nov 2022 22:29:21 -0500 Subject: [PATCH 1/2] fix: update uploads changes, add buckslips and qr code --- lob_python/api/buckslip_orders_api.py | 332 ++++++++ lob_python/api/buckslips_api.py | 725 ++++++++++++++++++ lob_python/apis/__init__.py | 2 + lob_python/model/bank_account.py | 2 +- lob_python/model/bo_id.py | 289 +++++++ lob_python/model/buckslip.py | 452 +++++++++++ ...ne_response200.py => buckslip_deletion.py} | 14 +- lob_python/model/buckslip_description.py | 287 +++++++ ...ustom_envelope.py => buckslip_editable.py} | 59 +- lob_python/model/buckslip_id.py | 289 +++++++ lob_python/model/buckslip_order.py | 325 ++++++++ ...ponse204.py => buckslip_order_editable.py} | 28 +- .../{sort_by4.py => buckslip_orders_list.py} | 42 +- .../{sort_by5.py => buckslip_updatable.py} | 40 +- lob_python/model/buckslips_list.py | 287 +++++++ lob_python/model/campaign.py | 0 lob_python/model/campaign_creative.py | 0 lob_python/model/campaign_deletion.py | 0 lob_python/model/campaign_updatable.py | 0 lob_python/model/campaign_writable.py | 0 lob_python/model/campaigns_list.py | 0 lob_python/model/cmp_id.py | 0 lob_python/model/cmp_schedule_type.py | 0 lob_python/model/cmp_use_type.py | 0 lob_python/model/creative_patch.py | 0 lob_python/model/creative_response.py | 0 lob_python/model/creative_writable.py | 0 lob_python/model/crv_id.py | 0 lob_python/model/letter.py | 6 + lob_python/model/letter_editable.py | 6 + lob_python/model/postcard_editable.py | 6 + lob_python/model/qr_code.py | 294 +++++++ lob_python/models/__init__.py | 14 + test/Unit/test_billing_groups_api.py | 4 +- test/Unit/test_campaigns_api.py | 4 +- test/Unit/test_cards_api.py | 4 +- test/Unit/test_checks_api.py | 4 +- test/Unit/test_letters_api.py | 4 +- test/Unit/test_postcards_api.py | 4 +- test/Unit/test_self_mailers_api.py | 4 +- test/Unit/test_uploads_api.py | 4 +- 41 files changed, 3429 insertions(+), 102 deletions(-) create mode 100644 lob_python/api/buckslip_orders_api.py create mode 100644 lob_python/api/buckslips_api.py create mode 100644 lob_python/model/bo_id.py create mode 100644 lob_python/model/buckslip.py rename lob_python/model/{inline_response200.py => buckslip_deletion.py} (95%) mode change 100755 => 100644 create mode 100644 lob_python/model/buckslip_description.py rename lob_python/model/{letter_editable_custom_envelope.py => buckslip_editable.py} (86%) mode change 100755 => 100644 create mode 100644 lob_python/model/buckslip_id.py create mode 100644 lob_python/model/buckslip_order.py rename lob_python/model/{inline_response204.py => buckslip_order_editable.py} (93%) mode change 100755 => 100644 rename lob_python/model/{sort_by4.py => buckslip_orders_list.py} (85%) mode change 100755 => 100644 rename lob_python/model/{sort_by5.py => buckslip_updatable.py} (88%) mode change 100755 => 100644 create mode 100644 lob_python/model/buckslips_list.py mode change 100644 => 100755 lob_python/model/campaign.py mode change 100644 => 100755 lob_python/model/campaign_creative.py mode change 100644 => 100755 lob_python/model/campaign_deletion.py mode change 100644 => 100755 lob_python/model/campaign_updatable.py mode change 100644 => 100755 lob_python/model/campaign_writable.py mode change 100644 => 100755 lob_python/model/campaigns_list.py mode change 100644 => 100755 lob_python/model/cmp_id.py mode change 100644 => 100755 lob_python/model/cmp_schedule_type.py mode change 100644 => 100755 lob_python/model/cmp_use_type.py mode change 100644 => 100755 lob_python/model/creative_patch.py mode change 100644 => 100755 lob_python/model/creative_response.py mode change 100644 => 100755 lob_python/model/creative_writable.py mode change 100644 => 100755 lob_python/model/crv_id.py create mode 100644 lob_python/model/qr_code.py diff --git a/lob_python/api/buckslip_orders_api.py b/lob_python/api/buckslip_orders_api.py new file mode 100644 index 0000000..6ca5dce --- /dev/null +++ b/lob_python/api/buckslip_orders_api.py @@ -0,0 +1,332 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.api_client import ApiClient, Endpoint as _Endpoint +from lob_python.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from lob_python.model.buckslip_id import BuckslipId +from lob_python.model.buckslip_order import BuckslipOrder +from lob_python.model.buckslip_order_editable import BuckslipOrderEditable +from lob_python.model.buckslip_orders_list import BuckslipOrdersList +from lob_python.model.lob_error import LobError + + +class BuckslipOrdersApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.Create_endpoint = _Endpoint( + settings={ + 'response_type': (BuckslipOrder,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips/{buckslip_id}/orders', + 'operation_id': 'Create', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'buckslip_id', + 'buckslip_order_editable', + ], + 'required': [ + 'buckslip_id', + 'buckslip_order_editable', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'buckslip_id': + (BuckslipId,), + 'buckslip_order_editable': + (BuckslipOrderEditable,), + }, + 'attribute_map': { + 'buckslip_id': 'buckslip_id', + }, + 'location_map': { + 'buckslip_id': 'path', + 'buckslip_order_editable': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + }, + api_client=api_client + ) + self.Retrieve_endpoint = _Endpoint( + settings={ + 'response_type': (BuckslipOrdersList,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips/{buckslip_id}/orders', + 'operation_id': 'Retrieve', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'buckslip_id', + 'limit', + 'offset', + ], + 'required': [ + 'buckslip_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] + }, + root_map={ + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'buckslip_id': + (BuckslipId,), + 'limit': + (int,), + 'offset': + (int,), + }, + 'attribute_map': { + 'buckslip_id': 'buckslip_id', + 'limit': 'limit', + 'offset': 'offset', + }, + 'location_map': { + 'buckslip_id': 'path', + 'limit': 'query', + 'offset': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def Create( + self, + buckslip_id, + buckslip_order_editable, + **kwargs + ): + """Create # noqa: E501 + + Creates a new buckslip order given information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.Create(buckslip_id, buckslip_order_editable, async_req=True) + >>> result = thread.get() + + Args: + buckslip_id (BuckslipId): The ID of the buckslip to which the buckslip orders belong. + buckslip_order_editable (BuckslipOrderEditable): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + BuckslipOrder + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['buckslip_id'] = \ + buckslip_id + kwargs['buckslip_order_editable'] = \ + buckslip_order_editable + return self.Create_endpoint.call_with_http_info(**kwargs) + + def Retrieve( + self, + buckslip_id, + **kwargs + ): + """Retrieve # noqa: E501 + + Retrieves the buckslip orders associated with the given buckslip id. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.Retrieve(buckslip_id, async_req=True) + >>> result = thread.get() + + Args: + buckslip_id (BuckslipId): The ID of the buckslip to which the buckslip orders belong. + + Keyword Args: + limit (int): How many results to return.. [optional] if omitted the server will use the default value of 10 + 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 + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + BuckslipOrdersList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['buckslip_id'] = \ + buckslip_id + return self.Retrieve_endpoint.call_with_http_info(**kwargs) + diff --git a/lob_python/api/buckslips_api.py b/lob_python/api/buckslips_api.py new file mode 100644 index 0000000..3a147f0 --- /dev/null +++ b/lob_python/api/buckslips_api.py @@ -0,0 +1,725 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.api_client import ApiClient, Endpoint as _Endpoint +from lob_python.model_utils import ( # noqa: F401 + check_allowed_values, + check_validations, + date, + datetime, + file_type, + none_type, + validate_and_convert_types +) +from lob_python.model.buckslip import Buckslip +from lob_python.model.buckslip_deletion import BuckslipDeletion +from lob_python.model.buckslip_editable import BuckslipEditable +from lob_python.model.buckslip_id import BuckslipId +from lob_python.model.buckslip_updatable import BuckslipUpdatable +from lob_python.model.buckslips_list import BuckslipsList +from lob_python.model.include_model import IncludeModel +from lob_python.model.lob_error import LobError + + +class BuckslipsApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + self.Create_endpoint = _Endpoint( + settings={ + 'response_type': (Buckslip,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips', + 'operation_id': 'Create', + 'http_method': 'POST', + 'servers': None, + }, + params_map={ + 'all': [ + 'buckslip_editable', + ], + 'required': [ + 'buckslip_editable', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'buckslip_editable': + (BuckslipEditable,), + }, + 'attribute_map': { + }, + 'location_map': { + 'buckslip_editable': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + }, + api_client=api_client + ) + self.Delete_endpoint = _Endpoint( + settings={ + 'response_type': (BuckslipDeletion,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips/{buckslip_id}', + 'operation_id': 'Delete', + 'http_method': 'DELETE', + 'servers': None, + }, + params_map={ + 'all': [ + 'buckslip_id', + ], + 'required': [ + 'buckslip_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'buckslip_id': + (BuckslipId,), + }, + 'attribute_map': { + 'buckslip_id': 'buckslip_id', + }, + 'location_map': { + 'buckslip_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.Retrieve_endpoint = _Endpoint( + settings={ + 'response_type': (Buckslip,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips/{buckslip_id}', + 'operation_id': 'Retrieve', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'buckslip_id', + ], + 'required': [ + 'buckslip_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'buckslip_id': + (BuckslipId,), + }, + 'attribute_map': { + 'buckslip_id': 'buckslip_id', + }, + 'location_map': { + 'buckslip_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + self.Update_endpoint = _Endpoint( + settings={ + 'response_type': (Buckslip,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips/{buckslip_id}', + 'operation_id': 'Update', + 'http_method': 'PATCH', + 'servers': None, + }, + params_map={ + 'all': [ + 'buckslip_id', + 'buckslip_updatable', + ], + 'required': [ + 'buckslip_id', + 'buckslip_updatable', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] + }, + root_map={ + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'buckslip_id': + (BuckslipId,), + 'buckslip_updatable': + (BuckslipUpdatable,), + }, + 'attribute_map': { + 'buckslip_id': 'buckslip_id', + }, + 'location_map': { + 'buckslip_id': 'path', + 'buckslip_updatable': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + }, + api_client=api_client + ) + self.List_endpoint = _Endpoint( + settings={ + 'response_type': (BuckslipsList,), + 'auth': [ + 'basicAuth' + ], + 'endpoint_path': '/buckslips', + 'operation_id': 'List', + 'http_method': 'GET', + 'servers': None, + }, + params_map={ + 'all': [ + 'limit', + 'before', + 'after', + 'include', + ], + 'required': [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] + }, + root_map={ + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + 'openapi_types': { + 'limit': + (int,), + 'before': + (str,), + 'after': + (str,), + 'include': + (IncludeModel,), + }, + 'attribute_map': { + 'limit': 'limit', + 'before': 'before', + 'after': 'after', + 'include': 'include', + }, + 'location_map': { + 'limit': 'query', + 'before': 'query', + 'after': 'query', + 'include': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, + api_client=api_client + ) + + def Create( + self, + buckslip_editable, + **kwargs + ): + """Create # noqa: E501 + + Creates a new buckslip given information # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.Create(buckslip_editable, async_req=True) + >>> result = thread.get() + + Args: + buckslip_editable (BuckslipEditable): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Buckslip + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['buckslip_editable'] = \ + buckslip_editable + return self.Create_endpoint.call_with_http_info(**kwargs) + + def Delete( + self, + buckslip_id, + **kwargs + ): + """Delete # noqa: E501 + + Delete an existing buckslip. You need only supply the unique identifier that was returned upon buckslip creation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.Delete(buckslip_id, async_req=True) + >>> result = thread.get() + + Args: + buckslip_id (BuckslipId): id of the buckslip + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + BuckslipDeletion + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['buckslip_id'] = \ + buckslip_id + return self.Delete_endpoint.call_with_http_info(**kwargs) + + def Retrieve( + self, + buckslip_id, + **kwargs + ): + """Retrieve # noqa: E501 + + Retrieves the details of an existing buckslip. You need only supply the unique customer identifier that was returned upon buckslip creation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.Retrieve(buckslip_id, async_req=True) + >>> result = thread.get() + + Args: + buckslip_id (BuckslipId): id of the buckslip + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Buckslip + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['buckslip_id'] = \ + buckslip_id + return self.Retrieve_endpoint.call_with_http_info(**kwargs) + + def Update( + self, + buckslip_id, + buckslip_updatable, + **kwargs + ): + """Update # noqa: E501 + + Update the details of an existing buckslip. You need only supply the unique identifier that was returned upon buckslip creation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.Update(buckslip_id, buckslip_updatable, async_req=True) + >>> result = thread.get() + + Args: + buckslip_id (BuckslipId): id of the buckslip + buckslip_updatable (BuckslipUpdatable): + + Keyword Args: + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + Buckslip + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + kwargs['buckslip_id'] = \ + buckslip_id + kwargs['buckslip_updatable'] = \ + buckslip_updatable + return self.Update_endpoint.call_with_http_info(**kwargs) + + def List( + self, + **kwargs + ): + """List # noqa: E501 + + Returns a list of your buckslips. The buckslips are returned sorted by creation date, with the most recently created buckslips appearing first. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.List(async_req=True) + >>> result = thread.get() + + + Keyword Args: + limit (int): How many results to return.. [optional] if omitted the server will use the default value of 10 + before (str): A reference to a list entry used for paginating to the previous set of entries. This field is pre-populated in the `previous_url` field in the return response. . [optional] + after (str): A reference to a list entry used for paginating to the next set of entries. This field is pre-populated in the `next_url` field in the return response. . [optional] + include (IncludeModel): Request that the response include the total count by specifying `include[]=total_count`. . [optional] + _return_http_data_only (bool): response data without head status + code and headers. Default is True. + _preload_content (bool): if False, the urllib3.HTTPResponse object + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. + _host_index (int/None): specifies the index of the server + that we want to use. + Default is read from the configuration. + async_req (bool): execute request asynchronously + + Returns: + BuckslipsList + If the method is called asynchronously, returns the request + thread. + """ + kwargs['async_req'] = kwargs.get( + 'async_req', False + ) + kwargs['_return_http_data_only'] = kwargs.get( + '_return_http_data_only', True + ) + kwargs['_preload_content'] = kwargs.get( + '_preload_content', True + ) + kwargs['_request_timeout'] = kwargs.get( + '_request_timeout', None + ) + kwargs['_check_input_type'] = kwargs.get( + '_check_input_type', True + ) + kwargs['_check_return_type'] = kwargs.get( + '_check_return_type', True + ) + kwargs['_spec_property_naming'] = kwargs.get( + '_spec_property_naming', False + ) + kwargs['_content_type'] = kwargs.get( + '_content_type') + kwargs['_host_index'] = kwargs.get('_host_index') + return self.List_endpoint.call_with_http_info(**kwargs) + diff --git a/lob_python/apis/__init__.py b/lob_python/apis/__init__.py index 2a02759..2781737 100755 --- a/lob_python/apis/__init__.py +++ b/lob_python/apis/__init__.py @@ -17,6 +17,8 @@ from lob_python.api.addresses_api import AddressesApi from lob_python.api.bank_accounts_api import BankAccountsApi from lob_python.api.billing_groups_api import BillingGroupsApi +from lob_python.api.buckslip_orders_api import BuckslipOrdersApi +from lob_python.api.buckslips_api import BuckslipsApi from lob_python.api.campaigns_api import CampaignsApi from lob_python.api.card_orders_api import CardOrdersApi from lob_python.api.cards_api import CardsApi diff --git a/lob_python/model/bank_account.py b/lob_python/model/bank_account.py index fd4d3f9..4a3e65d 100755 --- a/lob_python/model/bank_account.py +++ b/lob_python/model/bank_account.py @@ -84,7 +84,7 @@ class BankAccount(ModelNormal): }, ('signature_url',): { 'regex': { - 'pattern': r'^https:\/\/lob-assets\.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(\.pdf|[a-z]+_[0-9]+\.png)\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+$', # noqa: E501 + 'pattern': r'^https:\/\/lob-assets\.com\/(letters|postcards|bank-accounts|checks|self-mailers|cards)\/[a-z]{3,4}_[a-z0-9]{15,16}(\.pdf|_thumb_[a-z]+_[0-9]+\.png)\?(version=[a-z0-9-]*&)?expires=[0-9]{10}&signature=[a-zA-Z0-9-_]+$', # noqa: E501 }, }, } diff --git a/lob_python/model/bo_id.py b/lob_python/model/bo_id.py new file mode 100644 index 0000000..bea83d7 --- /dev/null +++ b/lob_python/model/bo_id.py @@ -0,0 +1,289 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + + + +class BoId(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'regex': { + 'pattern': r'', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """BoId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Unique identifier prefixed with `bo_`.. # noqa: E501 + Keyword Args: + value (): Unique identifier prefixed with `bo_`.. # noqa: E501 + + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """BoId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Unique identifier prefixed with `bo_`.. # noqa: E501 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/lob_python/model/buckslip.py b/lob_python/model/buckslip.py new file mode 100644 index 0000000..42335b5 --- /dev/null +++ b/lob_python/model/buckslip.py @@ -0,0 +1,452 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + +from lob_python.model.buckslip_description import BuckslipDescription +from lob_python.model.buckslip_id import BuckslipId +from lob_python.model.buckslip_order import BuckslipOrder +from lob_python.model.thumbnail import Thumbnail +globals()['BuckslipDescription'] = BuckslipDescription +globals()['BuckslipId'] = BuckslipId +globals()['BuckslipOrder'] = BuckslipOrder +globals()['Thumbnail'] = Thumbnail + + +class Buckslip(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('stock',): { + 'TEXT': "text", + 'COVER': "cover", + }, + ('weight',): { + '80#': "80#", + }, + ('finish',): { + 'GLOSS': "gloss", + 'MATTE': "matte", + }, + ('status',): { + 'PROCESSED': "processed", + 'RENDERED': "rendered", + }, + ('object',): { + 'BUCKSLIP': "buckslip", + }, + ('size',): { + '8.75X3.75': "8.75x3.75", + }, + } + + validations = { + ('url',): { + 'max_length': 2083, + 'min_length': 1, + }, + ('raw_url',): { + 'max_length': 2083, + 'min_length': 1, + }, + ('front_original_url',): { + 'max_length': 2083, + 'min_length': 1, + }, + ('back_original_url',): { + 'max_length': 2083, + 'min_length': 1, + }, + ('buckslip_orders',): { + 'min_items': 0, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (str,), # noqa: E501 + 'auto_reorder': (bool,), # noqa: E501 + 'reorder_quantity': (int,), # noqa: E501 + 'threshold_amount': (int,), # noqa: E501 + 'url': (str,), # noqa: E501 + 'raw_url': (str,), # noqa: E501 + 'front_original_url': (str,), # noqa: E501 + 'back_original_url': (str,), # noqa: E501 + 'thumbnails': (list,), # noqa: E501 + 'available_quantity': (float,), # noqa: E501 + 'allocated_quantity': (float,), # noqa: E501 + 'onhand_quantity': (float,), # noqa: E501 + 'pending_quantity': (float,), # noqa: E501 + 'projected_quantity': (float,), # noqa: E501 + 'buckslip_orders': (list,), # noqa: E501 + 'stock': (str,), # noqa: E501 + 'weight': (str,), # noqa: E501 + 'finish': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'object': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'size': (str, type(None)), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'auto_reorder': 'auto_reorder', # noqa: E501 + 'reorder_quantity': 'reorder_quantity', # noqa: E501 + 'threshold_amount': 'threshold_amount', # noqa: E501 + 'url': 'url', # noqa: E501 + 'raw_url': 'raw_url', # noqa: E501 + 'front_original_url': 'front_original_url', # noqa: E501 + 'back_original_url': 'back_original_url', # noqa: E501 + 'thumbnails': 'thumbnails', # noqa: E501 + 'available_quantity': 'available_quantity', # noqa: E501 + 'allocated_quantity': 'allocated_quantity', # noqa: E501 + 'onhand_quantity': 'onhand_quantity', # noqa: E501 + 'pending_quantity': 'pending_quantity', # noqa: E501 + 'projected_quantity': 'projected_quantity', # noqa: E501 + 'buckslip_orders': 'buckslip_orders', # noqa: E501 + 'stock': 'stock', # noqa: E501 + 'weight': 'weight', # noqa: E501 + 'finish': 'finish', # noqa: E501 + 'status': 'status', # noqa: E501 + 'object': 'object', # noqa: E501 + 'description': 'description', # noqa: E501 + 'size': 'size', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, reorder_quantity, url, raw_url, front_original_url, back_original_url, thumbnails, buckslip_orders, stock, finish, status, description, *args, **kwargs): # noqa: E501 + """Buckslip - a model defined in OpenAPI + + Args: + id (str): + reorder_quantity (int): The number of buckslips to be reordered. + url (str): The signed link for the buckslip. + raw_url (str): The raw URL of the buckslip. + front_original_url (str): The original URL of the front template. + back_original_url (str): The original URL of the back template. + thumbnails (list): + buckslip_orders (list): An array of buckslip orders that are associated with the buckslip. + stock (str): + finish (str): + status (str): + description (str): + + Keyword Args: + auto_reorder (bool): True if the buckslips should be auto-reordered.. defaults to False # noqa: E501 + threshold_amount (int): The threshold amount of the buckslip. defaults to 0 # noqa: E501 + available_quantity (float): The available quantity of buckslips.. defaults to 0 # noqa: E501 + allocated_quantity (float): The allocated quantity of buckslips.. defaults to 0 # noqa: E501 + onhand_quantity (float): The onhand quantity of buckslips.. defaults to 0 # noqa: E501 + pending_quantity (float): The pending quantity of buckslips.. defaults to 0 # noqa: E501 + projected_quantity (float): The sum of pending and onhand quantities of buckslips.. defaults to 0 # noqa: E501 + weight (str): defaults to "80#", must be one of ["80#", ] # noqa: E501 + object (str): object. defaults to "buckslip", must be one of ["buckslip", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + size (str, type(None)): The size of the buckslip. [optional] if omitted the server will use the default value of "8.75x3.75" # noqa: E501 + """ + + auto_reorder = kwargs.get('auto_reorder', False) + threshold_amount = kwargs.get('threshold_amount', 0) + available_quantity = kwargs.get('available_quantity', 0) + allocated_quantity = kwargs.get('allocated_quantity', 0) + onhand_quantity = kwargs.get('onhand_quantity', 0) + pending_quantity = kwargs.get('pending_quantity', 0) + projected_quantity = kwargs.get('projected_quantity', 0) + weight = kwargs.get('weight', "80#") + object = kwargs.get('object', "buckslip") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.auto_reorder = auto_reorder + self.reorder_quantity = reorder_quantity + self.threshold_amount = threshold_amount + self.url = url + self.raw_url = raw_url + self.front_original_url = front_original_url + self.back_original_url = back_original_url + self.thumbnails = thumbnails + self.available_quantity = available_quantity + self.allocated_quantity = allocated_quantity + self.onhand_quantity = onhand_quantity + self.pending_quantity = pending_quantity + self.projected_quantity = projected_quantity + self.buckslip_orders = buckslip_orders + self.stock = stock + self.weight = weight + self.finish = finish + self.status = status + self.object = object + self.description = description + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, reorder_quantity, url, raw_url, front_original_url, back_original_url, thumbnails, buckslip_orders, stock, finish, status, description, *args, **kwargs): # noqa: E501 + """Buckslip - a model defined in OpenAPI + + Args: + id (BuckslipId): + reorder_quantity (int, none_type): The number of buckslips to be reordered. + url (str): The signed link for the buckslip. + raw_url (str): The raw URL of the buckslip. + front_original_url (str): The original URL of the front template. + back_original_url (str): The original URL of the back template. + thumbnails ([Thumbnail]): + buckslip_orders ([BuckslipOrder]): An array of buckslip orders that are associated with the buckslip. + stock (str): + finish (str): + status (str): + description (BuckslipDescription): + + Keyword Args: + auto_reorder (bool): True if the buckslips should be auto-reordered.. defaults to False # noqa: E501 + threshold_amount (int): The threshold amount of the buckslip. defaults to 0 # noqa: E501 + available_quantity (float): The available quantity of buckslips.. defaults to 0 # noqa: E501 + allocated_quantity (float): The allocated quantity of buckslips.. defaults to 0 # noqa: E501 + onhand_quantity (float): The onhand quantity of buckslips.. defaults to 0 # noqa: E501 + pending_quantity (float): The pending quantity of buckslips.. defaults to 0 # noqa: E501 + projected_quantity (float): The sum of pending and onhand quantities of buckslips.. defaults to 0 # noqa: E501 + weight (str): defaults to "80#", must be one of ["80#", ] # noqa: E501 + object (str): object. defaults to "buckslip", must be one of ["buckslip", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + size (str, type(None)): The size of the buckslip. [optional] if omitted the server will use the default value of "8.75x3.75" # noqa: E501 + """ + + auto_reorder = kwargs.get('auto_reorder', False) + threshold_amount = kwargs.get('threshold_amount', 0) + available_quantity = kwargs.get('available_quantity', 0) + allocated_quantity = kwargs.get('allocated_quantity', 0) + onhand_quantity = kwargs.get('onhand_quantity', 0) + pending_quantity = kwargs.get('pending_quantity', 0) + projected_quantity = kwargs.get('projected_quantity', 0) + weight = kwargs.get('weight', "80#") + object = kwargs.get('object', "buckslip") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.auto_reorder = auto_reorder + self.reorder_quantity = reorder_quantity + self.threshold_amount = threshold_amount + self.url = url + self.raw_url = raw_url + self.front_original_url = front_original_url + self.back_original_url = back_original_url + self.thumbnails = thumbnails + self.available_quantity = available_quantity + self.allocated_quantity = allocated_quantity + self.onhand_quantity = onhand_quantity + self.pending_quantity = pending_quantity + self.projected_quantity = projected_quantity + self.buckslip_orders = buckslip_orders + self.stock = stock + self.weight = weight + self.finish = finish + self.status = status + self.object = object + self.description = description + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/lob_python/model/inline_response200.py b/lob_python/model/buckslip_deletion.py old mode 100755 new mode 100644 similarity index 95% rename from lob_python/model/inline_response200.py rename to lob_python/model/buckslip_deletion.py index af0f6ec..6581cd6 --- a/lob_python/model/inline_response200.py +++ b/lob_python/model/buckslip_deletion.py @@ -29,11 +29,11 @@ ) from lob_python.exceptions import ApiAttributeError -from lob_python.model.cmp_id import CmpId -globals()['CmpId'] = CmpId +from lob_python.model.buckslip_id import BuckslipId +globals()['BuckslipId'] = BuckslipId -class InlineResponse200(ModelNormal): +class BuckslipDeletion(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -106,7 +106,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """InlineResponse200 - a model defined in OpenAPI + """BuckslipDeletion - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -140,7 +140,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) id (str, type(None)): [optional] # noqa: E501 - deleted (bool, type(None)): True if the resource has been successfully deleted.. [optional] # noqa: E501 + deleted (bool, type(None)): Only returned if the resource has been successfully deleted.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -189,7 +189,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """InlineResponse200 - a model defined in OpenAPI + """BuckslipDeletion - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -223,7 +223,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) id (str, type(None)): [optional] # noqa: E501 - deleted (bool, type(None)): True if the resource has been successfully deleted.. [optional] # noqa: E501 + deleted (bool, type(None)): Only returned if the resource has been successfully deleted.. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/lob_python/model/buckslip_description.py b/lob_python/model/buckslip_description.py new file mode 100644 index 0000000..95491b5 --- /dev/null +++ b/lob_python/model/buckslip_description.py @@ -0,0 +1,287 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + + + +class BuckslipDescription(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'max_length': 255, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """BuckslipDescription - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Description of the buckslip.. # noqa: E501 + Keyword Args: + value (): Description of the buckslip.. # noqa: E501 + + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """BuckslipDescription - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Description of the buckslip.. # noqa: E501 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/lob_python/model/letter_editable_custom_envelope.py b/lob_python/model/buckslip_editable.py old mode 100755 new mode 100644 similarity index 86% rename from lob_python/model/letter_editable_custom_envelope.py rename to lob_python/model/buckslip_editable.py index 31f821b..c15c3ca --- a/lob_python/model/letter_editable_custom_envelope.py +++ b/lob_python/model/buckslip_editable.py @@ -29,9 +29,11 @@ ) from lob_python.exceptions import ApiAttributeError +from lob_python.model.buckslip_description import BuckslipDescription +globals()['BuckslipDescription'] = BuckslipDescription -class LetterEditableCustomEnvelope(ModelNormal): +class BuckslipEditable(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -56,15 +58,12 @@ class LetterEditableCustomEnvelope(ModelNormal): """ allowed_values = { - ('object',): { - 'ENVELOPE': "envelope", + ('size',): { + '8.75X3.75': "8.75x3.75", }, } validations = { - ('id',): { - 'max_length': 40, - }, } @cached_property @@ -75,7 +74,7 @@ def additional_properties_type(): """ return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 - _nullable = True + _nullable = False @cached_property def openapi_types(): @@ -88,9 +87,10 @@ def openapi_types(): and the value is attribute type. """ return { - 'id': (str,), # noqa: E501 - 'url': (str,), # noqa: E501 - 'object': (str,), # noqa: E501 + 'front': (str,), # noqa: E501 + 'back': (str, type(None)), # noqa: E501 + 'description': (str, type(None)), # noqa: E501 + 'size': (str, type(None)), # noqa: E501 } @cached_property @@ -99,9 +99,10 @@ def discriminator(): attribute_map = { - 'id': 'id', # noqa: E501 - 'url': 'url', # noqa: E501 - 'object': 'object', # noqa: E501 + 'front': 'front', # noqa: E501 + 'back': 'back', # noqa: E501 + 'description': 'description', # noqa: E501 + 'size': 'size', # noqa: E501 } read_only_vars = { @@ -111,15 +112,13 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, id, url, *args, **kwargs): # noqa: E501 - """LetterEditableCustomEnvelope - a model defined in OpenAPI + def _from_openapi_data(cls, front, *args, **kwargs): # noqa: E501 + """BuckslipEditable - a model defined in OpenAPI Args: - id (str): The unique identifier of the custom envelope used. - url (str): The url of the envelope asset used. + front (str): A PDF template for the front of the buckslip Keyword Args: - object (str): defaults to "envelope", must be one of ["envelope", ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -150,9 +149,11 @@ def _from_openapi_data(cls, id, url, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + back (str, type(None)): A PDF template for the back of the buckslip. [optional] # noqa: E501 + description (str, type(None)): [optional] # noqa: E501 + size (str, type(None)): The size of the buckslip. [optional] if omitted the server will use the default value of "8.75x3.75" # noqa: E501 """ - object = kwargs.get('object', "envelope") _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -178,9 +179,7 @@ def _from_openapi_data(cls, id, url, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.id = id - self.url = url - self.object = object + self.front = front for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ @@ -201,15 +200,13 @@ def _from_openapi_data(cls, id, url, *args, **kwargs): # noqa: E501 ]) @convert_js_args_to_python_args - def __init__(self, id, url, *args, **kwargs): # noqa: E501 - """LetterEditableCustomEnvelope - a model defined in OpenAPI + def __init__(self, front, *args, **kwargs): # noqa: E501 + """BuckslipEditable - a model defined in OpenAPI Args: - id (str): The unique identifier of the custom envelope used. - url (str): The url of the envelope asset used. + front (str): A PDF template for the front of the buckslip Keyword Args: - object (str): defaults to "envelope", must be one of ["envelope", ] # noqa: E501 _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be raised if the wrong type is input. @@ -240,9 +237,11 @@ def __init__(self, id, url, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + back (str, type(None)): A PDF template for the back of the buckslip. [optional] # noqa: E501 + description (str, type(None)): [optional] # noqa: E501 + size (str, type(None)): The size of the buckslip. [optional] if omitted the server will use the default value of "8.75x3.75" # noqa: E501 """ - object = kwargs.get('object', "envelope") _check_type = kwargs.pop('_check_type', True) _spec_property_naming = kwargs.pop('_spec_property_naming', False) _path_to_item = kwargs.pop('_path_to_item', ()) @@ -266,9 +265,7 @@ def __init__(self, id, url, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.id = id - self.url = url - self.object = object + self.front = front for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ diff --git a/lob_python/model/buckslip_id.py b/lob_python/model/buckslip_id.py new file mode 100644 index 0000000..d96e8c1 --- /dev/null +++ b/lob_python/model/buckslip_id.py @@ -0,0 +1,289 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + + + +class BuckslipId(ModelSimple): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + ('value',): { + 'regex': { + 'pattern': r'', # noqa: E501 + }, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'value': (str,), + } + + @cached_property + def discriminator(): + return None + + + attribute_map = {} + + read_only_vars = set() + + _composed_schemas = None + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): + """BuckslipId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Unique identifier prefixed with `bck_`.. # noqa: E501 + Keyword Args: + value (): Unique identifier prefixed with `bck_`.. # noqa: E501 + + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): + """BuckslipId - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): Unique identifier prefixed with `bck_`.. # noqa: E501 + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop('_path_to_item', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if 'value' in kwargs: + value = kwargs.pop('value') + elif args: + args = list(args) + value = args.pop(0) + else: + raise ApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise ApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + kwargs, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/lob_python/model/buckslip_order.py b/lob_python/model/buckslip_order.py new file mode 100644 index 0000000..6b0e5ca --- /dev/null +++ b/lob_python/model/buckslip_order.py @@ -0,0 +1,325 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + +from lob_python.model.bo_id import BoId +from lob_python.model.buckslip_id import BuckslipId +globals()['BoId'] = BoId +globals()['BuckslipId'] = BuckslipId + + +class BuckslipOrder(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('status',): { + 'PENDING': "pending", + 'PRINTING': "printing", + 'AVAILABLE': "available", + 'CANCELLED': "cancelled", + 'DEPLETED': "depleted", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'date_created': (datetime,), # noqa: E501 + 'date_modified': (datetime,), # noqa: E501 + 'object': (str,), # noqa: E501 + 'deleted': (bool, type(None)), # noqa: E501 + 'id': (str, type(None)), # noqa: E501 + 'buckslip_id': (str, type(None)), # noqa: E501 + 'status': (str, type(None)), # noqa: E501 + 'quantity_ordered': (float, type(None)), # noqa: E501 + 'unit_price': (float, type(None)), # noqa: E501 + 'inventory': (float, type(None)), # noqa: E501 + 'cancelled_reason': (str, type(None)), # noqa: E501 + 'availability_date': (datetime, type(None)), # noqa: E501 + 'expected_availability_date': (datetime, type(None)), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'date_created': 'date_created', # noqa: E501 + 'date_modified': 'date_modified', # noqa: E501 + 'object': 'object', # noqa: E501 + 'deleted': 'deleted', # noqa: E501 + 'id': 'id', # noqa: E501 + 'buckslip_id': 'buckslip_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'quantity_ordered': 'quantity_ordered', # noqa: E501 + 'unit_price': 'unit_price', # noqa: E501 + 'inventory': 'inventory', # noqa: E501 + 'cancelled_reason': 'cancelled_reason', # noqa: E501 + 'availability_date': 'availability_date', # noqa: E501 + 'expected_availability_date': 'expected_availability_date', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, date_created, date_modified, object, *args, **kwargs): # noqa: E501 + """BuckslipOrder - a model defined in OpenAPI + + Args: + date_created (datetime): A timestamp in ISO 8601 format of the date the resource was created. + date_modified (datetime): A timestamp in ISO 8601 format of the date the resource was last modified. + object (str): Value is type of resource. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted (bool, type(None)): Only returned if the resource has been successfully deleted.. [optional] # noqa: E501 + id (str, type(None)): [optional] # noqa: E501 + buckslip_id (str, type(None)): [optional] # noqa: E501 + status (str, type(None)): The status of the buckslip order.. [optional] # noqa: E501 + quantity_ordered (float, type(None)): The quantity of buckslips ordered.. [optional] if omitted the server will use the default value of 0 # noqa: E501 + unit_price (float, type(None)): The unit price for the buckslip order.. [optional] if omitted the server will use the default value of 0 # noqa: E501 + inventory (float, type(None)): The inventory of the buckslip order.. [optional] if omitted the server will use the default value of 0 # noqa: E501 + cancelled_reason (str, type(None)): The reason for cancellation.. [optional] # noqa: E501 + availability_date (datetime, type(None)): A timestamp in ISO 8601 format of the date the resource was created.. [optional] # noqa: E501 + expected_availability_date (datetime, type(None)): The fixed deadline for the buckslips to be printed.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.date_created = date_created + self.date_modified = date_modified + self.object = object + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, date_created, date_modified, object, *args, **kwargs): # noqa: E501 + """BuckslipOrder - a model defined in OpenAPI + + Args: + date_created (datetime): A timestamp in ISO 8601 format of the date the resource was created. + date_modified (datetime): A timestamp in ISO 8601 format of the date the resource was last modified. + object (str): Value is type of resource. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + deleted (bool, type(None)): Only returned if the resource has been successfully deleted.. [optional] # noqa: E501 + id (str, type(None)): [optional] # noqa: E501 + buckslip_id (str, type(None)): [optional] # noqa: E501 + status (str, type(None)): The status of the buckslip order.. [optional] # noqa: E501 + quantity_ordered (float, type(None)): The quantity of buckslips ordered.. [optional] if omitted the server will use the default value of 0 # noqa: E501 + unit_price (float, type(None)): The unit price for the buckslip order.. [optional] if omitted the server will use the default value of 0 # noqa: E501 + inventory (float, type(None)): The inventory of the buckslip order.. [optional] if omitted the server will use the default value of 0 # noqa: E501 + cancelled_reason (str, type(None)): The reason for cancellation.. [optional] # noqa: E501 + availability_date (datetime, type(None)): A timestamp in ISO 8601 format of the date the resource was created.. [optional] # noqa: E501 + expected_availability_date (datetime, type(None)): The fixed deadline for the buckslips to be printed.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.date_created = date_created + self.date_modified = date_modified + self.object = object + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/lob_python/model/inline_response204.py b/lob_python/model/buckslip_order_editable.py old mode 100755 new mode 100644 similarity index 93% rename from lob_python/model/inline_response204.py rename to lob_python/model/buckslip_order_editable.py index af754d9..d60f6ac --- a/lob_python/model/inline_response204.py +++ b/lob_python/model/buckslip_order_editable.py @@ -31,7 +31,7 @@ -class InlineResponse204(ModelNormal): +class BuckslipOrderEditable(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,6 +59,10 @@ class InlineResponse204(ModelNormal): } validations = { + ('quantity',): { + 'inclusive_maximum': 10000000, + 'inclusive_minimum': 5000, + }, } @cached_property @@ -82,7 +86,7 @@ def openapi_types(): and the value is attribute type. """ return { - 'id': (str, type(None)), # noqa: E501 + 'quantity': (int,), # noqa: E501 } @cached_property @@ -91,7 +95,7 @@ def discriminator(): attribute_map = { - 'id': 'id', # noqa: E501 + 'quantity': 'quantity', # noqa: E501 } read_only_vars = { @@ -101,8 +105,11 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """InlineResponse204 - a model defined in OpenAPI + def _from_openapi_data(cls, quantity, *args, **kwargs): # noqa: E501 + """BuckslipOrderEditable - a model defined in OpenAPI + + Args: + quantity (int): The quantity of buckslips in the order (minimum 5,000). Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -135,7 +142,6 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - id (str, type(None)): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -163,6 +169,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.quantity = quantity for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ @@ -183,8 +190,11 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 ]) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs): # noqa: E501 - """InlineResponse204 - a model defined in OpenAPI + def __init__(self, quantity, *args, **kwargs): # noqa: E501 + """BuckslipOrderEditable - a model defined in OpenAPI + + Args: + quantity (int): The quantity of buckslips in the order (minimum 5,000). Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -217,7 +227,6 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - id (str, type(None)): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -243,6 +252,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.quantity = quantity for var_name, var_value in kwargs.items(): if var_name not in self.attribute_map and \ self._configuration is not None and \ diff --git a/lob_python/model/sort_by4.py b/lob_python/model/buckslip_orders_list.py old mode 100755 new mode 100644 similarity index 85% rename from lob_python/model/sort_by4.py rename to lob_python/model/buckslip_orders_list.py index d86a34b..e2a610d --- a/lob_python/model/sort_by4.py +++ b/lob_python/model/buckslip_orders_list.py @@ -31,7 +31,7 @@ -class SortBy4(ModelNormal): +class BuckslipOrdersList(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -56,14 +56,6 @@ class SortBy4(ModelNormal): """ allowed_values = { - ('date_created',): { - 'ASC': "asc", - 'DESC': "desc", - }, - ('send_date',): { - 'ASC': "asc", - 'DESC': "desc", - }, } validations = { @@ -90,8 +82,11 @@ def openapi_types(): and the value is attribute type. """ return { - 'date_created': (str, type(None)), # noqa: E501 - 'send_date': (str, type(None)), # noqa: E501 + 'object': (str, type(None)), # noqa: E501 + 'next_url': (str, type(None)), # noqa: E501 + 'previous_url': (str, type(None)), # noqa: E501 + 'count': (int, type(None)), # noqa: E501 + 'total_count': (int, type(None)), # noqa: E501 } @cached_property @@ -100,8 +95,11 @@ def discriminator(): attribute_map = { - 'date_created': 'date_created', # noqa: E501 - 'send_date': 'send_date', # noqa: E501 + 'object': 'object', # noqa: E501 + 'next_url': 'next_url', # noqa: E501 + 'previous_url': 'previous_url', # noqa: E501 + 'count': 'count', # noqa: E501 + 'total_count': 'total_count', # noqa: E501 } read_only_vars = { @@ -112,7 +110,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SortBy4 - a model defined in OpenAPI + """BuckslipOrdersList - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -145,8 +143,11 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - date_created (str, type(None)): [optional] # noqa: E501 - send_date (str, type(None)): [optional] # noqa: E501 + object (str, type(None)): Value is type of resource.. [optional] # noqa: E501 + next_url (str, type(None)): Url of next page of items in list.. [optional] # noqa: E501 + previous_url (str, type(None)): Url of previous page of items in list.. [optional] # noqa: E501 + count (int, type(None)): number of resources in a set. [optional] # noqa: E501 + total_count (int, type(None)): indicates the total number of records. Provided when the request specifies an \"include\" query parameter. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -195,7 +196,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """SortBy4 - a model defined in OpenAPI + """BuckslipOrdersList - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -228,8 +229,11 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - date_created (str, type(None)): [optional] # noqa: E501 - send_date (str, type(None)): [optional] # noqa: E501 + object (str, type(None)): Value is type of resource.. [optional] # noqa: E501 + next_url (str, type(None)): Url of next page of items in list.. [optional] # noqa: E501 + previous_url (str, type(None)): Url of previous page of items in list.. [optional] # noqa: E501 + count (int, type(None)): number of resources in a set. [optional] # noqa: E501 + total_count (int, type(None)): indicates the total number of records. Provided when the request specifies an \"include\" query parameter. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/lob_python/model/sort_by5.py b/lob_python/model/buckslip_updatable.py old mode 100755 new mode 100644 similarity index 88% rename from lob_python/model/sort_by5.py rename to lob_python/model/buckslip_updatable.py index 2c9d9d4..2a529ba --- a/lob_python/model/sort_by5.py +++ b/lob_python/model/buckslip_updatable.py @@ -29,9 +29,11 @@ ) from lob_python.exceptions import ApiAttributeError +from lob_python.model.buckslip_description import BuckslipDescription +globals()['BuckslipDescription'] = BuckslipDescription -class SortBy5(ModelNormal): +class BuckslipUpdatable(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -56,17 +58,13 @@ class SortBy5(ModelNormal): """ allowed_values = { - ('date_created',): { - 'ASC': "asc", - 'DESC': "desc", - }, - ('send_date',): { - 'ASC': "asc", - 'DESC': "desc", - }, } validations = { + ('reorder_quantity',): { + 'inclusive_maximum': 10000000, + 'inclusive_minimum': 5000, + }, } @cached_property @@ -90,8 +88,9 @@ def openapi_types(): and the value is attribute type. """ return { - 'date_created': (str, type(None)), # noqa: E501 - 'send_date': (str, type(None)), # noqa: E501 + 'description': (str, type(None)), # noqa: E501 + 'auto_reorder': (bool, type(None)), # noqa: E501 + 'reorder_quantity': (float, type(None)), # noqa: E501 } @cached_property @@ -100,8 +99,9 @@ def discriminator(): attribute_map = { - 'date_created': 'date_created', # noqa: E501 - 'send_date': 'send_date', # noqa: E501 + 'description': 'description', # noqa: E501 + 'auto_reorder': 'auto_reorder', # noqa: E501 + 'reorder_quantity': 'reorder_quantity', # noqa: E501 } read_only_vars = { @@ -112,7 +112,7 @@ def discriminator(): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 - """SortBy5 - a model defined in OpenAPI + """BuckslipUpdatable - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -145,8 +145,9 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - date_created (str, type(None)): [optional] # noqa: E501 - send_date (str, type(None)): [optional] # noqa: E501 + description (str, type(None)): [optional] # noqa: E501 + auto_reorder (bool, type(None)): Allows for auto reordering. [optional] # noqa: E501 + reorder_quantity (float, type(None)): The quantity of items to be reordered (only required when auto_reorder is true).. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -195,7 +196,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """SortBy5 - a model defined in OpenAPI + """BuckslipUpdatable - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -228,8 +229,9 @@ def __init__(self, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - date_created (str, type(None)): [optional] # noqa: E501 - send_date (str, type(None)): [optional] # noqa: E501 + description (str, type(None)): [optional] # noqa: E501 + auto_reorder (bool, type(None)): Allows for auto reordering. [optional] # noqa: E501 + reorder_quantity (float, type(None)): The quantity of items to be reordered (only required when auto_reorder is true).. [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/lob_python/model/buckslips_list.py b/lob_python/model/buckslips_list.py new file mode 100644 index 0000000..d3fb06c --- /dev/null +++ b/lob_python/model/buckslips_list.py @@ -0,0 +1,287 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + +from lob_python.model.buckslip import Buckslip +globals()['Buckslip'] = Buckslip + + +class BuckslipsList(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'data': (list, type(None)), # noqa: E501 + 'object': (str, type(None)), # noqa: E501 + 'next_url': (str, type(None)), # noqa: E501 + 'previous_url': (str, type(None)), # noqa: E501 + 'count': (int, type(None)), # noqa: E501 + 'total_count': (int, type(None)), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + def getNextPageToken(self): + if (self.next_url): + after_index = self.next_url.find("after=") + return self.next_url[after_index+6:] + def getPreviousPageToken(self): + if (self.previous_url): + before_index = self.previous_url.find("before=") + return self.previous_url[before_index+7:] + + + attribute_map = { + 'data': 'data', # noqa: E501 + 'object': 'object', # noqa: E501 + 'next_url': 'next_url', # noqa: E501 + 'previous_url': 'previous_url', # noqa: E501 + 'count': 'count', # noqa: E501 + 'total_count': 'total_count', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 + """BuckslipsList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (list, type(None)): list of buckslips. [optional] # noqa: E501 + object (str, type(None)): Value is type of resource.. [optional] # noqa: E501 + next_url (str, type(None)): url of next page of items in list.. [optional] # noqa: E501 + previous_url (str, type(None)): url of previous page of items in list.. [optional] # noqa: E501 + count (int, type(None)): number of resources in a set. [optional] # noqa: E501 + total_count (int, type(None)): indicates the total number of records. Provided when the request specifies an \"include\" query parameter. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs): # noqa: E501 + """BuckslipsList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data (list, type(None)): list of buckslips. [optional] # noqa: E501 + object (str, type(None)): Value is type of resource.. [optional] # noqa: E501 + next_url (str, type(None)): url of next page of items in list.. [optional] # noqa: E501 + previous_url (str, type(None)): url of previous page of items in list.. [optional] # noqa: E501 + count (int, type(None)): number of resources in a set. [optional] # noqa: E501 + total_count (int, type(None)): indicates the total number of records. Provided when the request specifies an \"include\" query parameter. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/lob_python/model/campaign.py b/lob_python/model/campaign.py old mode 100644 new mode 100755 diff --git a/lob_python/model/campaign_creative.py b/lob_python/model/campaign_creative.py old mode 100644 new mode 100755 diff --git a/lob_python/model/campaign_deletion.py b/lob_python/model/campaign_deletion.py old mode 100644 new mode 100755 diff --git a/lob_python/model/campaign_updatable.py b/lob_python/model/campaign_updatable.py old mode 100644 new mode 100755 diff --git a/lob_python/model/campaign_writable.py b/lob_python/model/campaign_writable.py old mode 100644 new mode 100755 diff --git a/lob_python/model/campaigns_list.py b/lob_python/model/campaigns_list.py old mode 100644 new mode 100755 diff --git a/lob_python/model/cmp_id.py b/lob_python/model/cmp_id.py old mode 100644 new mode 100755 diff --git a/lob_python/model/cmp_schedule_type.py b/lob_python/model/cmp_schedule_type.py old mode 100644 new mode 100755 diff --git a/lob_python/model/cmp_use_type.py b/lob_python/model/cmp_use_type.py old mode 100644 new mode 100755 diff --git a/lob_python/model/creative_patch.py b/lob_python/model/creative_patch.py old mode 100644 new mode 100755 diff --git a/lob_python/model/creative_response.py b/lob_python/model/creative_response.py old mode 100644 new mode 100755 diff --git a/lob_python/model/creative_writable.py b/lob_python/model/creative_writable.py old mode 100644 new mode 100755 diff --git a/lob_python/model/crv_id.py b/lob_python/model/crv_id.py old mode 100644 new mode 100755 diff --git a/lob_python/model/letter.py b/lob_python/model/letter.py index c785393..0587ddf 100755 --- a/lob_python/model/letter.py +++ b/lob_python/model/letter.py @@ -36,6 +36,7 @@ from lob_python.model.merge_variables import MergeVariables from lob_python.model.metadata_model import MetadataModel from lob_python.model.resource_description import ResourceDescription +from lob_python.model.signed_link import SignedLink from lob_python.model.thumbnail import Thumbnail from lob_python.model.tmpl_id import TmplId from lob_python.model.tracking_event_normal import TrackingEventNormal @@ -47,6 +48,7 @@ globals()['MergeVariables'] = MergeVariables globals()['MetadataModel'] = MetadataModel globals()['ResourceDescription'] = ResourceDescription +globals()['SignedLink'] = SignedLink globals()['Thumbnail'] = Thumbnail globals()['TmplId'] = TmplId globals()['TrackingEventNormal'] = TrackingEventNormal @@ -134,6 +136,7 @@ def openapi_types(): 'deleted': (bool, type(None)), # noqa: E501 'template_id': (str, type(None)), # noqa: E501 'template_version_id': (str, type(None)), # noqa: E501 + 'url': (str, type(None)), # noqa: E501 'description': (str, type(None)), # noqa: E501 'metadata': (MetadataModel, type(None)), # noqa: E501 'merge_variables': (MergeVariables, type(None)), # noqa: E501 @@ -169,6 +172,7 @@ def discriminator(): 'deleted': 'deleted', # noqa: E501 'template_id': 'template_id', # noqa: E501 'template_version_id': 'template_version_id', # noqa: E501 + 'url': 'url', # noqa: E501 'description': 'description', # noqa: E501 'metadata': 'metadata', # noqa: E501 'merge_variables': 'merge_variables', # noqa: E501 @@ -241,6 +245,7 @@ def _from_openapi_data(cls, to, _from, date_created, date_modified, id, return_e deleted (bool, type(None)): Only returned if the resource has been successfully deleted.. [optional] # noqa: E501 template_id (str, type(None)): [optional] # noqa: E501 template_version_id (str, type(None)): [optional] # noqa: E501 + url (str, type(None)): [optional] # noqa: E501 description (str, type(None)): [optional] # noqa: E501 metadata (MetadataModel, type(None)): [optional] # noqa: E501 merge_variables (MergeVariables, type(None)): [optional] # noqa: E501 @@ -359,6 +364,7 @@ def __init__(self, to, _from, date_created, date_modified, id, return_envelope, deleted (bool, type(None)): Only returned if the resource has been successfully deleted.. [optional] # noqa: E501 template_id (str, type(None)): [optional] # noqa: E501 template_version_id (str, type(None)): [optional] # noqa: E501 + url (str, type(None)): [optional] # noqa: E501 description (str, type(None)): [optional] # noqa: E501 metadata (MetadataModel, type(None)): [optional] # noqa: E501 merge_variables (MergeVariables, type(None)): [optional] # noqa: E501 diff --git a/lob_python/model/letter_editable.py b/lob_python/model/letter_editable.py index a2aab43..4ccd26c 100755 --- a/lob_python/model/letter_editable.py +++ b/lob_python/model/letter_editable.py @@ -33,11 +33,13 @@ from lob_python.model.mail_type import MailType from lob_python.model.merge_variables import MergeVariables from lob_python.model.metadata_model import MetadataModel +from lob_python.model.qr_code import QrCode from lob_python.model.resource_description import ResourceDescription globals()['CardId'] = CardId globals()['MailType'] = MailType globals()['MergeVariables'] = MergeVariables globals()['MetadataModel'] = MetadataModel +globals()['QrCode'] = QrCode globals()['ResourceDescription'] = ResourceDescription @@ -127,6 +129,7 @@ def openapi_types(): 'extra_service': (str, type(None)), # noqa: E501 'cards': (list, type(None)), # noqa: E501 'billing_group_id': (str, type(None)), # noqa: E501 + 'qr_code': (QrCode, type(None)), # noqa: E501 } @cached_property @@ -152,6 +155,7 @@ def discriminator(): 'extra_service': 'extra_service', # noqa: E501 'cards': 'cards', # noqa: E501 'billing_group_id': 'billing_group_id', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 } read_only_vars = { @@ -214,6 +218,7 @@ def _from_openapi_data(cls, color, to, _from, file, *args, **kwargs): # noqa: E extra_service (str, type(None)): Add an extra service to your letter: * `certified` - track and confirm delivery for domestic destinations. An extra sheet (1 PDF page single-sided or 2 PDF pages double-sided) is added to the beginning of your letter for address and barcode information. See here for templates: [#10 envelope](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_certified_template.pdf) and [flat envelope](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_certified_flat_template.pdf) (used for letters over 6 pages single-sided or 12 pages double-sided). You will not be charged for this extra sheet. * `certified_return_receipt` - request an electronic copy of the recipient's signature to prove delivery of your certified letter * `registered` - provides tracking and confirmation for international addresses . [optional] # noqa: E501 cards (list, type(None)): A single-element array containing an existing card id in a string format. See [cards](#tag/Cards) for more information.. [optional] # noqa: E501 billing_group_id (str, type(None)): An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See [Billing Group API](https://lob.github.io/lob-openapi/#tag/Billing-Groups) for more information.. [optional] # noqa: E501 + qr_code (QrCode, type(None)): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -318,6 +323,7 @@ def __init__(self, color, to, _from, file, *args, **kwargs): # noqa: E501 extra_service (str, type(None)): Add an extra service to your letter: * `certified` - track and confirm delivery for domestic destinations. An extra sheet (1 PDF page single-sided or 2 PDF pages double-sided) is added to the beginning of your letter for address and barcode information. See here for templates: [#10 envelope](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_certified_template.pdf) and [flat envelope](https://s3-us-west-2.amazonaws.com/public.lob.com/assets/templates/letter_certified_flat_template.pdf) (used for letters over 6 pages single-sided or 12 pages double-sided). You will not be charged for this extra sheet. * `certified_return_receipt` - request an electronic copy of the recipient's signature to prove delivery of your certified letter * `registered` - provides tracking and confirmation for international addresses . [optional] # noqa: E501 cards (list, type(None)): A single-element array containing an existing card id in a string format. See [cards](#tag/Cards) for more information.. [optional] # noqa: E501 billing_group_id (str, type(None)): An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See [Billing Group API](https://lob.github.io/lob-openapi/#tag/Billing-Groups) for more information.. [optional] # noqa: E501 + qr_code (QrCode, type(None)): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/lob_python/model/postcard_editable.py b/lob_python/model/postcard_editable.py index 6726579..c830a44 100755 --- a/lob_python/model/postcard_editable.py +++ b/lob_python/model/postcard_editable.py @@ -33,11 +33,13 @@ from lob_python.model.merge_variables import MergeVariables from lob_python.model.metadata_model import MetadataModel from lob_python.model.postcard_size import PostcardSize +from lob_python.model.qr_code import QrCode from lob_python.model.resource_description import ResourceDescription globals()['MailType'] = MailType globals()['MergeVariables'] = MergeVariables globals()['MetadataModel'] = MetadataModel globals()['PostcardSize'] = PostcardSize +globals()['QrCode'] = QrCode globals()['ResourceDescription'] = ResourceDescription @@ -104,6 +106,7 @@ def openapi_types(): 'merge_variables': (MergeVariables, type(None)), # noqa: E501 'send_date': (datetime, type(None)), # noqa: E501 'billing_group_id': (str, type(None)), # noqa: E501 + 'qr_code': (QrCode, type(None)), # noqa: E501 } @cached_property @@ -123,6 +126,7 @@ def discriminator(): 'merge_variables': 'merge_variables', # noqa: E501 'send_date': 'send_date', # noqa: E501 'billing_group_id': 'billing_group_id', # noqa: E501 + 'qr_code': 'qr_code', # noqa: E501 } read_only_vars = { @@ -179,6 +183,7 @@ def _from_openapi_data(cls, to, front, back, *args, **kwargs): # noqa: E501 merge_variables (MergeVariables, type(None)): [optional] # noqa: E501 send_date (datetime, type(None)): A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default [cancellation window](#section/Cancellation-Windows) applied to the mailpiece. Until the `send_date` has passed, the mailpiece can be canceled. If a date in the format `2017-11-01` is passed, it will evaluate to midnight UTC of that date (`2017-11-01T00:00:00.000Z`). If a datetime is passed, that exact time will be used. A `send_date` passed with no time zone will default to UTC, while a `send_date` passed with a time zone will be converted to UTC.. [optional] # noqa: E501 billing_group_id (str, type(None)): An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See [Billing Group API](https://lob.github.io/lob-openapi/#tag/Billing-Groups) for more information.. [optional] # noqa: E501 + qr_code (QrCode, type(None)): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) @@ -276,6 +281,7 @@ def __init__(self, to, front, back, *args, **kwargs): # noqa: E501 merge_variables (MergeVariables, type(None)): [optional] # noqa: E501 send_date (datetime, type(None)): A timestamp in ISO 8601 format which specifies a date after the current time and up to 180 days in the future to send the letter off for production. Setting a send date overrides the default [cancellation window](#section/Cancellation-Windows) applied to the mailpiece. Until the `send_date` has passed, the mailpiece can be canceled. If a date in the format `2017-11-01` is passed, it will evaluate to midnight UTC of that date (`2017-11-01T00:00:00.000Z`). If a datetime is passed, that exact time will be used. A `send_date` passed with no time zone will default to UTC, while a `send_date` passed with a time zone will be converted to UTC.. [optional] # noqa: E501 billing_group_id (str, type(None)): An optional string with the billing group ID to tag your usage with. Is used for billing purposes. Requires special activation to use. See [Billing Group API](https://lob.github.io/lob-openapi/#tag/Billing-Groups) for more information.. [optional] # noqa: E501 + qr_code (QrCode, type(None)): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/lob_python/model/qr_code.py b/lob_python/model/qr_code.py new file mode 100644 index 0000000..c805d36 --- /dev/null +++ b/lob_python/model/qr_code.py @@ -0,0 +1,294 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + + + +class QrCode(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('position',): { + 'FIXED': "fixed", + 'RELATIVE': "relative", + }, + } + + validations = { + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = False + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'position': (str,), # noqa: E501 + 'redirect_url': (str,), # noqa: E501 + 'width': (str,), # noqa: E501 + 'top': (str, type(None)), # noqa: E501 + 'right': (str, type(None)), # noqa: E501 + 'left': (str, type(None)), # noqa: E501 + 'bottom': (str, type(None)), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'position': 'position', # noqa: E501 + 'redirect_url': 'redirect_url', # noqa: E501 + 'width': 'width', # noqa: E501 + 'top': 'top', # noqa: E501 + 'right': 'right', # noqa: E501 + 'left': 'left', # noqa: E501 + 'bottom': 'bottom', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, position, redirect_url, width, *args, **kwargs): # noqa: E501 + """QrCode - a model defined in OpenAPI + + Args: + position (str): Sets how a QR code is being positioned in the document. + redirect_url (str): The url to redirect the user when a QR code is scanned. The url must start with `https://` + width (str): The size(in inches) of the QR code. All QR codes are generated as a square. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + top (str, type(None)): Vertical distance(in inches) to place QR code from the top.. [optional] # noqa: E501 + right (str, type(None)): Horizonal distance(in inches) to place QR code from the right.. [optional] # noqa: E501 + left (str, type(None)): Horizonal distance(in inches) to place QR code from the left.. [optional] # noqa: E501 + bottom (str, type(None)): Vertical distance(in inches) to place QR code from the bottom.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.position = position + self.redirect_url = redirect_url + self.width = width + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, position, redirect_url, width, *args, **kwargs): # noqa: E501 + """QrCode - a model defined in OpenAPI + + Args: + position (str): Sets how a QR code is being positioned in the document. + redirect_url (str): The url to redirect the user when a QR code is scanned. The url must start with `https://` + width (str): The size(in inches) of the QR code. All QR codes are generated as a square. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + top (str, type(None)): Vertical distance(in inches) to place QR code from the top.. [optional] # noqa: E501 + right (str, type(None)): Horizonal distance(in inches) to place QR code from the right.. [optional] # noqa: E501 + left (str, type(None)): Horizonal distance(in inches) to place QR code from the left.. [optional] # noqa: E501 + bottom (str, type(None)): Vertical distance(in inches) to place QR code from the bottom.. [optional] # noqa: E501 + """ + + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.position = position + self.redirect_url = redirect_url + self.width = width + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/lob_python/models/__init__.py b/lob_python/models/__init__.py index 960e9d3..f607d9a 100755 --- a/lob_python/models/__init__.py +++ b/lob_python/models/__init__.py @@ -28,9 +28,22 @@ from lob_python.model.billing_group import BillingGroup from lob_python.model.billing_group_editable import BillingGroupEditable from lob_python.model.billing_group_list import BillingGroupList +from lob_python.model.bo_id import BoId +from lob_python.model.buckslip import Buckslip +from lob_python.model.buckslip_deletion import BuckslipDeletion +from lob_python.model.buckslip_description import BuckslipDescription +from lob_python.model.buckslip_editable import BuckslipEditable +from lob_python.model.buckslip_id import BuckslipId +from lob_python.model.buckslip_order import BuckslipOrder +from lob_python.model.buckslip_order_editable import BuckslipOrderEditable +from lob_python.model.buckslip_orders_list import BuckslipOrdersList +from lob_python.model.buckslip_updatable import BuckslipUpdatable +from lob_python.model.buckslips_list import BuckslipsList from lob_python.model.bulk_error import BulkError from lob_python.model.bulk_error_properties import BulkErrorProperties from lob_python.model.campaign import Campaign +from lob_python.model.campaign_creative import CampaignCreative +from lob_python.model.campaign_deletion import CampaignDeletion from lob_python.model.campaign_updatable import CampaignUpdatable from lob_python.model.campaign_writable import CampaignWritable from lob_python.model.campaigns_list import CampaignsList @@ -122,6 +135,7 @@ from lob_python.model.postcard_size import PostcardSize from lob_python.model.primary_line_us import PrimaryLineUs from lob_python.model.psc_id import PscId +from lob_python.model.qr_code import QrCode from lob_python.model.recipient import Recipient from lob_python.model.resource_description import ResourceDescription from lob_python.model.return_envelope import ReturnEnvelope diff --git a/test/Unit/test_billing_groups_api.py b/test/Unit/test_billing_groups_api.py index 79f4cd1..372a796 100644 --- a/test/Unit/test_billing_groups_api.py +++ b/test/Unit/test_billing_groups_api.py @@ -18,7 +18,7 @@ from lob_python.api.billing_groups_api import BillingGroupsApi # noqa: E501 from lob_python.model.billing_group_editable import BillingGroupEditable from lob_python.model.include_model import IncludeModel -from lob_python.model.sort_by5 import SortBy5 +from lob_python.model.sort_by3 import SortBy3 from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException from unittest.mock import Mock, MagicMock @@ -162,7 +162,7 @@ def test_billing_groups_list_with_dateModified_param(self): def test_billing_groups_list_with_sort_by_param(self): """Test case for listing billing groups with sort_by parameter""" self.mock_api.billing_groups_list = self.mock_list_of_billing_groups - billing_groups = self.mock_api.billing_groups_list(sort_by=SortBy5(date_created = 'asc')) + billing_groups = self.mock_api.billing_groups_list(sort_by=SortBy3(date_created = 'asc')) self.assertIsNotNone(billing_groups) self.assertEqual(len(billing_groups["data"]), 2) diff --git a/test/Unit/test_campaigns_api.py b/test/Unit/test_campaigns_api.py index 194b8ac..294bdde 100644 --- a/test/Unit/test_campaigns_api.py +++ b/test/Unit/test_campaigns_api.py @@ -19,7 +19,7 @@ # from lob_python.model.campaign_updatable import CampaignUpdatable # from lob_python.model.cmp_schedule_type import CmpScheduleType # from unittest.mock import Mock, MagicMock -# from lob_python.model.sort_by5 import SortBy5 +# from lob_python.model.sort_by3 import SortBy3 # from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException @@ -146,7 +146,7 @@ # def test_campaigns_list_with_sortby_param(self): # """Test case for listing campaign with sort_by parameter""" # self.mock_api.campaigns_list = self.mock_list_of_campaigns -# campaigns = self.mock_api.campaigns_list(sort_by=SortBy5(date_created = 'asc')) +# campaigns = self.mock_api.campaigns_list(sort_by=SortBy3(date_created = 'asc')) # self.assertIsNotNone(campaigns) # self.assertIsNotNone(campaigns["data"], 2) diff --git a/test/Unit/test_cards_api.py b/test/Unit/test_cards_api.py index a72cfbc..9def5f3 100644 --- a/test/Unit/test_cards_api.py +++ b/test/Unit/test_cards_api.py @@ -16,7 +16,7 @@ from lob_python.api.cards_api import CardsApi # noqa: E501 from lob_python.model.card_editable import CardEditable from lob_python.model.card_updatable import CardUpdatable -from lob_python.model.sort_by5 import SortBy5 +from lob_python.model.sort_by3 import SortBy3 from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException from unittest.mock import Mock, MagicMock @@ -147,7 +147,7 @@ def test_cards_list_with_after_param(self): def test_cards_list_with_sortby_param(self): """Test case for listing card with sort_by parameter""" self.mock_api.cards_list = self.mock_list_of_cards - cards = self.mock_api.cards_list(sort_by=SortBy5(date_created = 'asc')) + cards = self.mock_api.cards_list(sort_by=SortBy3(date_created = 'asc')) self.assertIsNotNone(cards) self.assertIsNotNone(cards["data"], 2) diff --git a/test/Unit/test_checks_api.py b/test/Unit/test_checks_api.py index 42f4312..54d1f11 100644 --- a/test/Unit/test_checks_api.py +++ b/test/Unit/test_checks_api.py @@ -16,7 +16,7 @@ from lob_python.api.checks_api import ChecksApi # noqa: E501 from lob_python.model.check_editable import CheckEditable from lob_python.model.mail_type import MailType -from lob_python.model.sort_by5 import SortBy5 +from lob_python.model.sort_by3 import SortBy3 from lob_python.model.include_model import IncludeModel from lob_python.model.metadata_model import MetadataModel from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException @@ -196,7 +196,7 @@ def test_checks_list_with_mail_type_param(self): def test_checks_list_with_sort_by_param(self): """Test case for listing check with sort_by parameter""" self.mock_api.checks_list = self.mock_list_of_checks - checks = self.mock_api.checks_list(sort_by=SortBy5(date_created = 'asc')) + checks = self.mock_api.checks_list(sort_by=SortBy3(date_created = 'asc')) self.assertIsNotNone(checks) self.assertEqual(len(checks["data"]), 2) diff --git a/test/Unit/test_letters_api.py b/test/Unit/test_letters_api.py index 86e254c..cde3bbb 100644 --- a/test/Unit/test_letters_api.py +++ b/test/Unit/test_letters_api.py @@ -17,7 +17,7 @@ from lob_python.model.letter_editable import LetterEditable from lob_python.model.address_editable import AddressEditable from lob_python.model.mail_type import MailType -from lob_python.model.sort_by5 import SortBy5 +from lob_python.model.sort_by3 import SortBy3 from lob_python.model.metadata_model import MetadataModel from lob_python.model.include_model import IncludeModel from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException @@ -169,7 +169,7 @@ def test_letters_list_with_mail_type_param(self): def test_letters_list_with_sort_by_param(self): """Test case for listing letter with sort_by parameter""" self.mock_api.letters_list = self.mock_list_of_letters - letters = self.mock_api.letters_list(sort_by=SortBy5(date_created = 'asc')) + letters = self.mock_api.letters_list(sort_by=SortBy3(date_created = 'asc')) self.assertIsNotNone(letters) self.assertEqual(len(letters["data"]), 2) diff --git a/test/Unit/test_postcards_api.py b/test/Unit/test_postcards_api.py index c5ba36f..4d3e7b7 100644 --- a/test/Unit/test_postcards_api.py +++ b/test/Unit/test_postcards_api.py @@ -16,7 +16,7 @@ from lob_python.api.postcards_api import PostcardsApi # noqa: E501 from lob_python.model.postcard_editable import PostcardEditable from lob_python.model.mail_type import MailType -from lob_python.model.sort_by5 import SortBy5 +from lob_python.model.sort_by3 import SortBy3 from lob_python.model.metadata_model import MetadataModel from lob_python.model.include_model import IncludeModel from lob_python.model.postcard_size import PostcardSize @@ -169,7 +169,7 @@ def test_postcards_list_with_mail_type_param(self): def test_postcards_list_with_sort_by_param(self): """Test case for listing postcard with sort_by parameter""" self.mock_api.postcards_list = self.mock_list_of_postcards - postcards = self.mock_api.postcards_list(sort_by=SortBy5(date_created = 'asc')) + postcards = self.mock_api.postcards_list(sort_by=SortBy3(date_created = 'asc')) self.assertIsNotNone(postcards) self.assertEqual(len(postcards["data"]), 2) diff --git a/test/Unit/test_self_mailers_api.py b/test/Unit/test_self_mailers_api.py index 20ebe70..9013d82 100644 --- a/test/Unit/test_self_mailers_api.py +++ b/test/Unit/test_self_mailers_api.py @@ -19,7 +19,7 @@ from lob_python.model.include_model import IncludeModel from lob_python.model.self_mailer_size import SelfMailerSize from lob_python.model.mail_type import MailType -from lob_python.model.sort_by5 import SortBy5 +from lob_python.model.sort_by3 import SortBy3 from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException from unittest.mock import Mock, MagicMock @@ -202,7 +202,7 @@ def test_self_mailers_list_with_mail_type_param(self): def test_self_mailers_list_with_sort_by_param(self): """Test case for listing self mailer with sort_by parameter""" self.mock_api.self_mailers_list = self.mock_list_of_self_mailers - self_mailers = self.mock_api.self_mailers_list(sort_by=SortBy5(date_created = 'asc')) + self_mailers = self.mock_api.self_mailers_list(sort_by=SortBy3(date_created = 'asc')) self.assertIsNotNone(self_mailers) self.assertEqual(len(self_mailers["data"]), 2) diff --git a/test/Unit/test_uploads_api.py b/test/Unit/test_uploads_api.py index cad0570..ec8da1d 100644 --- a/test/Unit/test_uploads_api.py +++ b/test/Unit/test_uploads_api.py @@ -17,7 +17,7 @@ # from lob_python.model.upload_writable import UploadWritable # from lob_python.model.upload_updatable import UploadUpdatable # from unittest.mock import Mock, MagicMock -# from lob_python.model.sort_by5 import SortBy5 +# from lob_python.model.sort_by3 import SortBy3 # from lob_python.exceptions import UnauthorizedException, NotFoundException, ApiException @@ -139,7 +139,7 @@ # def test_uploads_list_with_sortby_param(self): # """Test case for listing upload with sort_by parameter""" # self.mock_api.uploads_list = self.mock_list_of_uploads -# uploads = self.mock_api.uploads_list(sort_by=SortBy5(date_created = 'asc')) +# uploads = self.mock_api.uploads_list(sort_by=SortBy3(date_created = 'asc')) # self.assertIsNotNone(uploads) # self.assertIsNotNone(uploads["data"], 2) From 087f008b8de9d07228d733e7a68624239e4bae29 Mon Sep 17 00:00:00 2001 From: BennyKitchell Date: Sat, 5 Nov 2022 22:34:54 -0500 Subject: [PATCH 2/2] fix: add in missing manual model --- .../model/letter_editable_custom_envelope.py | 282 ++++++++++++++++++ lob_python/models/__init__.py | 1 + 2 files changed, 283 insertions(+) create mode 100644 lob_python/model/letter_editable_custom_envelope.py diff --git a/lob_python/model/letter_editable_custom_envelope.py b/lob_python/model/letter_editable_custom_envelope.py new file mode 100644 index 0000000..31f821b --- /dev/null +++ b/lob_python/model/letter_editable_custom_envelope.py @@ -0,0 +1,282 @@ +""" + Lob + + 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.

Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501 + + The version of the OpenAPI document: 1.3.0 + Contact: lob-openapi@lob.com + Generated by: https://openapi-generator.tech +""" + + +import re # noqa: F401 +import sys # noqa: F401 + +from lob_python.model_utils import ( # noqa: F401 + ApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, + OpenApiModel +) +from lob_python.exceptions import ApiAttributeError + + + +class LetterEditableCustomEnvelope(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + allowed_values = { + ('object',): { + 'ENVELOPE': "envelope", + }, + } + + validations = { + ('id',): { + 'max_length': 40, + }, + } + + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + + _nullable = True + + @cached_property + def openapi_types(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + 'id': (str,), # noqa: E501 + 'url': (str,), # noqa: E501 + 'object': (str,), # noqa: E501 + } + + @cached_property + def discriminator(): + return None + + + attribute_map = { + 'id': 'id', # noqa: E501 + 'url': 'url', # noqa: E501 + 'object': 'object', # noqa: E501 + } + + read_only_vars = { + } + + _composed_schemas = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls, id, url, *args, **kwargs): # noqa: E501 + """LetterEditableCustomEnvelope - a model defined in OpenAPI + + Args: + id (str): The unique identifier of the custom envelope used. + url (str): The url of the envelope asset used. + + Keyword Args: + object (str): defaults to "envelope", must be one of ["envelope", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + object = kwargs.get('object', "envelope") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.url = url + self.object = object + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + return self + + required_properties = set([ + '_data_store', + '_check_type', + '_spec_property_naming', + '_path_to_item', + '_configuration', + '_visited_composed_classes', + ]) + + @convert_js_args_to_python_args + def __init__(self, id, url, *args, **kwargs): # noqa: E501 + """LetterEditableCustomEnvelope - a model defined in OpenAPI + + Args: + id (str): The unique identifier of the custom envelope used. + url (str): The url of the envelope asset used. + + Keyword Args: + object (str): defaults to "envelope", must be one of ["envelope", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + + object = kwargs.get('object', "envelope") + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + + if args: + raise ApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + args, + self.__class__.__name__, + ), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.id = id + self.url = url + self.object = object + for var_name, var_value in kwargs.items(): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/lob_python/models/__init__.py b/lob_python/models/__init__.py index f607d9a..0697476 100755 --- a/lob_python/models/__init__.py +++ b/lob_python/models/__init__.py @@ -110,6 +110,7 @@ from lob_python.model.letter_details_returned import LetterDetailsReturned from lob_python.model.letter_details_writable import LetterDetailsWritable from lob_python.model.letter_editable import LetterEditable +from lob_python.model.letter_editable_custom_envelope import LetterEditableCustomEnvelope from lob_python.model.letter_list import LetterList from lob_python.model.lob_confidence_score import LobConfidenceScore from lob_python.model.lob_error import LobError