From 94e44400c24f2275e35573a3cc93070e834496a3 Mon Sep 17 00:00:00 2001 From: Justin Koke Date: Thu, 16 Sep 2021 10:13:36 +1000 Subject: [PATCH 1/2] fix: errors found in referencing discriminator() and openapi_types() --- .../model/query_aggregate_result_analysis.py | 4 ++-- .../model/query_aggregate_result_buckets_bucket.py | 14 ++++---------- .../model/query_aggregate_result_count.py | 14 ++++---------- sajari_client/model/query_aggregate_result_date.py | 14 ++++---------- .../model/query_aggregate_result_metric.py | 14 ++++---------- .../model/query_collection_request_pipeline.py | 14 ++++---------- .../query_collection_request_tracking_type.py | 14 ++++---------- .../model/query_collection_response_pipeline.py | 14 ++++---------- sajari_client/model/query_result_token_click.py | 14 ++++---------- sajari_client/model/query_result_token_pos_neg.py | 14 ++++---------- sajari_client/model/record_key.py | 14 ++++---------- sajari_client/model/schema_field_mode.py | 14 ++++---------- sajari_client/model/schema_field_type.py | 14 ++++---------- sajari_client/model/send_event_request.py | 14 ++++---------- sajari_client/model/set_default_version_request.py | 14 ++++---------- .../model/upsert_record_request_pipeline.py | 12 +++--------- 16 files changed, 61 insertions(+), 151 deletions(-) diff --git a/sajari_client/model/query_aggregate_result_analysis.py b/sajari_client/model/query_aggregate_result_analysis.py index 90d767d..0026f24 100644 --- a/sajari_client/model/query_aggregate_result_analysis.py +++ b/sajari_client/model/query_aggregate_result_analysis.py @@ -62,7 +62,7 @@ class QueryAggregateResultAnalysis(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -80,7 +80,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { diff --git a/sajari_client/model/query_aggregate_result_buckets_bucket.py b/sajari_client/model/query_aggregate_result_buckets_bucket.py index effacad..4b524d6 100644 --- a/sajari_client/model/query_aggregate_result_buckets_bucket.py +++ b/sajari_client/model/query_aggregate_result_buckets_bucket.py @@ -62,7 +62,7 @@ class QueryAggregateResultBucketsBucket(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -77,7 +77,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -87,14 +87,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/query_aggregate_result_count.py b/sajari_client/model/query_aggregate_result_count.py index 69b533b..c0bf26b 100644 --- a/sajari_client/model/query_aggregate_result_count.py +++ b/sajari_client/model/query_aggregate_result_count.py @@ -62,7 +62,7 @@ class QueryAggregateResultCount(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -76,7 +76,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -85,14 +85,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/query_aggregate_result_date.py b/sajari_client/model/query_aggregate_result_date.py index ba11f36..bb648ba 100644 --- a/sajari_client/model/query_aggregate_result_date.py +++ b/sajari_client/model/query_aggregate_result_date.py @@ -62,7 +62,7 @@ class QueryAggregateResultDate(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -76,7 +76,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -85,14 +85,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/query_aggregate_result_metric.py b/sajari_client/model/query_aggregate_result_metric.py index e8c5467..7816aed 100644 --- a/sajari_client/model/query_aggregate_result_metric.py +++ b/sajari_client/model/query_aggregate_result_metric.py @@ -62,7 +62,7 @@ class QueryAggregateResultMetric(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -76,7 +76,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -85,14 +85,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/query_collection_request_pipeline.py b/sajari_client/model/query_collection_request_pipeline.py index 4ad69f2..527f8d7 100644 --- a/sajari_client/model/query_collection_request_pipeline.py +++ b/sajari_client/model/query_collection_request_pipeline.py @@ -62,7 +62,7 @@ class QueryCollectionRequestPipeline(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -77,7 +77,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -87,14 +87,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', + '_visited_composed_classes'} @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 diff --git a/sajari_client/model/query_collection_request_tracking_type.py b/sajari_client/model/query_collection_request_tracking_type.py index 7a60db4..84a4998 100644 --- a/sajari_client/model/query_collection_request_tracking_type.py +++ b/sajari_client/model/query_collection_request_tracking_type.py @@ -64,7 +64,7 @@ class QueryCollectionRequestTrackingType(ModelSimple): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -78,21 +78,15 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = {} _composed_schemas = None - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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): diff --git a/sajari_client/model/query_collection_response_pipeline.py b/sajari_client/model/query_collection_response_pipeline.py index 748acd4..e655c33 100644 --- a/sajari_client/model/query_collection_response_pipeline.py +++ b/sajari_client/model/query_collection_response_pipeline.py @@ -62,7 +62,7 @@ class QueryCollectionResponsePipeline(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -77,7 +77,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -87,14 +87,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/query_result_token_click.py b/sajari_client/model/query_result_token_click.py index e389285..8d29f38 100644 --- a/sajari_client/model/query_result_token_click.py +++ b/sajari_client/model/query_result_token_click.py @@ -62,7 +62,7 @@ class QueryResultTokenClick(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -76,7 +76,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -85,14 +85,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/query_result_token_pos_neg.py b/sajari_client/model/query_result_token_pos_neg.py index 7d2a2ff..3facd0e 100644 --- a/sajari_client/model/query_result_token_pos_neg.py +++ b/sajari_client/model/query_result_token_pos_neg.py @@ -62,7 +62,7 @@ class QueryResultTokenPosNeg(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -77,7 +77,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -87,14 +87,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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 diff --git a/sajari_client/model/record_key.py b/sajari_client/model/record_key.py index 0699452..ac59ece 100644 --- a/sajari_client/model/record_key.py +++ b/sajari_client/model/record_key.py @@ -62,7 +62,7 @@ class RecordKey(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -77,7 +77,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -87,14 +87,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', + '_visited_composed_classes'} @convert_js_args_to_python_args def __init__(self, field, value, *args, **kwargs): # noqa: E501 diff --git a/sajari_client/model/schema_field_mode.py b/sajari_client/model/schema_field_mode.py index ced828e..3dc8c37 100644 --- a/sajari_client/model/schema_field_mode.py +++ b/sajari_client/model/schema_field_mode.py @@ -64,7 +64,7 @@ class SchemaFieldMode(ModelSimple): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -78,21 +78,15 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = {} _composed_schemas = None - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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): diff --git a/sajari_client/model/schema_field_type.py b/sajari_client/model/schema_field_type.py index 3950fd1..47b8b9d 100644 --- a/sajari_client/model/schema_field_type.py +++ b/sajari_client/model/schema_field_type.py @@ -67,7 +67,7 @@ class SchemaFieldType(ModelSimple): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -81,21 +81,15 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = {} _composed_schemas = None - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_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): diff --git a/sajari_client/model/send_event_request.py b/sajari_client/model/send_event_request.py index 1f210b8..e1d5b94 100644 --- a/sajari_client/model/send_event_request.py +++ b/sajari_client/model/send_event_request.py @@ -62,7 +62,7 @@ class SendEventRequest(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -80,7 +80,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -92,14 +92,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', + '_visited_composed_classes'} @convert_js_args_to_python_args def __init__(self, name, token, *args, **kwargs): # noqa: E501 diff --git a/sajari_client/model/set_default_version_request.py b/sajari_client/model/set_default_version_request.py index b96b978..91e0fef 100644 --- a/sajari_client/model/set_default_version_request.py +++ b/sajari_client/model/set_default_version_request.py @@ -62,7 +62,7 @@ class SetDefaultVersionRequest(ModelNormal): _nullable = False @cached_property - def openapi_types(): + def openapi_types(self): """ This must be a method because a model may have properties that are of type self, this must run after the class is loaded @@ -76,7 +76,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -85,14 +85,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', + '_visited_composed_classes'} @convert_js_args_to_python_args def __init__(self, version, *args, **kwargs): # noqa: E501 diff --git a/sajari_client/model/upsert_record_request_pipeline.py b/sajari_client/model/upsert_record_request_pipeline.py index 9f27f3a..4d0ca1f 100644 --- a/sajari_client/model/upsert_record_request_pipeline.py +++ b/sajari_client/model/upsert_record_request_pipeline.py @@ -77,7 +77,7 @@ def openapi_types(): } @cached_property - def discriminator(): + def discriminator(self): return None attribute_map = { @@ -87,14 +87,8 @@ def discriminator(): _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', + '_visited_composed_classes'} @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 From 7bd9bbb27e933ccd3f2a4da01b04f8862ff66730 Mon Sep 17 00:00:00 2001 From: Justin Koke Date: Thu, 16 Sep 2021 10:23:55 +1000 Subject: [PATCH 2/2] fix: running black across sdk --- sajari_client/__init__.py | 2 + sajari_client/api/collections_api.py | 663 ++++------ sajari_client/api/events_api.py | 113 +- sajari_client/api/pipelines_api.py | 1087 +++++++---------- sajari_client/api/records_api.py | 468 +++---- sajari_client/api/schema_api.py | 348 ++---- sajari_client/api_client.py | 639 +++++----- sajari_client/configuration.py | 244 ++-- sajari_client/exceptions.py | 16 +- .../batch_create_schema_fields_request.py | 46 +- .../batch_create_schema_fields_response.py | 70 +- ...tch_create_schema_fields_response_error.py | 50 +- .../model/batch_upsert_records_request.py | 66 +- .../batch_upsert_records_request_pipeline.py | 47 +- .../model/batch_upsert_records_response.py | 84 +- .../batch_upsert_records_response_error.py | 50 +- .../batch_upsert_records_response_key.py | 50 +- ...batch_upsert_records_response_variables.py | 49 +- sajari_client/model/collection.py | 59 +- sajari_client/model/delete_record_request.py | 46 +- sajari_client/model/error.py | 54 +- .../model/generate_pipelines_request.py | 47 +- .../model/generate_pipelines_response.py | 54 +- .../model/get_default_pipeline_response.py | 43 +- .../model/get_default_version_request_view.py | 43 +- .../model/get_pipeline_request_view.py | 43 +- sajari_client/model/get_record_request.py | 46 +- .../model/list_collections_response.py | 50 +- .../model/list_pipelines_request_view.py | 43 +- .../model/list_pipelines_response.py | 50 +- .../model/list_schema_fields_response.py | 54 +- sajari_client/model/percentile_data_point.py | 47 +- sajari_client/model/pipeline.py | 80 +- sajari_client/model/pipeline_step.py | 66 +- .../model/pipeline_step_param_binding.py | 55 +- sajari_client/model/pipeline_type.py | 43 +- sajari_client/model/protobuf_any.py | 47 +- sajari_client/model/protobuf_null_value.py | 39 +- sajari_client/model/query_aggregate_result.py | 108 +- .../model/query_aggregate_result_analysis.py | 67 +- .../model/query_aggregate_result_buckets.py | 54 +- .../query_aggregate_result_buckets_bucket.py | 47 +- .../model/query_aggregate_result_count.py | 43 +- .../model/query_aggregate_result_date.py | 43 +- .../model/query_aggregate_result_metric.py | 43 +- .../query_aggregate_result_percentile.py | 50 +- .../model/query_collection_request.py | 74 +- .../query_collection_request_pipeline.py | 47 +- .../query_collection_request_tracking.py | 70 +- .../query_collection_request_tracking_type.py | 45 +- .../model/query_collection_response.py | 84 +- .../query_collection_response_pipeline.py | 47 +- sajari_client/model/query_result.py | 60 +- sajari_client/model/query_result_token.py | 52 +- .../model/query_result_token_click.py | 43 +- .../model/query_result_token_pos_neg.py | 47 +- sajari_client/model/record_key.py | 47 +- sajari_client/model/schema_field.py | 68 +- sajari_client/model/schema_field_mode.py | 45 +- sajari_client/model/schema_field_type.py | 51 +- sajari_client/model/send_event_request.py | 73 +- .../model/set_default_pipeline_request.py | 50 +- .../model/set_default_version_request.py | 43 +- sajari_client/model/status.py | 54 +- sajari_client/model/upsert_record_request.py | 66 +- .../model/upsert_record_request_pipeline.py | 47 +- sajari_client/model/upsert_record_response.py | 52 +- sajari_client/model_utils.py | 638 +++++----- sajari_client/models/__init__.py | 1 - sajari_client/rest.py | 298 +++-- setup.py | 6 +- ...test_batch_create_schema_fields_request.py | 9 +- ...est_batch_create_schema_fields_response.py | 15 +- ...tch_create_schema_fields_response_error.py | 9 +- test/test_batch_upsert_records_request.py | 9 +- ...t_batch_upsert_records_request_pipeline.py | 6 +- test/test_batch_upsert_records_response.py | 21 +- ...est_batch_upsert_records_response_error.py | 9 +- .../test_batch_upsert_records_response_key.py | 9 +- ...batch_upsert_records_response_variables.py | 6 +- test/test_collection.py | 2 +- test/test_collections_api.py | 2 +- test/test_delete_record_request.py | 5 +- test/test_error.py | 5 +- test/test_events_api.py | 2 +- test/test_generate_pipelines_request.py | 2 +- test/test_generate_pipelines_response.py | 5 +- test/test_get_default_pipeline_response.py | 2 +- test/test_get_default_version_request_view.py | 6 +- test/test_get_pipeline_request_view.py | 2 +- test/test_get_record_request.py | 5 +- test/test_list_collections_response.py | 5 +- test/test_list_pipelines_request_view.py | 2 +- test/test_list_pipelines_response.py | 5 +- test/test_list_schema_fields_response.py | 5 +- test/test_percentile_data_point.py | 2 +- test/test_pipeline.py | 7 +- test/test_pipeline_step.py | 5 +- test/test_pipeline_step_param_binding.py | 2 +- test/test_pipeline_type.py | 2 +- test/test_pipelines_api.py | 2 +- test/test_protobuf_any.py | 2 +- test/test_protobuf_null_value.py | 2 +- test/test_query_aggregate_result.py | 27 +- test/test_query_aggregate_result_analysis.py | 6 +- test/test_query_aggregate_result_buckets.py | 13 +- ...t_query_aggregate_result_buckets_bucket.py | 6 +- test/test_query_aggregate_result_count.py | 2 +- test/test_query_aggregate_result_date.py | 2 +- test/test_query_aggregate_result_metric.py | 2 +- .../test_query_aggregate_result_percentile.py | 9 +- test/test_query_collection_request.py | 15 +- .../test_query_collection_request_pipeline.py | 6 +- .../test_query_collection_request_tracking.py | 13 +- ..._query_collection_request_tracking_type.py | 6 +- test/test_query_collection_response.py | 13 +- ...test_query_collection_response_pipeline.py | 6 +- test/test_query_result.py | 5 +- test/test_query_result_token.py | 7 +- test/test_query_result_token_click.py | 2 +- test/test_query_result_token_pos_neg.py | 2 +- test/test_record_key.py | 2 +- test/test_records_api.py | 2 +- test/test_schema_api.py | 2 +- test/test_schema_field.py | 7 +- test/test_schema_field_mode.py | 2 +- test/test_schema_field_type.py | 2 +- test/test_send_event_request.py | 2 +- test/test_set_default_pipeline_request.py | 5 +- test/test_set_default_version_request.py | 2 +- test/test_status.py | 5 +- test/test_upsert_record_request.py | 9 +- test/test_upsert_record_request_pipeline.py | 6 +- test/test_upsert_record_response.py | 5 +- 134 files changed, 4149 insertions(+), 3880 deletions(-) diff --git a/sajari_client/__init__.py b/sajari_client/__init__.py index cc7e621..7f4e47b 100644 --- a/sajari_client/__init__.py +++ b/sajari_client/__init__.py @@ -14,6 +14,7 @@ # import ApiClient from sajari_client.api_client import ApiClient + # import Configuration from sajari_client.configuration import Configuration from sajari_client.exceptions import ApiAttributeError @@ -21,5 +22,6 @@ from sajari_client.exceptions import ApiKeyError from sajari_client.exceptions import ApiTypeError from sajari_client.exceptions import ApiValueError + # import exceptions from sajari_client.exceptions import OpenApiException diff --git a/sajari_client/api/collections_api.py b/sajari_client/api/collections_api.py index c425108..c972c2c 100644 --- a/sajari_client/api/collections_api.py +++ b/sajari_client/api/collections_api.py @@ -23,7 +23,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -39,12 +39,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __create_collection( - self, - collection_id, - collection, - **kwargs - ): + def __create_collection(self, collection_id, collection, **kwargs): """Create collection # noqa: E501 Create an empty collection. Before records can be added to a collection, the schema and pipelines for the collection have to be set up. Consider setting up new collections via the Sajari Console, which handles the creation of the schema and pipelines for you. # noqa: E501 @@ -84,96 +79,66 @@ def __create_collection( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['collection'] = \ - collection + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["collection"] = collection return self.call_with_http_info(**kwargs) self.create_collection = _Endpoint( settings={ - 'response_type': (Collection,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections', - 'operation_id': 'create_collection', - 'http_method': 'POST', - 'servers': None, + "response_type": (Collection,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections", + "operation_id": "create_collection", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'collection', - ], - 'required': [ - 'collection_id', - 'collection', + "all": [ + "collection_id", + "collection", ], - 'nullable': [ + "required": [ + "collection_id", + "collection", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "collection": (Collection,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'collection': - (Collection,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "query", + "collection": "body", }, - 'location_map': { - 'collection_id': 'query', - 'collection': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__create_collection + callable=__create_collection, ) - def __delete_collection( - self, - collection_id, - **kwargs - ): + def __delete_collection(self, collection_id, **kwargs): """Delete collection # noqa: E501 Delete a collection and all of its associated data. > Note: This operation cannot be reversed. # noqa: E501 @@ -212,87 +177,71 @@ def __delete_collection( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id return self.call_with_http_info(**kwargs) self.delete_collection = _Endpoint( settings={ - 'response_type': (bool, date, datetime, dict, float, int, list, str, none_type,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}', - 'operation_id': 'delete_collection', - 'http_method': 'DELETE', - 'servers': None, + "response_type": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}", + "operation_id": "delete_collection", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', + "all": [ + "collection_id", ], - 'required': [ - 'collection_id', + "required": [ + "collection_id", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), }, - 'openapi_types': { - 'collection_id': - (str,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", }, - 'location_map': { - 'collection_id': 'path', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__delete_collection + callable=__delete_collection, ) - def __get_collection( - self, - collection_id, - **kwargs - ): + def __get_collection(self, collection_id, **kwargs): """Get collection # noqa: E501 Retrieve the details of a collection. # noqa: E501 @@ -331,86 +280,61 @@ def __get_collection( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id return self.call_with_http_info(**kwargs) self.get_collection = _Endpoint( settings={ - 'response_type': (Collection,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}', - 'operation_id': 'get_collection', - 'http_method': 'GET', - 'servers': None, + "response_type": (Collection,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}", + "operation_id": "get_collection", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - ], - 'required': [ - 'collection_id', + "all": [ + "collection_id", ], - 'nullable': [ + "required": [ + "collection_id", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), }, - 'openapi_types': { - 'collection_id': - (str,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", }, - 'location_map': { - 'collection_id': 'path', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__get_collection + callable=__get_collection, ) - def __list_collections( - self, - **kwargs - ): + def __list_collections(self, **kwargs): """List collections # noqa: E501 Retrieve a list of collections in the account. # noqa: E501 @@ -449,89 +373,62 @@ def __list_collections( 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['_host_index'] = kwargs.get('_host_index') + 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["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.list_collections = _Endpoint( settings={ - 'response_type': (ListCollectionsResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections', - 'operation_id': 'list_collections', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListCollectionsResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections", + "operation_id": "list_collections", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'page_size', - 'page_token', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": [ + "page_size", + "page_token", + ], + "required": [], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'page_size': - (int,), - 'page_token': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "page_size": (int,), + "page_token": (str,), }, - 'attribute_map': { - 'page_size': 'page_size', - 'page_token': 'page_token', + "attribute_map": { + "page_size": "page_size", + "page_token": "page_token", }, - 'location_map': { - 'page_size': 'query', - 'page_token': 'query', + "location_map": { + "page_size": "query", + "page_token": "query", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__list_collections + callable=__list_collections, ) - def __query_collection( - self, - collection_id, - query_collection_request, - **kwargs - ): + def __query_collection(self, collection_id, query_collection_request, **kwargs): """Query collection # noqa: E501 Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.sajari.com/user-guide/integrating-search/filters/) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) # noqa: E501 @@ -571,97 +468,66 @@ def __query_collection( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['query_collection_request'] = \ - query_collection_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["query_collection_request"] = query_collection_request return self.call_with_http_info(**kwargs) self.query_collection = _Endpoint( settings={ - 'response_type': (QueryCollectionResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}:queryCollection', - 'operation_id': 'query_collection', - 'http_method': 'POST', - 'servers': None, + "response_type": (QueryCollectionResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}:queryCollection", + "operation_id": "query_collection", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'query_collection_request', - ], - 'required': [ - 'collection_id', - 'query_collection_request', + "all": [ + "collection_id", + "query_collection_request", ], - 'nullable': [ + "required": [ + "collection_id", + "query_collection_request", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'collection_id': - (str,), - 'query_collection_request': - (QueryCollectionRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "query_collection_request": (QueryCollectionRequest,), }, - 'attribute_map': { - 'collection_id': 'collection_id', + "attribute_map": { + "collection_id": "collection_id", }, - 'location_map': { - 'collection_id': 'path', - 'query_collection_request': 'body', + "location_map": { + "collection_id": "path", + "query_collection_request": "body", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__query_collection + callable=__query_collection, ) - def __update_collection( - self, - collection_id, - collection, - **kwargs - ): + def __update_collection(self, collection_id, collection, **kwargs): """Update collection # noqa: E501 Update the details of a collection. # noqa: E501 @@ -702,92 +568,65 @@ def __update_collection( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['collection'] = \ - collection + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["collection"] = collection return self.call_with_http_info(**kwargs) self.update_collection = _Endpoint( settings={ - 'response_type': (Collection,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}', - 'operation_id': 'update_collection', - 'http_method': 'PATCH', - 'servers': None, + "response_type": (Collection,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}", + "operation_id": "update_collection", + "http_method": "PATCH", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'collection', - 'update_mask', - ], - 'required': [ - 'collection_id', - 'collection', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": [ + "collection_id", + "collection", + "update_mask", + ], + "required": [ + "collection_id", + "collection", + ], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "collection": (Collection,), + "update_mask": (str,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'collection': - (Collection,), - 'update_mask': - (str,), + "attribute_map": { + "collection_id": "collection_id", + "update_mask": "update_mask", }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'update_mask': 'update_mask', + "location_map": { + "collection_id": "path", + "collection": "body", + "update_mask": "query", }, - 'location_map': { - 'collection_id': 'path', - 'collection': 'body', - 'update_mask': 'query', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__update_collection + callable=__update_collection, ) diff --git a/sajari_client/api/events_api.py b/sajari_client/api/events_api.py index 15f8299..52dc87b 100644 --- a/sajari_client/api/events_api.py +++ b/sajari_client/api/events_api.py @@ -20,7 +20,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -36,11 +36,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __send_event( - self, - send_event_request, - **kwargs - ): + def __send_event(self, send_event_request, **kwargs): """Send event # noqa: E501 Send an event to the ranking system after a user interacts with a search result. When querying a collection, you can set the tracking type of the query request. When it is `CLICK` or `POS_NEG`, a token is generated for each result in the query response. You can use this token to provide feedback to the ranking system. Each time you want to record an event on a particular search result, use the send event call and provide: - The `name` of the event, e.g. `click`, `purchase`. - The `token` from the search result. - The `weight` to assign to the event, e.g. `1`. - An object containing any additional `metadata`. For example, to send an event where a customer purchased a product, use the following call: ```json { \"name\": \"purchase\", \"token\": \"eyJ...\", \"weight\": 1, \"metadata\": { \"discount\": 0.2, \"margin\": 30.0, \"customer_id\": \"12345\", \"ui_test_segment\": \"A\" } } ``` # noqa: E501 @@ -79,79 +75,68 @@ def __send_event( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - 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['_host_index'] = kwargs.get('_host_index') - kwargs['send_event_request'] = \ - send_event_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["send_event_request"] = send_event_request return self.call_with_http_info(**kwargs) self.send_event = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/events:sendEvent', - 'operation_id': 'send_event', - 'http_method': 'POST', - 'servers': None, + "response_type": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) + }, + ), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/events:sendEvent", + "operation_id": "send_event", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'send_event_request', + "all": [ + "send_event_request", ], - 'required': [ - 'send_event_request', + "required": [ + "send_event_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "send_event_request": (SendEventRequest,), }, - 'openapi_types': { - 'send_event_request': - (SendEventRequest,), + "attribute_map": {}, + "location_map": { + "send_event_request": "body", }, - 'attribute_map': { - }, - 'location_map': { - 'send_event_request': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__send_event + callable=__send_event, ) diff --git a/sajari_client/api/pipelines_api.py b/sajari_client/api/pipelines_api.py index 0c40033..7886315 100644 --- a/sajari_client/api/pipelines_api.py +++ b/sajari_client/api/pipelines_api.py @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -42,12 +42,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __create_pipeline( - self, - collection_id, - pipeline, - **kwargs - ): + def __create_pipeline(self, collection_id, pipeline, **kwargs): """Create pipeline # noqa: E501 Create a new pipeline. Pipelines are immutable once created. If you want to change a pipeline e.g. to add or change some steps, you need to create a new version of that pipeline. To start using a new pipeline you need to update your record ingestion calls and/or your query calls to specify the new pipeline. To create the pipeline from YAML, set the request's `Content-Type` header to `application/yaml` and submit the pipeline's YAML in the request body. # noqa: E501 @@ -87,98 +82,67 @@ def __create_pipeline( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['pipeline'] = \ - pipeline + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["pipeline"] = pipeline return self.call_with_http_info(**kwargs) self.create_pipeline = _Endpoint( settings={ - 'response_type': (Pipeline,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/pipelines', - 'operation_id': 'create_pipeline', - 'http_method': 'POST', - 'servers': None, + "response_type": (Pipeline,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/pipelines", + "operation_id": "create_pipeline", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'pipeline', - ], - 'required': [ - 'collection_id', - 'pipeline', + "all": [ + "collection_id", + "pipeline", ], - 'nullable': [ + "required": [ + "collection_id", + "pipeline", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "pipeline": (Pipeline,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'pipeline': - (Pipeline,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", + "pipeline": "body", }, - 'location_map': { - 'collection_id': 'path', - 'pipeline': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json', - 'application/yaml' - ], - 'content_type': [ - 'application/json', - 'application/yaml' - ] + "accept": ["application/json", "application/yaml"], + "content_type": ["application/json", "application/yaml"], }, api_client=api_client, - callable=__create_pipeline + callable=__create_pipeline, ) def __generate_pipelines( - self, - collection_id, - generate_pipelines_request, - **kwargs + self, collection_id, generate_pipelines_request, **kwargs ): """Generate pipelines # noqa: E501 @@ -219,97 +183,67 @@ def __generate_pipelines( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['generate_pipelines_request'] = \ - generate_pipelines_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["generate_pipelines_request"] = generate_pipelines_request return self.call_with_http_info(**kwargs) self.generate_pipelines = _Endpoint( settings={ - 'response_type': (GeneratePipelinesResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}:generatePipelines', - 'operation_id': 'generate_pipelines', - 'http_method': 'POST', - 'servers': None, + "response_type": (GeneratePipelinesResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}:generatePipelines", + "operation_id": "generate_pipelines", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'generate_pipelines_request', - ], - 'required': [ - 'collection_id', - 'generate_pipelines_request', + "all": [ + "collection_id", + "generate_pipelines_request", ], - 'nullable': [ + "required": [ + "collection_id", + "generate_pipelines_request", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'collection_id': - (str,), - 'generate_pipelines_request': - (GeneratePipelinesRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "generate_pipelines_request": (GeneratePipelinesRequest,), }, - 'attribute_map': { - 'collection_id': 'collection_id', + "attribute_map": { + "collection_id": "collection_id", }, - 'location_map': { - 'collection_id': 'path', - 'generate_pipelines_request': 'body', + "location_map": { + "collection_id": "path", + "generate_pipelines_request": "body", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json', - 'application/yaml' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json", "application/yaml"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__generate_pipelines + callable=__generate_pipelines, ) def __get_default_pipeline( - self, - collection_id, - type="TYPE_UNSPECIFIED", - **kwargs + self, collection_id, type="TYPE_UNSPECIFIED", **kwargs ): """Get default pipeline # noqa: E501 @@ -350,104 +284,75 @@ def __get_default_pipeline( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['type'] = \ - type + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["type"] = type return self.call_with_http_info(**kwargs) self.get_default_pipeline = _Endpoint( settings={ - 'response_type': (GetDefaultPipelineResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}:getDefaultPipeline', - 'operation_id': 'get_default_pipeline', - 'http_method': 'GET', - 'servers': None, + "response_type": (GetDefaultPipelineResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}:getDefaultPipeline", + "operation_id": "get_default_pipeline", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'type', - ], - 'required': [ - 'collection_id', - 'type', + "all": [ + "collection_id", + "type", ], - 'nullable': [ + "required": [ + "collection_id", + "type", ], - 'enum': [ - 'type', + "nullable": [], + "enum": [ + "type", ], - 'validation': [ - ] + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - ('type',): { - + "validations": {}, + "allowed_values": { + ("type",): { "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", "RECORD": "RECORD", - "QUERY": "QUERY" + "QUERY": "QUERY", }, }, - 'openapi_types': { - 'collection_id': - (str,), - 'type': - (str,), + "openapi_types": { + "collection_id": (str,), + "type": (str,), }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'type': 'type', + "attribute_map": { + "collection_id": "collection_id", + "type": "type", }, - 'location_map': { - 'collection_id': 'path', - 'type': 'query', + "location_map": { + "collection_id": "path", + "type": "query", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__get_default_pipeline + callable=__get_default_pipeline, ) - def __get_default_version( - self, - collection_id, - type, - name, - **kwargs - ): + def __get_default_version(self, collection_id, type, name, **kwargs): """Get default pipeline version # noqa: E501 Get the default version for a given pipeline. The default version of a pipeline is used when a pipeline is referred to without specifying a version. This allows you to change the pipeline version used for requests without having to change your code. To retrieve the pipeline in YAML, set the request's `Accept` header to `application/yaml`. # noqa: E501 @@ -489,126 +394,91 @@ def __get_default_version( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['type'] = \ - type - kwargs['name'] = \ - name + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["type"] = type + kwargs["name"] = name return self.call_with_http_info(**kwargs) self.get_default_version = _Endpoint( settings={ - 'response_type': (Pipeline,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/pipelines/{type}/{name}:getDefaultVersion', - 'operation_id': 'get_default_version', - 'http_method': 'GET', - 'servers': None, + "response_type": (Pipeline,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/pipelines/{type}/{name}:getDefaultVersion", + "operation_id": "get_default_version", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'type', - 'name', - 'view', + "all": [ + "collection_id", + "type", + "name", + "view", ], - 'required': [ - 'collection_id', - 'type', - 'name', + "required": [ + "collection_id", + "type", + "name", ], - 'nullable': [ + "nullable": [], + "enum": [ + "type", + "view", ], - 'enum': [ - 'type', - 'view', - ], - 'validation': [ - ] + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - ('type',): { - + "validations": {}, + "allowed_values": { + ("type",): { "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", "RECORD": "RECORD", - "QUERY": "QUERY" + "QUERY": "QUERY", }, - ('view',): { - + ("view",): { "VIEW_UNSPECIFIED": "VIEW_UNSPECIFIED", "BASIC": "BASIC", - "FULL": "FULL" + "FULL": "FULL", }, }, - 'openapi_types': { - 'collection_id': - (str,), - 'type': - (str,), - 'name': - (str,), - 'view': - (str,), + "openapi_types": { + "collection_id": (str,), + "type": (str,), + "name": (str,), + "view": (str,), }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'type': 'type', - 'name': 'name', - 'view': 'view', + "attribute_map": { + "collection_id": "collection_id", + "type": "type", + "name": "name", + "view": "view", }, - 'location_map': { - 'collection_id': 'path', - 'type': 'path', - 'name': 'path', - 'view': 'query', + "location_map": { + "collection_id": "path", + "type": "path", + "name": "path", + "view": "query", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json', - 'application/yaml' - ], - 'content_type': [], + "accept": ["application/json", "application/yaml"], + "content_type": [], }, api_client=api_client, - callable=__get_default_version + callable=__get_default_version, ) - def __get_pipeline( - self, - collection_id, - type, - name, - version, - **kwargs - ): + def __get_pipeline(self, collection_id, type, name, version, **kwargs): """Get pipeline # noqa: E501 Retrieve the details of a pipeline. Supply the type, name and version. To retrieve the pipeline in YAML, set the request's `Accept` header to `application/yaml`. # noqa: E501 @@ -651,131 +521,97 @@ def __get_pipeline( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['type'] = \ - type - kwargs['name'] = \ - name - kwargs['version'] = \ - version + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["type"] = type + kwargs["name"] = name + kwargs["version"] = version return self.call_with_http_info(**kwargs) self.get_pipeline = _Endpoint( settings={ - 'response_type': (Pipeline,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/pipelines/{type}/{name}/{version}', - 'operation_id': 'get_pipeline', - 'http_method': 'GET', - 'servers': None, + "response_type": (Pipeline,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/pipelines/{type}/{name}/{version}", + "operation_id": "get_pipeline", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'type', - 'name', - 'version', - 'view', - ], - 'required': [ - 'collection_id', - 'type', - 'name', - 'version', - ], - 'nullable': [ - ], - 'enum': [ - 'type', - 'view', - ], - 'validation': [ - ] + "all": [ + "collection_id", + "type", + "name", + "version", + "view", + ], + "required": [ + "collection_id", + "type", + "name", + "version", + ], + "nullable": [], + "enum": [ + "type", + "view", + ], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - ('type',): { - + "validations": {}, + "allowed_values": { + ("type",): { "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", "RECORD": "RECORD", - "QUERY": "QUERY" + "QUERY": "QUERY", }, - ('view',): { - + ("view",): { "VIEW_UNSPECIFIED": "VIEW_UNSPECIFIED", "BASIC": "BASIC", - "FULL": "FULL" + "FULL": "FULL", }, }, - 'openapi_types': { - 'collection_id': - (str,), - 'type': - (str,), - 'name': - (str,), - 'version': - (str,), - 'view': - (str,), - }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'type': 'type', - 'name': 'name', - 'version': 'version', - 'view': 'view', - }, - 'location_map': { - 'collection_id': 'path', - 'type': 'path', - 'name': 'path', - 'version': 'path', - 'view': 'query', - }, - 'collection_format_map': { - } + "openapi_types": { + "collection_id": (str,), + "type": (str,), + "name": (str,), + "version": (str,), + "view": (str,), + }, + "attribute_map": { + "collection_id": "collection_id", + "type": "type", + "name": "name", + "version": "version", + "view": "view", + }, + "location_map": { + "collection_id": "path", + "type": "path", + "name": "path", + "version": "path", + "view": "query", + }, + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json', - 'application/yaml' - ], - 'content_type': [], + "accept": ["application/json", "application/yaml"], + "content_type": [], }, api_client=api_client, - callable=__get_pipeline + callable=__get_pipeline, ) - def __list_pipelines( - self, - collection_id, - **kwargs - ): + def __list_pipelines(self, collection_id, **kwargs): """List pipelines # noqa: E501 Retrieve a list of pipelines. # noqa: E501 @@ -817,109 +653,82 @@ def __list_pipelines( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id return self.call_with_http_info(**kwargs) self.list_pipelines = _Endpoint( settings={ - 'response_type': (ListPipelinesResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/pipelines', - 'operation_id': 'list_pipelines', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListPipelinesResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/pipelines", + "operation_id": "list_pipelines", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'page_size', - 'page_token', - 'view', + "all": [ + "collection_id", + "page_size", + "page_token", + "view", ], - 'required': [ - 'collection_id', + "required": [ + "collection_id", ], - 'nullable': [ + "nullable": [], + "enum": [ + "view", ], - 'enum': [ - 'view', - ], - 'validation': [ - ] + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - ('view',): { - + "validations": {}, + "allowed_values": { + ("view",): { "VIEW_UNSPECIFIED": "VIEW_UNSPECIFIED", "BASIC": "BASIC", - "FULL": "FULL" + "FULL": "FULL", }, }, - 'openapi_types': { - 'collection_id': - (str,), - 'page_size': - (int,), - 'page_token': - (str,), - 'view': - (str,), + "openapi_types": { + "collection_id": (str,), + "page_size": (int,), + "page_token": (str,), + "view": (str,), }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'page_size': 'page_size', - 'page_token': 'page_token', - 'view': 'view', + "attribute_map": { + "collection_id": "collection_id", + "page_size": "page_size", + "page_token": "page_token", + "view": "view", }, - 'location_map': { - 'collection_id': 'path', - 'page_size': 'query', - 'page_token': 'query', - 'view': 'query', + "location_map": { + "collection_id": "path", + "page_size": "query", + "page_token": "query", + "view": "query", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__list_pipelines + callable=__list_pipelines, ) def __set_default_pipeline( - self, - collection_id, - set_default_pipeline_request, - **kwargs + self, collection_id, set_default_pipeline_request, **kwargs ): """Set default pipeline # noqa: E501 @@ -960,98 +769,81 @@ def __set_default_pipeline( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['set_default_pipeline_request'] = \ - set_default_pipeline_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["set_default_pipeline_request"] = set_default_pipeline_request return self.call_with_http_info(**kwargs) self.set_default_pipeline = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}:setDefaultPipeline', - 'operation_id': 'set_default_pipeline', - 'http_method': 'POST', - 'servers': None, + "response_type": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) + }, + ), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}:setDefaultPipeline", + "operation_id": "set_default_pipeline", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'set_default_pipeline_request', - ], - 'required': [ - 'collection_id', - 'set_default_pipeline_request', + "all": [ + "collection_id", + "set_default_pipeline_request", ], - 'nullable': [ + "required": [ + "collection_id", + "set_default_pipeline_request", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'collection_id': - (str,), - 'set_default_pipeline_request': - (SetDefaultPipelineRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "set_default_pipeline_request": (SetDefaultPipelineRequest,), }, - 'attribute_map': { - 'collection_id': 'collection_id', + "attribute_map": { + "collection_id": "collection_id", }, - 'location_map': { - 'collection_id': 'path', - 'set_default_pipeline_request': 'body', + "location_map": { + "collection_id": "path", + "set_default_pipeline_request": "body", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__set_default_pipeline + callable=__set_default_pipeline, ) def __set_default_version( - self, - collection_id, - type, - name, - set_default_version_request, - **kwargs + self, collection_id, type, name, set_default_version_request, **kwargs ): """Set default pipeline version # noqa: E501 @@ -1094,110 +886,95 @@ def __set_default_version( 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['type'] = \ - type - kwargs['name'] = \ - name - kwargs['set_default_version_request'] = \ - set_default_version_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["type"] = type + kwargs["name"] = name + kwargs["set_default_version_request"] = set_default_version_request return self.call_with_http_info(**kwargs) self.set_default_version = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/pipelines/{type}/{name}:setDefaultVersion', - 'operation_id': 'set_default_version', - 'http_method': 'POST', - 'servers': None, + "response_type": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) + }, + ), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/pipelines/{type}/{name}:setDefaultVersion", + "operation_id": "set_default_version", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'type', - 'name', - 'set_default_version_request', - ], - 'required': [ - 'collection_id', - 'type', - 'name', - 'set_default_version_request', + "all": [ + "collection_id", + "type", + "name", + "set_default_version_request", ], - 'nullable': [ + "required": [ + "collection_id", + "type", + "name", + "set_default_version_request", ], - 'enum': [ - 'type', + "nullable": [], + "enum": [ + "type", ], - 'validation': [ - ] + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - ('type',): { - + "validations": {}, + "allowed_values": { + ("type",): { "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", "RECORD": "RECORD", - "QUERY": "QUERY" + "QUERY": "QUERY", }, }, - 'openapi_types': { - 'collection_id': - (str,), - 'type': - (str,), - 'name': - (str,), - 'set_default_version_request': - (SetDefaultVersionRequest,), + "openapi_types": { + "collection_id": (str,), + "type": (str,), + "name": (str,), + "set_default_version_request": (SetDefaultVersionRequest,), }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'type': 'type', - 'name': 'name', + "attribute_map": { + "collection_id": "collection_id", + "type": "type", + "name": "name", }, - 'location_map': { - 'collection_id': 'path', - 'type': 'path', - 'name': 'path', - 'set_default_version_request': 'body', + "location_map": { + "collection_id": "path", + "type": "path", + "name": "path", + "set_default_version_request": "body", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__set_default_version + callable=__set_default_version, ) diff --git a/sajari_client/api/records_api.py b/sajari_client/api/records_api.py index 3629cf0..9a4f87e 100644 --- a/sajari_client/api/records_api.py +++ b/sajari_client/api/records_api.py @@ -25,7 +25,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -42,10 +42,7 @@ def __init__(self, api_client=None): self.api_client = api_client def __batch_upsert_records( - self, - collection_id, - batch_upsert_records_request, - **kwargs + self, collection_id, batch_upsert_records_request, **kwargs ): """Batch upsert records # noqa: E501 @@ -86,97 +83,66 @@ def __batch_upsert_records( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['batch_upsert_records_request'] = \ - batch_upsert_records_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["batch_upsert_records_request"] = batch_upsert_records_request return self.call_with_http_info(**kwargs) self.batch_upsert_records = _Endpoint( settings={ - 'response_type': (BatchUpsertRecordsResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/records:batchUpsert', - 'operation_id': 'batch_upsert_records', - 'http_method': 'POST', - 'servers': None, + "response_type": (BatchUpsertRecordsResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/records:batchUpsert", + "operation_id": "batch_upsert_records", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'batch_upsert_records_request', + "all": [ + "collection_id", + "batch_upsert_records_request", ], - 'required': [ - 'collection_id', - 'batch_upsert_records_request', + "required": [ + "collection_id", + "batch_upsert_records_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "batch_upsert_records_request": (BatchUpsertRecordsRequest,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'batch_upsert_records_request': - (BatchUpsertRecordsRequest,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", + "batch_upsert_records_request": "body", }, - 'location_map': { - 'collection_id': 'path', - 'batch_upsert_records_request': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__batch_upsert_records + callable=__batch_upsert_records, ) - def __delete_record( - self, - collection_id, - delete_record_request, - **kwargs - ): + def __delete_record(self, collection_id, delete_record_request, **kwargs): """Delete record # noqa: E501 Delete a record with the given key. # noqa: E501 @@ -216,97 +182,76 @@ def __delete_record( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['delete_record_request'] = \ - delete_record_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["delete_record_request"] = delete_record_request return self.call_with_http_info(**kwargs) self.delete_record = _Endpoint( settings={ - 'response_type': (bool, date, datetime, dict, float, int, list, str, none_type,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/records:delete', - 'operation_id': 'delete_record', - 'http_method': 'POST', - 'servers': None, + "response_type": ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/records:delete", + "operation_id": "delete_record", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'delete_record_request', + "all": [ + "collection_id", + "delete_record_request", ], - 'required': [ - 'collection_id', - 'delete_record_request', + "required": [ + "collection_id", + "delete_record_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "delete_record_request": (DeleteRecordRequest,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'delete_record_request': - (DeleteRecordRequest,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", + "delete_record_request": "body", }, - 'location_map': { - 'collection_id': 'path', - 'delete_record_request': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__delete_record + callable=__delete_record, ) - def __get_record( - self, - collection_id, - get_record_request, - **kwargs - ): + def __get_record(self, collection_id, get_record_request, **kwargs): """Get record # noqa: E501 Retrieve a record with the given key. # noqa: E501 @@ -346,97 +291,80 @@ def __get_record( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['get_record_request'] = \ - get_record_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["get_record_request"] = get_record_request return self.call_with_http_info(**kwargs) self.get_record = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/records:get', - 'operation_id': 'get_record', - 'http_method': 'POST', - 'servers': None, + "response_type": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) + }, + ), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/records:get", + "operation_id": "get_record", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'get_record_request', + "all": [ + "collection_id", + "get_record_request", ], - 'required': [ - 'collection_id', - 'get_record_request', + "required": [ + "collection_id", + "get_record_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "get_record_request": (GetRecordRequest,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'get_record_request': - (GetRecordRequest,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", + "get_record_request": "body", }, - 'location_map': { - 'collection_id': 'path', - 'get_record_request': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__get_record + callable=__get_record, ) - def __upsert_record( - self, - collection_id, - upsert_record_request, - **kwargs - ): + def __upsert_record(self, collection_id, upsert_record_request, **kwargs): """Upsert record # noqa: E501 If the record does not exist in your collection it is inserted. If it does exist it is updated. If no pipeline is specified, the default record pipeline is used to process the record. If the record is inserted, the response contains the key of the inserted record. You can use this if you need to retrieve or delete the record. If the record is updated, the response does not contain a key. Callers can use this as a signal to determine if the record is inserted/created or updated. For example, to add a single product from your ecommerce store to a collection, use the following call: ```json { \"pipeline\": { \"name\": \"my-pipeline\", \"version\": \"1\" }, \"record\": { \"id\": \"54hdc7h2334h\", \"name\": \"Smart TV\", \"price\": 1999, \"brand\": \"Acme\", \"description\": \"...\", \"in_stock\": true } } ``` # noqa: E501 @@ -476,87 +404,61 @@ def __upsert_record( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['upsert_record_request'] = \ - upsert_record_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["upsert_record_request"] = upsert_record_request return self.call_with_http_info(**kwargs) self.upsert_record = _Endpoint( settings={ - 'response_type': (UpsertRecordResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/records:upsert', - 'operation_id': 'upsert_record', - 'http_method': 'POST', - 'servers': None, + "response_type": (UpsertRecordResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/records:upsert", + "operation_id": "upsert_record", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'upsert_record_request', + "all": [ + "collection_id", + "upsert_record_request", ], - 'required': [ - 'collection_id', - 'upsert_record_request', + "required": [ + "collection_id", + "upsert_record_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "upsert_record_request": (UpsertRecordRequest,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'upsert_record_request': - (UpsertRecordRequest,), + "attribute_map": { + "collection_id": "collection_id", }, - 'attribute_map': { - 'collection_id': 'collection_id', + "location_map": { + "collection_id": "path", + "upsert_record_request": "body", }, - 'location_map': { - 'collection_id': 'path', - 'upsert_record_request': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__upsert_record + callable=__upsert_record, ) diff --git a/sajari_client/api/schema_api.py b/sajari_client/api/schema_api.py index eed86e7..a8825fb 100644 --- a/sajari_client/api/schema_api.py +++ b/sajari_client/api/schema_api.py @@ -12,8 +12,12 @@ import sys # noqa: F401 from sajari_client.api_client import ApiClient, Endpoint as _Endpoint -from sajari_client.model.batch_create_schema_fields_request import BatchCreateSchemaFieldsRequest -from sajari_client.model.batch_create_schema_fields_response import BatchCreateSchemaFieldsResponse +from sajari_client.model.batch_create_schema_fields_request import ( + BatchCreateSchemaFieldsRequest, +) +from sajari_client.model.batch_create_schema_fields_response import ( + BatchCreateSchemaFieldsResponse, +) from sajari_client.model.list_schema_fields_response import ListSchemaFieldsResponse from sajari_client.model.schema_field import SchemaField from sajari_client.model_utils import ( # noqa: F401 @@ -23,7 +27,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -40,10 +44,7 @@ def __init__(self, api_client=None): self.api_client = api_client def __batch_create_schema_fields( - self, - collection_id, - batch_create_schema_fields_request, - **kwargs + self, collection_id, batch_create_schema_fields_request, **kwargs ): """Batch create schema fields # noqa: E501 @@ -84,97 +85,70 @@ def __batch_create_schema_fields( 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["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['batch_create_schema_fields_request'] = \ - batch_create_schema_fields_request + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs[ + "batch_create_schema_fields_request" + ] = batch_create_schema_fields_request return self.call_with_http_info(**kwargs) self.batch_create_schema_fields = _Endpoint( settings={ - 'response_type': (BatchCreateSchemaFieldsResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/schemaFields:batchCreate', - 'operation_id': 'batch_create_schema_fields', - 'http_method': 'POST', - 'servers': None, + "response_type": (BatchCreateSchemaFieldsResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/schemaFields:batchCreate", + "operation_id": "batch_create_schema_fields", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'batch_create_schema_fields_request', - ], - 'required': [ - 'collection_id', - 'batch_create_schema_fields_request', - ], - 'nullable': [ + "all": [ + "collection_id", + "batch_create_schema_fields_request", ], - 'enum': [ + "required": [ + "collection_id", + "batch_create_schema_fields_request", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "batch_create_schema_fields_request": ( + BatchCreateSchemaFieldsRequest, + ), }, - 'allowed_values': { + "attribute_map": { + "collection_id": "collection_id", }, - 'openapi_types': { - 'collection_id': - (str,), - 'batch_create_schema_fields_request': - (BatchCreateSchemaFieldsRequest,), + "location_map": { + "collection_id": "path", + "batch_create_schema_fields_request": "body", }, - 'attribute_map': { - 'collection_id': 'collection_id', - }, - 'location_map': { - 'collection_id': 'path', - 'batch_create_schema_fields_request': 'body', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__batch_create_schema_fields + callable=__batch_create_schema_fields, ) - def __create_schema_field( - self, - collection_id, - schema_field, - **kwargs - ): + def __create_schema_field(self, collection_id, schema_field, **kwargs): """Create schema field # noqa: E501 Create a new field in your collection's schema. # noqa: E501 @@ -214,96 +188,66 @@ def __create_schema_field( 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["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", True ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id - kwargs['schema_field'] = \ - schema_field + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id + kwargs["schema_field"] = schema_field return self.call_with_http_info(**kwargs) self.create_schema_field = _Endpoint( settings={ - 'response_type': (SchemaField,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/schemaFields', - 'operation_id': 'create_schema_field', - 'http_method': 'POST', - 'servers': None, + "response_type": (SchemaField,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/schemaFields", + "operation_id": "create_schema_field", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'schema_field', - ], - 'required': [ - 'collection_id', - 'schema_field', - ], - 'nullable': [ + "all": [ + "collection_id", + "schema_field", ], - 'enum': [ + "required": [ + "collection_id", + "schema_field", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'collection_id': - (str,), - 'schema_field': - (SchemaField,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "schema_field": (SchemaField,), }, - 'attribute_map': { - 'collection_id': 'collection_id', + "attribute_map": { + "collection_id": "collection_id", }, - 'location_map': { - 'collection_id': 'path', - 'schema_field': 'body', + "location_map": { + "collection_id": "path", + "schema_field": "body", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "accept": ["application/json"], + "content_type": ["application/json"], }, api_client=api_client, - callable=__create_schema_field + callable=__create_schema_field, ) - def __list_schema_fields( - self, - collection_id, - **kwargs - ): + def __list_schema_fields(self, collection_id, **kwargs): """List schema fields # noqa: E501 Retrieve a list of schema fields in the collection. # noqa: E501 @@ -344,88 +288,64 @@ def __list_schema_fields( 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["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get( + "_return_http_data_only", 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['_host_index'] = kwargs.get('_host_index') - kwargs['collection_id'] = \ - collection_id + 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["_host_index"] = kwargs.get("_host_index") + kwargs["collection_id"] = collection_id return self.call_with_http_info(**kwargs) self.list_schema_fields = _Endpoint( settings={ - 'response_type': (ListSchemaFieldsResponse,), - 'auth': [ - 'BasicAuth' - ], - 'endpoint_path': '/v4/collections/{collection_id}/schemaFields', - 'operation_id': 'list_schema_fields', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListSchemaFieldsResponse,), + "auth": ["BasicAuth"], + "endpoint_path": "/v4/collections/{collection_id}/schemaFields", + "operation_id": "list_schema_fields", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'collection_id', - 'page_size', - 'page_token', - ], - 'required': [ - 'collection_id', + "all": [ + "collection_id", + "page_size", + "page_token", ], - 'nullable': [ + "required": [ + "collection_id", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_id": (str,), + "page_size": (int,), + "page_token": (str,), }, - 'openapi_types': { - 'collection_id': - (str,), - 'page_size': - (int,), - 'page_token': - (str,), + "attribute_map": { + "collection_id": "collection_id", + "page_size": "page_size", + "page_token": "page_token", }, - 'attribute_map': { - 'collection_id': 'collection_id', - 'page_size': 'page_size', - 'page_token': 'page_token', + "location_map": { + "collection_id": "path", + "page_size": "query", + "page_token": "query", }, - 'location_map': { - 'collection_id': 'path', - 'page_size': 'query', - 'page_token': 'query', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__list_schema_fields + callable=__list_schema_fields, ) diff --git a/sajari_client/api_client.py b/sajari_client/api_client.py index 2264fc5..08e9673 100644 --- a/sajari_client/api_client.py +++ b/sajari_client/api_client.py @@ -35,7 +35,7 @@ file_type, model_to_dict, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -63,8 +63,14 @@ class ApiClient(object): _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None, + pool_threads=1, + ): if configuration is None: configuration = Configuration.get_default_copy() self.configuration = configuration @@ -76,7 +82,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'sajari-sdk-python-4.1.0' + self.user_agent = "sajari-sdk-python-4.1.0" def __enter__(self): return self @@ -89,13 +95,13 @@ def close(self): self._pool.close() self._pool.join() self._pool = None - if hasattr(atexit, 'unregister'): + if hasattr(atexit, "unregister"): atexit.unregister(self.close) @property def pool(self): """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. + avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: atexit.register(self.close) @@ -105,33 +111,35 @@ def pool(self): @property def user_agent(self): """User agent for this API client""" - return self.default_headers['User-Agent'] + return self.default_headers["User-Agent"] @user_agent.setter def user_agent(self, value): - self.default_headers['User-Agent'] = value + self.default_headers["User-Agent"] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value def __call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[ + typing.List[typing.Tuple[str, typing.Any]] + ] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None, ): config = self.configuration @@ -140,48 +148,45 @@ def __call_api( header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params['Cookie'] = self.cookie + header_params["Cookie"] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples(path_params, collection_formats) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) + "{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param) ) # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) + query_params = self.parameters_to_tuples(query_params, collection_formats) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples(post_params, collection_formats) post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict)) + if header_params["Content-Type"].startswith("multipart"): + post_params = self.parameters_to_multipart(post_params, (dict)) # body if body: body = self.sanitize_for_serialization(body) # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + self.update_params_for_auth( + header_params, query_params, auth_settings, resource_path, method, body + ) # request url if _host is None: @@ -193,12 +198,17 @@ def __call_api( try: # perform request and return response response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, + method, + url, + query_params=query_params, + headers=header_params, + post_params=post_params, + body=body, _preload_content=_preload_content, - _request_timeout=_request_timeout) + _request_timeout=_request_timeout, + ) except ApiException as e: - e.body = e.body.decode('utf-8') + e.body = e.body.decode("utf-8") raise e self.last_response = response_data @@ -206,33 +216,28 @@ def __call_api( return_data = response_data if not _preload_content: - return (return_data) + return return_data return return_data # deserialize response data if response_type: if response_type != (file_type,): encoding = "utf-8" - content_type = response_data.getheader('content-type') + content_type = response_data.getheader("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) if match: encoding = match.group(1) response_data.data = response_data.data.decode(encoding) - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) + return_data = self.deserialize(response_data, response_type, _check_type) else: return_data = None if _return_http_data_only: - return (return_data) + return return_data else: - return (return_data, response_data.status, - response_data.getheaders()) + return (return_data, response_data.status, response_data.getheaders()) def parameters_to_multipart(self, params, collection_types): """Get parameters as list of tuples, formatting as json if value is collection_types @@ -243,9 +248,13 @@ def parameters_to_multipart(self, params, collection_types): """ new_params = [] if collection_types is None: - collection_types = (dict) - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json + collection_types = dict + for k, v in ( + params.items() if isinstance(params, dict) else params + ): # noqa: E501 + if isinstance( + v, collection_types + ): # v is instance of collection_type, formatting as application/json v = json.dumps(v, ensure_ascii=False).encode("utf-8") field = RequestField(k, v) field.make_multipart(content_type="application/json; charset=utf-8") @@ -270,7 +279,8 @@ def sanitize_for_serialization(cls, obj): """ if isinstance(obj, (ModelNormal, ModelComposed)): return { - key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() + key: cls.sanitize_for_serialization(val) + for key, val in model_to_dict(obj, serialize=True).items() } elif isinstance(obj, io.IOBase): return cls.get_file_data_and_close_file(obj) @@ -283,8 +293,12 @@ def sanitize_for_serialization(cls, obj): elif isinstance(obj, (list, tuple)): return [cls.sanitize_for_serialization(item) for item in obj] if isinstance(obj, dict): - return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + return { + key: cls.sanitize_for_serialization(val) for key, val in obj.items() + } + raise ApiValueError( + "Unable to prepare type {} for serialization".format(obj.__class__.__name__) + ) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -310,8 +324,11 @@ def deserialize(self, response, response_type, _check_type): # save response body into a tmp file and return the instance if response_type == (file_type,): content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) + return deserialize_file( + response.data, + self.configuration, + content_disposition=content_disposition, + ) # fetch data from response object try: @@ -324,32 +341,34 @@ def deserialize(self, response, response_type, _check_type): deserialized_data = validate_and_convert_types( received_data, response_type, - ['received_data'], + ["received_data"], True, _check_type, - configuration=self.configuration + configuration=self.configuration, ) return deserialized_data def call_api( - self, - resource_path: str, - method: str, - path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, - body: typing.Optional[typing.Any] = None, - post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, - files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, - response_type: typing.Optional[typing.Tuple[typing.Any]] = None, - auth_settings: typing.Optional[typing.List[str]] = None, - async_req: typing.Optional[bool] = None, - _return_http_data_only: typing.Optional[bool] = None, - collection_formats: typing.Optional[typing.Dict[str, str]] = None, - _preload_content: bool = True, - _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, - _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + self, + resource_path: str, + method: str, + path_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + query_params: typing.Optional[ + typing.List[typing.Tuple[str, typing.Any]] + ] = None, + header_params: typing.Optional[typing.Dict[str, typing.Any]] = None, + body: typing.Optional[typing.Any] = None, + post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None, + files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None, + response_type: typing.Optional[typing.Tuple[typing.Any]] = None, + auth_settings: typing.Optional[typing.List[str]] = None, + async_req: typing.Optional[bool] = None, + _return_http_data_only: typing.Optional[bool] = None, + collection_formats: typing.Optional[typing.Dict[str, str]] = None, + _preload_content: bool = True, + _request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None, + _host: typing.Optional[str] = None, + _check_type: typing.Optional[bool] = None, ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -405,82 +424,124 @@ def call_api( then the method will return the response directly. """ if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): + return self.__call_api( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _check_type, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _check_type, + ), + ) + + def request( + self, + method, + url, + query_params=None, + headers=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): """Makes the HTTP request using RESTClient.""" if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) + return self.rest_client.GET( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) + return self.rest_client.HEAD( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.OPTIONS( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.POST( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.PUT( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.PATCH( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.DELETE( + url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) else: raise ApiValueError( "http method must be `GET`, `HEAD`, `OPTIONS`," @@ -497,22 +558,23 @@ def parameters_to_tuples(self, params, collection_formats): new_params = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in ( + params.items() if isinstance(params, dict) else params + ): # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, value) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -523,7 +585,9 @@ def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: file_instance.close() return file_data - def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None): + def files_parameters( + self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None + ): """Builds form parameters. :param files: None or a dict with key=param_name and @@ -549,10 +613,12 @@ def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[i ) filename = os.path.basename(file_instance.name) filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') + mimetype = ( + mimetypes.guess_type(filename)[0] or "application/octet-stream" + ) params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + tuple([param_name, tuple([filename, filedata, mimetype])]) + ) return params @@ -567,10 +633,10 @@ def select_header_accept(self, accepts): accepts = [x.lower() for x in accepts] - if 'application/json' in accepts: - return 'application/json' + if "application/json" in accepts: + return "application/json" else: - return ', '.join(accepts) + return ", ".join(accepts) def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. @@ -579,17 +645,18 @@ def select_header_content_type(self, content_types): :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return "application/json" content_types = [x.lower() for x in content_types] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' + if "application/json" in content_types or "*/*" in content_types: + return "application/json" else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings, - resource_path, method, body): + def update_params_for_auth( + self, headers, querys, auth_settings, resource_path, method, body + ): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -606,22 +673,29 @@ def update_params_for_auth(self, headers, querys, auth_settings, for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + querys.append((auth_setting["key"], auth_setting["value"])) else: raise ApiValueError( - 'Authentication token must be in `query` or `header`' + "Authentication token must be in `query` or `header`" ) class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): + def __init__( + self, + settings=None, + params_map=None, + root_map=None, + headers_map=None, + api_client=None, + callable=None, + ): """Creates an endpoint Args: @@ -657,55 +731,53 @@ def __init__(self, settings=None, params_map=None, root_map=None, """ self.settings = settings self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] + self.params_map["all"].extend( + [ + "async_req", + "_host_index", + "_preload_content", + "_request_timeout", + "_return_http_data_only", + "_check_input_type", + "_check_return_type", + ] + ) + self.params_map["nullable"].extend(["_request_timeout"]) + self.validations = root_map["validations"] + self.allowed_values = root_map["allowed_values"] + self.openapi_types = root_map["openapi_types"] extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) + "async_req": (bool,), + "_host_index": (none_type, int), + "_preload_content": (bool,), + "_request_timeout": (none_type, int, (int,), [int]), + "_return_http_data_only": (bool,), + "_check_input_type": (bool,), + "_check_return_type": (bool,), } self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] + self.attribute_map = root_map["attribute_map"] + self.location_map = root_map["location_map"] + self.collection_format_map = root_map["collection_format_map"] self.headers_map = headers_map self.api_client = api_client self.callable = callable def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: + for param in self.params_map["enum"]: if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + check_allowed_values(self.allowed_values, (param,), kwargs[param]) - for param in self.params_map['validation']: + for param in self.params_map["validation"]: if param in kwargs: check_validations( self.validations, (param,), kwargs[param], - configuration=self.api_client.configuration + configuration=self.api_client.configuration, ) - if kwargs['_check_input_type'] is False: + if kwargs["_check_input_type"] is False: return for key, value in kwargs.items(): @@ -714,20 +786,20 @@ def __validate_inputs(self, kwargs): self.openapi_types[key], [key], False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration + kwargs["_check_input_type"], + configuration=self.api_client.configuration, ) kwargs[key] = fixed_val def __gather_params(self, kwargs): params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] + "body": None, + "collection_format": {}, + "file": {}, + "form": [], + "header": {}, + "path": {}, + "query": [], } for param_name, param_value in kwargs.items(): @@ -735,30 +807,32 @@ def __gather_params(self, kwargs): if param_location is None: continue if param_location: - if param_location == 'body': - params['body'] = param_value + if param_location == "body": + params["body"] = param_value continue base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): + if param_location == "form" and self.openapi_types[param_name] == ( + file_type, + ): + params["file"][param_name] = [param_value] + elif param_location == "form" and self.openapi_types[param_name] == ( + [file_type], + ): # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: + params["file"][param_name] = param_value + elif param_location in {"form", "query"}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: + if param_location not in {"form", "query"}: params[param_location][base_name] = param_value collection_format = self.collection_format_map.get(param_name) if collection_format: - params['collection_format'][base_name] = collection_format + params["collection_format"][base_name] = collection_format return params def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called + """This method is invoked when endpoints are called Example: api_instance = CollectionsApi() @@ -773,77 +847,90 @@ def __call__(self, *args, **kwargs): def call_with_http_info(self, **kwargs): try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] - server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables + index = ( + self.api_client.configuration.server_operation_index.get( + self.settings["operation_id"], + self.api_client.configuration.server_index, + ) + if kwargs["_host_index"] is None + else kwargs["_host_index"] + ) + server_variables = ( + self.api_client.configuration.server_operation_variables.get( + self.settings["operation_id"], + self.api_client.configuration.server_variables, + ) ) _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + index, variables=server_variables, servers=self.settings["servers"] ) except IndexError: - if self.settings['servers']: + if self.settings["servers"]: raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) + "Invalid host index. Must be 0 <= index < %s" + % len(self.settings["servers"]) ) _host = None for key, value in kwargs.items(): - if key not in self.params_map['all']: + if key not in self.params_map["all"]: raise ApiTypeError( "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) + " to method `%s`" % (key, self.settings["operation_id"]) ) # only throw this nullable ApiValueError if _check_input_type # is False, if _check_input_type==True we catch this case # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): + if ( + key not in self.params_map["nullable"] + and value is None + and kwargs["_check_input_type"] is False + ): raise ApiValueError( "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) + " when calling `%s`" % (key, self.settings["operation_id"]) ) - for key in self.params_map['required']: + for key in self.params_map["required"]: if key not in kwargs.keys(): raise ApiValueError( "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) + "`%s`" % (key, self.settings["operation_id"]) ) self.__validate_inputs(kwargs) params = self.__gather_params(kwargs) - accept_headers_list = self.headers_map['accept'] + accept_headers_list = self.headers_map["accept"] if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + params["header"]["Accept"] = self.api_client.select_header_accept( + accept_headers_list + ) - content_type_headers_list = self.headers_map['content_type'] + content_type_headers_list = self.headers_map["content_type"] if content_type_headers_list: header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + content_type_headers_list + ) + params["header"]["Content-Type"] = header_list return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], + self.settings["endpoint_path"], + self.settings["http_method"], + params["path"], + params["query"], + params["header"], + body=params["body"], + post_params=params["form"], + files=params["file"], + response_type=self.settings["response_type"], + auth_settings=self.settings["auth"], + async_req=kwargs["async_req"], + _check_type=kwargs["_check_return_type"], + _return_http_data_only=kwargs["_return_http_data_only"], + _preload_content=kwargs["_preload_content"], + _request_timeout=kwargs["_request_timeout"], _host=_host, - collection_formats=params['collection_format']) + collection_formats=params["collection_format"], + ) diff --git a/sajari_client/configuration.py b/sajari_client/configuration.py index 8ba8f90..76e7873 100644 --- a/sajari_client/configuration.py +++ b/sajari_client/configuration.py @@ -19,97 +19,109 @@ from sajari_client.exceptions import ApiValueError JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", } class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - HTTP Basic Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - http_basic_auth: - type: http - scheme: basic - - Configure API client with HTTP basic authentication: - -conf = sajari_client.Configuration( - username='the-user', - password='the-password', -) + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + + conf = sajari_client.Configuration( + username='the-user', + password='the-password', + ) """ _default = None - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ + def __init__( + self, + host=None, + api_key=None, + api_key_prefix=None, + access_token=None, + username=None, + password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, + server_variables=None, + server_operation_index=None, + server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor""" self._base_path = "https://api-gateway.sajari.com" if host is None else host """Default Base url """ @@ -152,7 +164,7 @@ def __init__(self, host=None, """ self.logger["package_logger"] = logging.getLogger("sajari_client") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' + self.logger_format = "%(asctime)s %(levelname)s %(message)s" """Log format """ self.logger_stream_handler = None @@ -200,7 +212,7 @@ def __init__(self, host=None, self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = "" """Safe chars for path_param """ self.retries = None @@ -217,7 +229,7 @@ def __deepcopy__(self, memo): result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): + if k not in ("logger", "logger_file_handler"): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) @@ -228,12 +240,11 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) + if name == "disabled_client_side_validations": + s = set(filter(None, value.split(","))) for v in s: if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) + raise ApiValueError("Invalid keyword: '{0}''".format(v)) self._disabled_client_side_validations = s @classmethod @@ -355,7 +366,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): """ if self.refresh_api_key_hook is not None: self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + key = self.api_key.get( + identifier, self.api_key.get(alias) if alias is not None else None + ) if key: prefix = self.api_key_prefix.get(identifier) if prefix: @@ -374,9 +387,9 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') + return urllib3.util.make_headers(basic_auth=username + ":" + password).get( + "authorization" + ) def auth_settings(self): """Gets Auth Settings dict for api client. @@ -385,11 +398,11 @@ def auth_settings(self): """ auth = {} if self.username is not None and self.password is not None: - auth['BasicAuth'] = { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() + auth["BasicAuth"] = { + "type": "basic", + "in": "header", + "key": "Authorization", + "value": self.get_basic_auth_token(), } return auth @@ -398,12 +411,13 @@ def to_debug_report(self): :return: The report for debugging. """ - return "Python SDK Debug Report:\n" \ - "OS: {env}\n" \ - "Python Version: {pyversion}\n" \ - "Version of the API: v4\n" \ - "SDK Package Version: 1.0.0". \ - format(env=sys.platform, pyversion=sys.version) + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: v4\n" + "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + ) def get_host_settings(self): """Gets an array of host settings @@ -412,8 +426,8 @@ def get_host_settings(self): """ return [ { - 'url': "https://api-gateway.sajari.com", - 'description': "No description provided", + "url": "https://api-gateway.sajari.com", + "description": "No description provided", } ] @@ -435,22 +449,22 @@ def get_host_from_settings(self, index, variables=None, servers=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) + "Must be less than {1}".format(index, len(servers)) + ) - url = server['url'] + url = server["url"] # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: + if "enum_values" in variable and used_value not in variable["enum_values"]: raise ValueError( "The variable `{0}` in the host URL has invalid value " "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) + variable_name, variables[variable_name], variable["enum_values"] + ) + ) url = url.replace("{" + variable_name + "}", used_value) @@ -459,7 +473,9 @@ def get_host_from_settings(self, index, variables=None, servers=None): @property def host(self): """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) + return self.get_host_from_settings( + self.server_index, variables=self.server_variables + ) @host.setter def host(self, value): diff --git a/sajari_client/exceptions.py b/sajari_client/exceptions.py index 409a08b..75edcae 100644 --- a/sajari_client/exceptions.py +++ b/sajari_client/exceptions.py @@ -14,9 +14,8 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + """Raises an exception for TypeErrors Args: msg (str): the exception message @@ -97,7 +96,6 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): if http_resp: self.status = http_resp.status @@ -112,11 +110,9 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n" \ - "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) + error_message += "HTTP response headers: {0}\n".format(self.headers) if self.body: error_message += "HTTP response body: {0}\n".format(self.body) @@ -125,25 +121,21 @@ def __str__(self): class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/sajari_client/model/batch_create_schema_fields_request.py b/sajari_client/model/batch_create_schema_fields_request.py index 7e7ded4..def30ca 100644 --- a/sajari_client/model/batch_create_schema_fields_request.py +++ b/sajari_client/model/batch_create_schema_fields_request.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.schema_field import SchemaField - globals()['SchemaField'] = SchemaField + + globals()["SchemaField"] = SchemaField class BatchCreateSchemaFieldsRequest(ModelNormal): @@ -57,11 +58,9 @@ class BatchCreateSchemaFieldsRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,7 +78,7 @@ def openapi_types(self): """ lazy_import() return { - 'fields': ([SchemaField],), # noqa: E501 + "fields": ([SchemaField],), # noqa: E501 } @cached_property @@ -87,13 +86,19 @@ def discriminator(self): return None attribute_map = { - 'fields': 'fields', # noqa: E501 + "fields": "fields", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, fields, *args, **kwargs): # noqa: E501 @@ -135,15 +140,16 @@ def __init__(self, fields, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, fields, *args, **kwargs): # noqa: E501 self.fields = fields 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: + 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) diff --git a/sajari_client/model/batch_create_schema_fields_response.py b/sajari_client/model/batch_create_schema_fields_response.py index 0858742..706779d 100644 --- a/sajari_client/model/batch_create_schema_fields_response.py +++ b/sajari_client/model/batch_create_schema_fields_response.py @@ -11,7 +11,9 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.batch_create_schema_fields_response_error import BatchCreateSchemaFieldsResponseError +from sajari_client.model.batch_create_schema_fields_response_error import ( + BatchCreateSchemaFieldsResponseError, +) from sajari_client.model.schema_field import SchemaField from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, @@ -30,10 +32,15 @@ def lazy_import(): - from sajari_client.model.batch_create_schema_fields_response_error import BatchCreateSchemaFieldsResponseError + from sajari_client.model.batch_create_schema_fields_response_error import ( + BatchCreateSchemaFieldsResponseError, + ) from sajari_client.model.schema_field import SchemaField - globals()['BatchCreateSchemaFieldsResponseError'] = BatchCreateSchemaFieldsResponseError - globals()['SchemaField'] = SchemaField + + globals()[ + "BatchCreateSchemaFieldsResponseError" + ] = BatchCreateSchemaFieldsResponseError + globals()["SchemaField"] = SchemaField class BatchCreateSchemaFieldsResponse(ModelNormal): @@ -60,11 +67,9 @@ class BatchCreateSchemaFieldsResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -82,8 +87,8 @@ def openapi_types(self): """ lazy_import() return { - 'fields': ([SchemaField],), # noqa: E501 - 'errors': ([BatchCreateSchemaFieldsResponseError],), # noqa: E501 + "fields": ([SchemaField],), # noqa: E501 + "errors": ([BatchCreateSchemaFieldsResponseError],), # noqa: E501 } @cached_property @@ -91,20 +96,22 @@ def discriminator(self): return None attribute_map = { - 'fields': 'fields', # noqa: E501 - 'errors': 'errors', # noqa: E501 + "fields": "fields", # noqa: E501 + "errors": "errors", # noqa: E501 } _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -145,15 +152,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 errors ([BatchCreateSchemaFieldsResponseError]): Errors that occurred.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -169,10 +177,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/batch_create_schema_fields_response_error.py b/sajari_client/model/batch_create_schema_fields_response_error.py index dd803c0..be89ff0 100644 --- a/sajari_client/model/batch_create_schema_fields_response_error.py +++ b/sajari_client/model/batch_create_schema_fields_response_error.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.status import Status - globals()['Status'] = Status + + globals()["Status"] = Status class BatchCreateSchemaFieldsResponseError(ModelNormal): @@ -57,11 +58,9 @@ class BatchCreateSchemaFieldsResponseError(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'index': (int,), # noqa: E501 - 'status': (Status,), # noqa: E501 + "index": (int,), # noqa: E501 + "status": (Status,), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'index': 'index', # noqa: E501 - 'status': 'status', # noqa: E501 + "index": "index", # noqa: E501 + "status": "status", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +141,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 status (Status): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/batch_upsert_records_request.py b/sajari_client/model/batch_upsert_records_request.py index 92d20e6..0ab2181 100644 --- a/sajari_client/model/batch_upsert_records_request.py +++ b/sajari_client/model/batch_upsert_records_request.py @@ -11,7 +11,9 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.batch_upsert_records_request_pipeline import BatchUpsertRecordsRequestPipeline +from sajari_client.model.batch_upsert_records_request_pipeline import ( + BatchUpsertRecordsRequestPipeline, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -29,8 +31,11 @@ def lazy_import(): - from sajari_client.model.batch_upsert_records_request_pipeline import BatchUpsertRecordsRequestPipeline - globals()['BatchUpsertRecordsRequestPipeline'] = BatchUpsertRecordsRequestPipeline + from sajari_client.model.batch_upsert_records_request_pipeline import ( + BatchUpsertRecordsRequestPipeline, + ) + + globals()["BatchUpsertRecordsRequestPipeline"] = BatchUpsertRecordsRequestPipeline class BatchUpsertRecordsRequest(ModelNormal): @@ -57,11 +62,9 @@ class BatchUpsertRecordsRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,9 +82,13 @@ def openapi_types(self): """ lazy_import() return { - 'records': ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}],), # noqa: E501 - 'pipeline': (BatchUpsertRecordsRequestPipeline,), # noqa: E501 - 'variables': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "records": ( + [{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], + ), # noqa: E501 + "pipeline": (BatchUpsertRecordsRequestPipeline,), # noqa: E501 + "variables": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 } @cached_property @@ -89,15 +96,21 @@ def discriminator(self): return None attribute_map = { - 'records': 'records', # noqa: E501 - 'pipeline': 'pipeline', # noqa: E501 - 'variables': 'variables', # noqa: E501 + "records": "records", # noqa: E501 + "pipeline": "pipeline", # noqa: E501 + "variables": "variables", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, records, *args, **kwargs): # noqa: E501 @@ -141,15 +154,16 @@ def __init__(self, records, *args, **kwargs): # noqa: E501 variables ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The initial values for the variables the pipeline operates on and transforms throughout its steps.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -166,10 +180,12 @@ def __init__(self, records, *args, **kwargs): # noqa: E501 self.records = records 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: + 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) diff --git a/sajari_client/model/batch_upsert_records_request_pipeline.py b/sajari_client/model/batch_upsert_records_request_pipeline.py index 486cd30..69304ae 100644 --- a/sajari_client/model/batch_upsert_records_request_pipeline.py +++ b/sajari_client/model/batch_upsert_records_request_pipeline.py @@ -51,11 +51,9 @@ class BatchUpsertRecordsRequestPipeline(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'version': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "version": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'version': 'version', # noqa: E501 + "name": "name", # noqa: E501 + "version": "version", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 @@ -131,15 +135,16 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 version (str): The record pipeline's version, e.g. `42`. If not provided the default version is used.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -156,10 +161,12 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 self.name = name 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: + 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) diff --git a/sajari_client/model/batch_upsert_records_response.py b/sajari_client/model/batch_upsert_records_response.py index 26620b7..f4831b2 100644 --- a/sajari_client/model/batch_upsert_records_response.py +++ b/sajari_client/model/batch_upsert_records_response.py @@ -11,9 +11,15 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.batch_upsert_records_response_error import BatchUpsertRecordsResponseError -from sajari_client.model.batch_upsert_records_response_key import BatchUpsertRecordsResponseKey -from sajari_client.model.batch_upsert_records_response_variables import BatchUpsertRecordsResponseVariables +from sajari_client.model.batch_upsert_records_response_error import ( + BatchUpsertRecordsResponseError, +) +from sajari_client.model.batch_upsert_records_response_key import ( + BatchUpsertRecordsResponseKey, +) +from sajari_client.model.batch_upsert_records_response_variables import ( + BatchUpsertRecordsResponseVariables, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -31,12 +37,21 @@ def lazy_import(): - from sajari_client.model.batch_upsert_records_response_error import BatchUpsertRecordsResponseError - from sajari_client.model.batch_upsert_records_response_key import BatchUpsertRecordsResponseKey - from sajari_client.model.batch_upsert_records_response_variables import BatchUpsertRecordsResponseVariables - globals()['BatchUpsertRecordsResponseError'] = BatchUpsertRecordsResponseError - globals()['BatchUpsertRecordsResponseKey'] = BatchUpsertRecordsResponseKey - globals()['BatchUpsertRecordsResponseVariables'] = BatchUpsertRecordsResponseVariables + from sajari_client.model.batch_upsert_records_response_error import ( + BatchUpsertRecordsResponseError, + ) + from sajari_client.model.batch_upsert_records_response_key import ( + BatchUpsertRecordsResponseKey, + ) + from sajari_client.model.batch_upsert_records_response_variables import ( + BatchUpsertRecordsResponseVariables, + ) + + globals()["BatchUpsertRecordsResponseError"] = BatchUpsertRecordsResponseError + globals()["BatchUpsertRecordsResponseKey"] = BatchUpsertRecordsResponseKey + globals()[ + "BatchUpsertRecordsResponseVariables" + ] = BatchUpsertRecordsResponseVariables class BatchUpsertRecordsResponse(ModelNormal): @@ -63,11 +78,9 @@ class BatchUpsertRecordsResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -85,9 +98,9 @@ def openapi_types(self): """ lazy_import() return { - 'keys': ([BatchUpsertRecordsResponseKey],), # noqa: E501 - 'variables': ([BatchUpsertRecordsResponseVariables],), # noqa: E501 - 'errors': ([BatchUpsertRecordsResponseError],), # noqa: E501 + "keys": ([BatchUpsertRecordsResponseKey],), # noqa: E501 + "variables": ([BatchUpsertRecordsResponseVariables],), # noqa: E501 + "errors": ([BatchUpsertRecordsResponseError],), # noqa: E501 } @cached_property @@ -95,15 +108,21 @@ def discriminator(self): return None attribute_map = { - 'keys': 'keys', # noqa: E501 - 'variables': 'variables', # noqa: E501 - 'errors': 'errors', # noqa: E501 + "keys": "keys", # noqa: E501 + "variables": "variables", # noqa: E501 + "errors": "errors", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -145,15 +164,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 errors ([BatchUpsertRecordsResponseError]): Errors that occurred.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -169,10 +189,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/batch_upsert_records_response_error.py b/sajari_client/model/batch_upsert_records_response_error.py index 2dd6bd7..b8b860f 100644 --- a/sajari_client/model/batch_upsert_records_response_error.py +++ b/sajari_client/model/batch_upsert_records_response_error.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.status import Status - globals()['Status'] = Status + + globals()["Status"] = Status class BatchUpsertRecordsResponseError(ModelNormal): @@ -57,11 +58,9 @@ class BatchUpsertRecordsResponseError(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'index': (int,), # noqa: E501 - 'status': (Status,), # noqa: E501 + "index": (int,), # noqa: E501 + "status": (Status,), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'index': 'index', # noqa: E501 - 'status': 'status', # noqa: E501 + "index": "index", # noqa: E501 + "status": "status", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +141,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 status (Status): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/batch_upsert_records_response_key.py b/sajari_client/model/batch_upsert_records_response_key.py index b191d18..75011f5 100644 --- a/sajari_client/model/batch_upsert_records_response_key.py +++ b/sajari_client/model/batch_upsert_records_response_key.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.record_key import RecordKey - globals()['RecordKey'] = RecordKey + + globals()["RecordKey"] = RecordKey class BatchUpsertRecordsResponseKey(ModelNormal): @@ -57,11 +58,9 @@ class BatchUpsertRecordsResponseKey(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'index': (int,), # noqa: E501 - 'key': (RecordKey,), # noqa: E501 + "index": (int,), # noqa: E501 + "key": (RecordKey,), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'index': 'index', # noqa: E501 - 'key': 'key', # noqa: E501 + "index": "index", # noqa: E501 + "key": "key", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +141,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 key (RecordKey): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/batch_upsert_records_response_variables.py b/sajari_client/model/batch_upsert_records_response_variables.py index 9428f7f..fef5f84 100644 --- a/sajari_client/model/batch_upsert_records_response_variables.py +++ b/sajari_client/model/batch_upsert_records_response_variables.py @@ -51,11 +51,9 @@ class BatchUpsertRecordsResponseVariables(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,10 @@ def openapi_types(self): and the value is attribute type. """ return { - 'index': (int,), # noqa: E501 - 'variables': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "index": (int,), # noqa: E501 + "variables": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 } @cached_property @@ -81,14 +81,20 @@ def discriminator(self): return None attribute_map = { - 'index': 'index', # noqa: E501 - 'variables': 'variables', # noqa: E501 + "index": "index", # noqa: E501 + "variables": "variables", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -129,15 +135,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 variables ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The variables.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +160,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/collection.py b/sajari_client/model/collection.py index f53a2e0..ca8f7f9 100644 --- a/sajari_client/model/collection.py +++ b/sajari_client/model/collection.py @@ -51,11 +51,9 @@ class Collection(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,11 +70,11 @@ def openapi_types(self): and the value is attribute type. """ return { - 'display_name': (str,), # noqa: E501 - 'id': (str,), # noqa: E501 - 'account_id': (str,), # noqa: E501 - 'create_time': (datetime,), # noqa: E501 - 'authorized_query_domains': ([str],), # noqa: E501 + "display_name": (str,), # noqa: E501 + "id": (str,), # noqa: E501 + "account_id": (str,), # noqa: E501 + "create_time": (datetime,), # noqa: E501 + "authorized_query_domains": ([str],), # noqa: E501 } @cached_property @@ -84,17 +82,23 @@ def discriminator(self): return None attribute_map = { - 'display_name': 'display_name', # noqa: E501 - 'id': 'id', # noqa: E501 - 'account_id': 'account_id', # noqa: E501 - 'create_time': 'create_time', # noqa: E501 - 'authorized_query_domains': 'authorized_query_domains', # noqa: E501 + "display_name": "display_name", # noqa: E501 + "id": "id", # noqa: E501 + "account_id": "account_id", # noqa: E501 + "create_time": "create_time", # noqa: E501 + "authorized_query_domains": "authorized_query_domains", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, display_name, *args, **kwargs): # noqa: E501 @@ -140,15 +144,16 @@ def __init__(self, display_name, *args, **kwargs): # noqa: E501 authorized_query_domains ([str]): The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -165,10 +170,12 @@ def __init__(self, display_name, *args, **kwargs): # noqa: E501 self.display_name = display_name 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: + 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) diff --git a/sajari_client/model/delete_record_request.py b/sajari_client/model/delete_record_request.py index eaf5d4e..a8e99bd 100644 --- a/sajari_client/model/delete_record_request.py +++ b/sajari_client/model/delete_record_request.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.record_key import RecordKey - globals()['RecordKey'] = RecordKey + + globals()["RecordKey"] = RecordKey class DeleteRecordRequest(ModelNormal): @@ -57,11 +58,9 @@ class DeleteRecordRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,7 +78,7 @@ def openapi_types(self): """ lazy_import() return { - 'key': (RecordKey,), # noqa: E501 + "key": (RecordKey,), # noqa: E501 } @cached_property @@ -87,13 +86,19 @@ def discriminator(self): return None attribute_map = { - 'key': 'key', # noqa: E501 + "key": "key", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, key, *args, **kwargs): # noqa: E501 @@ -135,15 +140,16 @@ def __init__(self, key, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, key, *args, **kwargs): # noqa: E501 self.key = key 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: + 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) diff --git a/sajari_client/model/error.py b/sajari_client/model/error.py index 53d5342..66626f7 100644 --- a/sajari_client/model/error.py +++ b/sajari_client/model/error.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.protobuf_any import ProtobufAny - globals()['ProtobufAny'] = ProtobufAny + + globals()["ProtobufAny"] = ProtobufAny class Error(ModelNormal): @@ -57,11 +58,9 @@ class Error(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,9 +78,9 @@ def openapi_types(self): """ lazy_import() return { - 'code': (int,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': ([ProtobufAny],), # noqa: E501 + "code": (int,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": ([ProtobufAny],), # noqa: E501 } @cached_property @@ -89,15 +88,21 @@ def discriminator(self): return None attribute_map = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -139,15 +144,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 details ([ProtobufAny]): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -163,10 +169,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/generate_pipelines_request.py b/sajari_client/model/generate_pipelines_request.py index 5d4132f..0cc20b2 100644 --- a/sajari_client/model/generate_pipelines_request.py +++ b/sajari_client/model/generate_pipelines_request.py @@ -51,11 +51,9 @@ class GeneratePipelinesRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'searchable_fields': ([str],), # noqa: E501 - 'query_training_fields': ([str],), # noqa: E501 + "searchable_fields": ([str],), # noqa: E501 + "query_training_fields": ([str],), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'searchable_fields': 'searchable_fields', # noqa: E501 - 'query_training_fields': 'query_training_fields', # noqa: E501 + "searchable_fields": "searchable_fields", # noqa: E501 + "query_training_fields": "query_training_fields", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, searchable_fields, *args, **kwargs): # noqa: E501 @@ -131,15 +135,16 @@ def __init__(self, searchable_fields, *args, **kwargs): # noqa: E501 query_training_fields ([str]): List of fields to train query suggestions from.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -156,10 +161,12 @@ def __init__(self, searchable_fields, *args, **kwargs): # noqa: E501 self.searchable_fields = searchable_fields 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: + 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) diff --git a/sajari_client/model/generate_pipelines_response.py b/sajari_client/model/generate_pipelines_response.py index 587024f..a69d012 100644 --- a/sajari_client/model/generate_pipelines_response.py +++ b/sajari_client/model/generate_pipelines_response.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.pipeline import Pipeline - globals()['Pipeline'] = Pipeline + + globals()["Pipeline"] = Pipeline class GeneratePipelinesResponse(ModelNormal): @@ -57,11 +58,9 @@ class GeneratePipelinesResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,9 +78,9 @@ def openapi_types(self): """ lazy_import() return { - 'record_pipeline': (Pipeline,), # noqa: E501 - 'query_pipeline': (Pipeline,), # noqa: E501 - 'autocomplete_pipeline': (Pipeline,), # noqa: E501 + "record_pipeline": (Pipeline,), # noqa: E501 + "query_pipeline": (Pipeline,), # noqa: E501 + "autocomplete_pipeline": (Pipeline,), # noqa: E501 } @cached_property @@ -89,15 +88,21 @@ def discriminator(self): return None attribute_map = { - 'record_pipeline': 'record_pipeline', # noqa: E501 - 'query_pipeline': 'query_pipeline', # noqa: E501 - 'autocomplete_pipeline': 'autocomplete_pipeline', # noqa: E501 + "record_pipeline": "record_pipeline", # noqa: E501 + "query_pipeline": "query_pipeline", # noqa: E501 + "autocomplete_pipeline": "autocomplete_pipeline", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -139,15 +144,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 autocomplete_pipeline (Pipeline): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -163,10 +169,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/get_default_pipeline_response.py b/sajari_client/model/get_default_pipeline_response.py index b34a0f7..e6e6361 100644 --- a/sajari_client/model/get_default_pipeline_response.py +++ b/sajari_client/model/get_default_pipeline_response.py @@ -51,11 +51,9 @@ class GetDefaultPipelineResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'pipeline': (str,), # noqa: E501 + "pipeline": (str,), # noqa: E501 } @cached_property @@ -80,13 +78,19 @@ def discriminator(self): return None attribute_map = { - 'pipeline': 'pipeline', # noqa: E501 + "pipeline": "pipeline", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -126,15 +130,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 pipeline (str): The name of the pipeline to use when not otherwise specified.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -150,10 +155,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/get_default_version_request_view.py b/sajari_client/model/get_default_version_request_view.py index f70e3f5..ca78e5c 100644 --- a/sajari_client/model/get_default_version_request_view.py +++ b/sajari_client/model/get_default_version_request_view.py @@ -48,15 +48,14 @@ class GetDefaultVersionRequestView(ModelSimple): """ allowed_values = { - ('value',): { - 'VIEW_UNSPECIFIED': "VIEW_UNSPECIFIED", - 'BASIC': "BASIC", - 'FULL': "FULL", + ("value",): { + "VIEW_UNSPECIFIED": "VIEW_UNSPECIFIED", + "BASIC": "BASIC", + "FULL": "FULL", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -73,7 +72,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -84,8 +83,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -130,24 +135,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "VIEW_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -164,7 +170,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/get_pipeline_request_view.py b/sajari_client/model/get_pipeline_request_view.py index 81b409d..e37c38f 100644 --- a/sajari_client/model/get_pipeline_request_view.py +++ b/sajari_client/model/get_pipeline_request_view.py @@ -48,15 +48,14 @@ class GetPipelineRequestView(ModelSimple): """ allowed_values = { - ('value',): { - 'VIEW_UNSPECIFIED': "VIEW_UNSPECIFIED", - 'BASIC': "BASIC", - 'FULL': "FULL", + ("value",): { + "VIEW_UNSPECIFIED": "VIEW_UNSPECIFIED", + "BASIC": "BASIC", + "FULL": "FULL", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -73,7 +72,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -84,8 +83,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -130,24 +135,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "VIEW_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -164,7 +170,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/get_record_request.py b/sajari_client/model/get_record_request.py index 7a0650a..a8b16e8 100644 --- a/sajari_client/model/get_record_request.py +++ b/sajari_client/model/get_record_request.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.record_key import RecordKey - globals()['RecordKey'] = RecordKey + + globals()["RecordKey"] = RecordKey class GetRecordRequest(ModelNormal): @@ -57,11 +58,9 @@ class GetRecordRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,7 +78,7 @@ def openapi_types(self): """ lazy_import() return { - 'key': (RecordKey,), # noqa: E501 + "key": (RecordKey,), # noqa: E501 } @cached_property @@ -87,13 +86,19 @@ def discriminator(self): return None attribute_map = { - 'key': 'key', # noqa: E501 + "key": "key", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, key, *args, **kwargs): # noqa: E501 @@ -135,15 +140,16 @@ def __init__(self, key, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, key, *args, **kwargs): # noqa: E501 self.key = key 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: + 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) diff --git a/sajari_client/model/list_collections_response.py b/sajari_client/model/list_collections_response.py index f44855c..92ecb3a 100644 --- a/sajari_client/model/list_collections_response.py +++ b/sajari_client/model/list_collections_response.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.collection import Collection - globals()['Collection'] = Collection + + globals()["Collection"] = Collection class ListCollectionsResponse(ModelNormal): @@ -57,11 +58,9 @@ class ListCollectionsResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'collections': ([Collection],), # noqa: E501 - 'next_page_token': (str,), # noqa: E501 + "collections": ([Collection],), # noqa: E501 + "next_page_token": (str,), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'collections': 'collections', # noqa: E501 - 'next_page_token': 'next_page_token', # noqa: E501 + "collections": "collections", # noqa: E501 + "next_page_token": "next_page_token", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +141,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 next_page_token (str): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/list_pipelines_request_view.py b/sajari_client/model/list_pipelines_request_view.py index bf8979b..de677fe 100644 --- a/sajari_client/model/list_pipelines_request_view.py +++ b/sajari_client/model/list_pipelines_request_view.py @@ -48,15 +48,14 @@ class ListPipelinesRequestView(ModelSimple): """ allowed_values = { - ('value',): { - 'VIEW_UNSPECIFIED': "VIEW_UNSPECIFIED", - 'BASIC': "BASIC", - 'FULL': "FULL", + ("value",): { + "VIEW_UNSPECIFIED": "VIEW_UNSPECIFIED", + "BASIC": "BASIC", + "FULL": "FULL", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -73,7 +72,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -84,8 +83,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -130,24 +135,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "VIEW_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -164,7 +170,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/list_pipelines_response.py b/sajari_client/model/list_pipelines_response.py index 40746d9..728ed05 100644 --- a/sajari_client/model/list_pipelines_response.py +++ b/sajari_client/model/list_pipelines_response.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.pipeline import Pipeline - globals()['Pipeline'] = Pipeline + + globals()["Pipeline"] = Pipeline class ListPipelinesResponse(ModelNormal): @@ -57,11 +58,9 @@ class ListPipelinesResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'pipelines': ([Pipeline],), # noqa: E501 - 'next_page_token': (str,), # noqa: E501 + "pipelines": ([Pipeline],), # noqa: E501 + "next_page_token": (str,), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'pipelines': 'pipelines', # noqa: E501 - 'next_page_token': 'next_page_token', # noqa: E501 + "pipelines": "pipelines", # noqa: E501 + "next_page_token": "next_page_token", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +141,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 next_page_token (str): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/list_schema_fields_response.py b/sajari_client/model/list_schema_fields_response.py index bf4029f..de83e52 100644 --- a/sajari_client/model/list_schema_fields_response.py +++ b/sajari_client/model/list_schema_fields_response.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.schema_field import SchemaField - globals()['SchemaField'] = SchemaField + + globals()["SchemaField"] = SchemaField class ListSchemaFieldsResponse(ModelNormal): @@ -57,11 +58,9 @@ class ListSchemaFieldsResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,9 +78,9 @@ def openapi_types(self): """ lazy_import() return { - 'schema_fields': ([SchemaField],), # noqa: E501 - 'total_size': (int,), # noqa: E501 - 'next_page_token': (str,), # noqa: E501 + "schema_fields": ([SchemaField],), # noqa: E501 + "total_size": (int,), # noqa: E501 + "next_page_token": (str,), # noqa: E501 } @cached_property @@ -89,15 +88,21 @@ def discriminator(self): return None attribute_map = { - 'schema_fields': 'schema_fields', # noqa: E501 - 'total_size': 'total_size', # noqa: E501 - 'next_page_token': 'next_page_token', # noqa: E501 + "schema_fields": "schema_fields", # noqa: E501 + "total_size": "total_size", # noqa: E501 + "next_page_token": "next_page_token", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -139,15 +144,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 next_page_token (str): A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -163,10 +169,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/percentile_data_point.py b/sajari_client/model/percentile_data_point.py index 2990f51..5056c4b 100644 --- a/sajari_client/model/percentile_data_point.py +++ b/sajari_client/model/percentile_data_point.py @@ -51,11 +51,9 @@ class PercentileDataPoint(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'point': (float,), # noqa: E501 - 'value': (float,), # noqa: E501 + "point": (float,), # noqa: E501 + "value": (float,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'point': 'point', # noqa: E501 - 'value': 'value', # noqa: E501 + "point": "point", # noqa: E501 + "value": "value", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -129,15 +133,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 value (float): The corresponding value for the given point.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +158,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/pipeline.py b/sajari_client/model/pipeline.py index 5e09400..583f37b 100644 --- a/sajari_client/model/pipeline.py +++ b/sajari_client/model/pipeline.py @@ -32,8 +32,9 @@ def lazy_import(): from sajari_client.model.pipeline_step import PipelineStep from sajari_client.model.pipeline_type import PipelineType - globals()['PipelineStep'] = PipelineStep - globals()['PipelineType'] = PipelineType + + globals()["PipelineStep"] = PipelineStep + globals()["PipelineType"] = PipelineType class Pipeline(ModelNormal): @@ -60,11 +61,9 @@ class Pipeline(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -82,15 +81,15 @@ def openapi_types(self): """ lazy_import() return { - 'type': (PipelineType,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'version': (str,), # noqa: E501 - 'create_time': (datetime,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'pre_steps': ([PipelineStep],), # noqa: E501 - 'post_steps': ([PipelineStep],), # noqa: E501 - 'collection_default': (bool,), # noqa: E501 - 'default_version': (bool,), # noqa: E501 + "type": (PipelineType,), # noqa: E501 + "name": (str,), # noqa: E501 + "version": (str,), # noqa: E501 + "create_time": (datetime,), # noqa: E501 + "description": (str,), # noqa: E501 + "pre_steps": ([PipelineStep],), # noqa: E501 + "post_steps": ([PipelineStep],), # noqa: E501 + "collection_default": (bool,), # noqa: E501 + "default_version": (bool,), # noqa: E501 } @cached_property @@ -98,21 +97,27 @@ def discriminator(self): return None attribute_map = { - 'type': 'type', # noqa: E501 - 'name': 'name', # noqa: E501 - 'version': 'version', # noqa: E501 - 'create_time': 'create_time', # noqa: E501 - 'description': 'description', # noqa: E501 - 'pre_steps': 'pre_steps', # noqa: E501 - 'post_steps': 'post_steps', # noqa: E501 - 'collection_default': 'collection_default', # noqa: E501 - 'default_version': 'default_version', # noqa: E501 + "type": "type", # noqa: E501 + "name": "name", # noqa: E501 + "version": "version", # noqa: E501 + "create_time": "create_time", # noqa: E501 + "description": "description", # noqa: E501 + "pre_steps": "pre_steps", # noqa: E501 + "post_steps": "post_steps", # noqa: E501 + "collection_default": "collection_default", # noqa: E501 + "default_version": "default_version", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, type, name, version, *args, **kwargs): # noqa: E501 @@ -162,15 +167,16 @@ def __init__(self, type, name, version, *args, **kwargs): # noqa: E501 default_version (bool): Output only. Indicates if the pipeline is the default version.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -189,10 +195,12 @@ def __init__(self, type, name, version, *args, **kwargs): # noqa: E501 self.name = name self.version = version 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: + 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) diff --git a/sajari_client/model/pipeline_step.py b/sajari_client/model/pipeline_step.py index 4c7ecce..4c20542 100644 --- a/sajari_client/model/pipeline_step.py +++ b/sajari_client/model/pipeline_step.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.pipeline_step_param_binding import PipelineStepParamBinding - globals()['PipelineStepParamBinding'] = PipelineStepParamBinding + + globals()["PipelineStepParamBinding"] = PipelineStepParamBinding class PipelineStep(ModelNormal): @@ -57,11 +58,9 @@ class PipelineStep(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,12 +78,12 @@ def openapi_types(self): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'title': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'params': ({str: (PipelineStepParamBinding,)},), # noqa: E501 - 'condition': (str,), # noqa: E501 - 'annotations': ([str],), # noqa: E501 + "id": (str,), # noqa: E501 + "title": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + "params": ({str: (PipelineStepParamBinding,)},), # noqa: E501 + "condition": (str,), # noqa: E501 + "annotations": ([str],), # noqa: E501 } @cached_property @@ -92,18 +91,24 @@ def discriminator(self): return None attribute_map = { - 'id': 'id', # noqa: E501 - 'title': 'title', # noqa: E501 - 'description': 'description', # noqa: E501 - 'params': 'params', # noqa: E501 - 'condition': 'condition', # noqa: E501 - 'annotations': 'annotations', # noqa: E501 + "id": "id", # noqa: E501 + "title": "title", # noqa: E501 + "description": "description", # noqa: E501 + "params": "params", # noqa: E501 + "condition": "condition", # noqa: E501 + "annotations": "annotations", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, id, *args, **kwargs): # noqa: E501 @@ -150,15 +155,16 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 annotations ([str]): Annotations added to the request when the step is run.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -175,10 +181,12 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 self.id = id 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: + 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) diff --git a/sajari_client/model/pipeline_step_param_binding.py b/sajari_client/model/pipeline_step_param_binding.py index 3909dfd..186b206 100644 --- a/sajari_client/model/pipeline_step_param_binding.py +++ b/sajari_client/model/pipeline_step_param_binding.py @@ -51,11 +51,9 @@ class PipelineStepParamBinding(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,10 +70,10 @@ def openapi_types(self): and the value is attribute type. """ return { - 'bind': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'default_value': (str,), # noqa: E501 - 'constant': (str,), # noqa: E501 + "bind": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + "default_value": (str,), # noqa: E501 + "constant": (str,), # noqa: E501 } @cached_property @@ -83,16 +81,22 @@ def discriminator(self): return None attribute_map = { - 'bind': 'bind', # noqa: E501 - 'description': 'description', # noqa: E501 - 'default_value': 'default_value', # noqa: E501 - 'constant': 'constant', # noqa: E501 + "bind": "bind", # noqa: E501 + "description": "description", # noqa: E501 + "default_value": "default_value", # noqa: E501 + "constant": "constant", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -135,15 +139,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 constant (str): Bind the step parameter to a constant value.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -159,10 +164,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/pipeline_type.py b/sajari_client/model/pipeline_type.py index 8224a9e..a60810e 100644 --- a/sajari_client/model/pipeline_type.py +++ b/sajari_client/model/pipeline_type.py @@ -48,15 +48,14 @@ class PipelineType(ModelSimple): """ allowed_values = { - ('value',): { - 'TYPE_UNSPECIFIED': "TYPE_UNSPECIFIED", - 'RECORD': "RECORD", - 'QUERY': "QUERY", + ("value",): { + "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", + "RECORD": "RECORD", + "QUERY": "QUERY", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -73,7 +72,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -84,8 +83,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -130,24 +135,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "TYPE_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -164,7 +170,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/protobuf_any.py b/sajari_client/model/protobuf_any.py index 83917ac..c101502 100644 --- a/sajari_client/model/protobuf_any.py +++ b/sajari_client/model/protobuf_any.py @@ -51,11 +51,9 @@ class ProtobufAny(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'type_url': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 + "type_url": (str,), # noqa: E501 + "value": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'type_url': 'type_url', # noqa: E501 - 'value': 'value', # noqa: E501 + "type_url": "type_url", # noqa: E501 + "value": "value", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -129,15 +133,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 value (str): Must be a valid serialized protocol buffer of the above specified type.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +158,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/protobuf_null_value.py b/sajari_client/model/protobuf_null_value.py index be7626b..d72ade4 100644 --- a/sajari_client/model/protobuf_null_value.py +++ b/sajari_client/model/protobuf_null_value.py @@ -48,13 +48,12 @@ class ProtobufNullValue(ModelSimple): """ allowed_values = { - ('value',): { - 'NULL_VALUE': "NULL_VALUE", + ("value",): { + "NULL_VALUE": "NULL_VALUE", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -71,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -82,8 +81,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -128,24 +133,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "NULL_VALUE" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -162,7 +168,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/query_aggregate_result.py b/sajari_client/model/query_aggregate_result.py index 0a9850b..ad8872e 100644 --- a/sajari_client/model/query_aggregate_result.py +++ b/sajari_client/model/query_aggregate_result.py @@ -11,12 +11,18 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.query_aggregate_result_analysis import QueryAggregateResultAnalysis -from sajari_client.model.query_aggregate_result_buckets import QueryAggregateResultBuckets +from sajari_client.model.query_aggregate_result_analysis import ( + QueryAggregateResultAnalysis, +) +from sajari_client.model.query_aggregate_result_buckets import ( + QueryAggregateResultBuckets, +) from sajari_client.model.query_aggregate_result_count import QueryAggregateResultCount from sajari_client.model.query_aggregate_result_date import QueryAggregateResultDate from sajari_client.model.query_aggregate_result_metric import QueryAggregateResultMetric -from sajari_client.model.query_aggregate_result_percentile import QueryAggregateResultPercentile +from sajari_client.model.query_aggregate_result_percentile import ( + QueryAggregateResultPercentile, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -34,18 +40,29 @@ def lazy_import(): - from sajari_client.model.query_aggregate_result_analysis import QueryAggregateResultAnalysis - from sajari_client.model.query_aggregate_result_buckets import QueryAggregateResultBuckets - from sajari_client.model.query_aggregate_result_count import QueryAggregateResultCount + from sajari_client.model.query_aggregate_result_analysis import ( + QueryAggregateResultAnalysis, + ) + from sajari_client.model.query_aggregate_result_buckets import ( + QueryAggregateResultBuckets, + ) + from sajari_client.model.query_aggregate_result_count import ( + QueryAggregateResultCount, + ) from sajari_client.model.query_aggregate_result_date import QueryAggregateResultDate - from sajari_client.model.query_aggregate_result_metric import QueryAggregateResultMetric - from sajari_client.model.query_aggregate_result_percentile import QueryAggregateResultPercentile - globals()['QueryAggregateResultAnalysis'] = QueryAggregateResultAnalysis - globals()['QueryAggregateResultBuckets'] = QueryAggregateResultBuckets - globals()['QueryAggregateResultCount'] = QueryAggregateResultCount - globals()['QueryAggregateResultDate'] = QueryAggregateResultDate - globals()['QueryAggregateResultMetric'] = QueryAggregateResultMetric - globals()['QueryAggregateResultPercentile'] = QueryAggregateResultPercentile + from sajari_client.model.query_aggregate_result_metric import ( + QueryAggregateResultMetric, + ) + from sajari_client.model.query_aggregate_result_percentile import ( + QueryAggregateResultPercentile, + ) + + globals()["QueryAggregateResultAnalysis"] = QueryAggregateResultAnalysis + globals()["QueryAggregateResultBuckets"] = QueryAggregateResultBuckets + globals()["QueryAggregateResultCount"] = QueryAggregateResultCount + globals()["QueryAggregateResultDate"] = QueryAggregateResultDate + globals()["QueryAggregateResultMetric"] = QueryAggregateResultMetric + globals()["QueryAggregateResultPercentile"] = QueryAggregateResultPercentile class QueryAggregateResult(ModelNormal): @@ -72,11 +89,9 @@ class QueryAggregateResult(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -94,12 +109,12 @@ def openapi_types(self): """ lazy_import() return { - 'metric': (QueryAggregateResultMetric,), # noqa: E501 - 'count': (QueryAggregateResultCount,), # noqa: E501 - 'buckets': (QueryAggregateResultBuckets,), # noqa: E501 - 'date': (QueryAggregateResultDate,), # noqa: E501 - 'analysis': (QueryAggregateResultAnalysis,), # noqa: E501 - 'percentile': (QueryAggregateResultPercentile,), # noqa: E501 + "metric": (QueryAggregateResultMetric,), # noqa: E501 + "count": (QueryAggregateResultCount,), # noqa: E501 + "buckets": (QueryAggregateResultBuckets,), # noqa: E501 + "date": (QueryAggregateResultDate,), # noqa: E501 + "analysis": (QueryAggregateResultAnalysis,), # noqa: E501 + "percentile": (QueryAggregateResultPercentile,), # noqa: E501 } @cached_property @@ -107,18 +122,24 @@ def discriminator(self): return None attribute_map = { - 'metric': 'metric', # noqa: E501 - 'count': 'count', # noqa: E501 - 'buckets': 'buckets', # noqa: E501 - 'date': 'date', # noqa: E501 - 'analysis': 'analysis', # noqa: E501 - 'percentile': 'percentile', # noqa: E501 + "metric": "metric", # noqa: E501 + "count": "count", # noqa: E501 + "buckets": "buckets", # noqa: E501 + "date": "date", # noqa: E501 + "analysis": "analysis", # noqa: E501 + "percentile": "percentile", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -163,15 +184,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 percentile (QueryAggregateResultPercentile): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -187,10 +209,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_analysis.py b/sajari_client/model/query_aggregate_result_analysis.py index 0026f24..7f969a9 100644 --- a/sajari_client/model/query_aggregate_result_analysis.py +++ b/sajari_client/model/query_aggregate_result_analysis.py @@ -51,11 +51,9 @@ class QueryAggregateResultAnalysis(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,11 +70,11 @@ def openapi_types(self): and the value is attribute type. """ return { - 'coverage': (int,), # noqa: E501 - 'cardinality': (int,), # noqa: E501 - 'min_length': (int,), # noqa: E501 - 'max_length': (int,), # noqa: E501 - 'avg_length': (float,), # noqa: E501 + "coverage": (int,), # noqa: E501 + "cardinality": (int,), # noqa: E501 + "min_length": (int,), # noqa: E501 + "max_length": (int,), # noqa: E501 + "avg_length": (float,), # noqa: E501 } @cached_property @@ -84,23 +82,25 @@ def discriminator(self): return None attribute_map = { - 'coverage': 'coverage', # noqa: E501 - 'cardinality': 'cardinality', # noqa: E501 - 'min_length': 'min_length', # noqa: E501 - 'max_length': 'max_length', # noqa: E501 - 'avg_length': 'avg_length', # noqa: E501 + "coverage": "coverage", # noqa: E501 + "cardinality": "cardinality", # noqa: E501 + "min_length": "min_length", # noqa: E501 + "max_length": "max_length", # noqa: E501 + "avg_length": "avg_length", # noqa: E501 } _composed_schemas = {} - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -144,15 +144,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 avg_length (float): Average number of items in an array field.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -168,10 +169,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_buckets.py b/sajari_client/model/query_aggregate_result_buckets.py index 20ced6c..34dcb3b 100644 --- a/sajari_client/model/query_aggregate_result_buckets.py +++ b/sajari_client/model/query_aggregate_result_buckets.py @@ -11,7 +11,9 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.query_aggregate_result_buckets_bucket import QueryAggregateResultBucketsBucket +from sajari_client.model.query_aggregate_result_buckets_bucket import ( + QueryAggregateResultBucketsBucket, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -29,8 +31,11 @@ def lazy_import(): - from sajari_client.model.query_aggregate_result_buckets_bucket import QueryAggregateResultBucketsBucket - globals()['QueryAggregateResultBucketsBucket'] = QueryAggregateResultBucketsBucket + from sajari_client.model.query_aggregate_result_buckets_bucket import ( + QueryAggregateResultBucketsBucket, + ) + + globals()["QueryAggregateResultBucketsBucket"] = QueryAggregateResultBucketsBucket class QueryAggregateResultBuckets(ModelNormal): @@ -57,11 +62,9 @@ class QueryAggregateResultBuckets(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,7 +82,7 @@ def openapi_types(self): """ lazy_import() return { - 'buckets': ({str: (QueryAggregateResultBucketsBucket,)},), # noqa: E501 + "buckets": ({str: (QueryAggregateResultBucketsBucket,)},), # noqa: E501 } @cached_property @@ -87,13 +90,19 @@ def discriminator(self): return None attribute_map = { - 'buckets': 'buckets', # noqa: E501 + "buckets": "buckets", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -133,15 +142,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 buckets ({str: (QueryAggregateResultBucketsBucket,)}): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -157,10 +167,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_buckets_bucket.py b/sajari_client/model/query_aggregate_result_buckets_bucket.py index 4b524d6..52fa6e1 100644 --- a/sajari_client/model/query_aggregate_result_buckets_bucket.py +++ b/sajari_client/model/query_aggregate_result_buckets_bucket.py @@ -51,11 +51,9 @@ class QueryAggregateResultBucketsBucket(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'count': (int,), # noqa: E501 + "name": (str,), # noqa: E501 + "count": (int,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'count': 'count', # noqa: E501 + "name": "name", # noqa: E501 + "count": "count", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -129,15 +133,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 count (int): Number of records in the bucket.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +158,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_count.py b/sajari_client/model/query_aggregate_result_count.py index c0bf26b..89f8b88 100644 --- a/sajari_client/model/query_aggregate_result_count.py +++ b/sajari_client/model/query_aggregate_result_count.py @@ -51,11 +51,9 @@ class QueryAggregateResultCount(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'counts': ({str: (int,)},), # noqa: E501 + "counts": ({str: (int,)},), # noqa: E501 } @cached_property @@ -80,13 +78,19 @@ def discriminator(self): return None attribute_map = { - 'counts': 'counts', # noqa: E501 + "counts": "counts", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -126,15 +130,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 counts ({str: (int,)}): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -150,10 +155,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_date.py b/sajari_client/model/query_aggregate_result_date.py index bb648ba..3a0ed82 100644 --- a/sajari_client/model/query_aggregate_result_date.py +++ b/sajari_client/model/query_aggregate_result_date.py @@ -51,11 +51,9 @@ class QueryAggregateResultDate(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'dates': ({str: (int,)},), # noqa: E501 + "dates": ({str: (int,)},), # noqa: E501 } @cached_property @@ -80,13 +78,19 @@ def discriminator(self): return None attribute_map = { - 'dates': 'dates', # noqa: E501 + "dates": "dates", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -126,15 +130,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 dates ({str: (int,)}): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -150,10 +155,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_metric.py b/sajari_client/model/query_aggregate_result_metric.py index 7816aed..9a8c588 100644 --- a/sajari_client/model/query_aggregate_result_metric.py +++ b/sajari_client/model/query_aggregate_result_metric.py @@ -51,11 +51,9 @@ class QueryAggregateResultMetric(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (float,), # noqa: E501 + "value": (float,), # noqa: E501 } @cached_property @@ -80,13 +78,19 @@ def discriminator(self): return None attribute_map = { - 'value': 'value', # noqa: E501 + "value": "value", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -126,15 +130,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 value (float): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -150,10 +155,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_aggregate_result_percentile.py b/sajari_client/model/query_aggregate_result_percentile.py index a1cdbc0..3a442fe 100644 --- a/sajari_client/model/query_aggregate_result_percentile.py +++ b/sajari_client/model/query_aggregate_result_percentile.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.percentile_data_point import PercentileDataPoint - globals()['PercentileDataPoint'] = PercentileDataPoint + + globals()["PercentileDataPoint"] = PercentileDataPoint class QueryAggregateResultPercentile(ModelNormal): @@ -57,11 +58,9 @@ class QueryAggregateResultPercentile(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'percentiles': ([PercentileDataPoint],), # noqa: E501 - 'cdf': ([PercentileDataPoint],), # noqa: E501 + "percentiles": ([PercentileDataPoint],), # noqa: E501 + "cdf": ([PercentileDataPoint],), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'percentiles': 'percentiles', # noqa: E501 - 'cdf': 'cdf', # noqa: E501 + "percentiles": "percentiles", # noqa: E501 + "cdf": "cdf", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +141,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 cdf ([PercentileDataPoint]): The cumulative distribution function (CDF) data points.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +166,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_collection_request.py b/sajari_client/model/query_collection_request.py index 59546ee..78d6a0f 100644 --- a/sajari_client/model/query_collection_request.py +++ b/sajari_client/model/query_collection_request.py @@ -11,8 +11,12 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.query_collection_request_pipeline import QueryCollectionRequestPipeline -from sajari_client.model.query_collection_request_tracking import QueryCollectionRequestTracking +from sajari_client.model.query_collection_request_pipeline import ( + QueryCollectionRequestPipeline, +) +from sajari_client.model.query_collection_request_tracking import ( + QueryCollectionRequestTracking, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -30,10 +34,15 @@ def lazy_import(): - from sajari_client.model.query_collection_request_pipeline import QueryCollectionRequestPipeline - from sajari_client.model.query_collection_request_tracking import QueryCollectionRequestTracking - globals()['QueryCollectionRequestPipeline'] = QueryCollectionRequestPipeline - globals()['QueryCollectionRequestTracking'] = QueryCollectionRequestTracking + from sajari_client.model.query_collection_request_pipeline import ( + QueryCollectionRequestPipeline, + ) + from sajari_client.model.query_collection_request_tracking import ( + QueryCollectionRequestTracking, + ) + + globals()["QueryCollectionRequestPipeline"] = QueryCollectionRequestPipeline + globals()["QueryCollectionRequestTracking"] = QueryCollectionRequestTracking class QueryCollectionRequest(ModelNormal): @@ -60,11 +69,9 @@ class QueryCollectionRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -82,9 +89,11 @@ def openapi_types(self): """ lazy_import() return { - 'variables': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'pipeline': (QueryCollectionRequestPipeline,), # noqa: E501 - 'tracking': (QueryCollectionRequestTracking,), # noqa: E501 + "variables": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "pipeline": (QueryCollectionRequestPipeline,), # noqa: E501 + "tracking": (QueryCollectionRequestTracking,), # noqa: E501 } @cached_property @@ -92,15 +101,21 @@ def discriminator(self): return None attribute_map = { - 'variables': 'variables', # noqa: E501 - 'pipeline': 'pipeline', # noqa: E501 - 'tracking': 'tracking', # noqa: E501 + "variables": "variables", # noqa: E501 + "pipeline": "pipeline", # noqa: E501 + "tracking": "tracking", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, variables, *args, **kwargs): # noqa: E501 @@ -144,15 +159,16 @@ def __init__(self, variables, *args, **kwargs): # noqa: E501 tracking (QueryCollectionRequestTracking): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -169,10 +185,12 @@ def __init__(self, variables, *args, **kwargs): # noqa: E501 self.variables = variables 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: + 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) diff --git a/sajari_client/model/query_collection_request_pipeline.py b/sajari_client/model/query_collection_request_pipeline.py index 527f8d7..e60a984 100644 --- a/sajari_client/model/query_collection_request_pipeline.py +++ b/sajari_client/model/query_collection_request_pipeline.py @@ -51,11 +51,9 @@ class QueryCollectionRequestPipeline(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'version': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "version": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'version': 'version', # noqa: E501 + "name": "name", # noqa: E501 + "version": "version", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 @@ -131,15 +135,16 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 version (str): The query pipeline's version, e.g. `42`. If not provided the default version is used.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -156,10 +161,12 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 self.name = name 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: + 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) diff --git a/sajari_client/model/query_collection_request_tracking.py b/sajari_client/model/query_collection_request_tracking.py index df6b91c..7750b5b 100644 --- a/sajari_client/model/query_collection_request_tracking.py +++ b/sajari_client/model/query_collection_request_tracking.py @@ -11,7 +11,9 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.query_collection_request_tracking_type import QueryCollectionRequestTrackingType +from sajari_client.model.query_collection_request_tracking_type import ( + QueryCollectionRequestTrackingType, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -29,8 +31,11 @@ def lazy_import(): - from sajari_client.model.query_collection_request_tracking_type import QueryCollectionRequestTrackingType - globals()['QueryCollectionRequestTrackingType'] = QueryCollectionRequestTrackingType + from sajari_client.model.query_collection_request_tracking_type import ( + QueryCollectionRequestTrackingType, + ) + + globals()["QueryCollectionRequestTrackingType"] = QueryCollectionRequestTrackingType class QueryCollectionRequestTracking(ModelNormal): @@ -57,11 +62,9 @@ class QueryCollectionRequestTracking(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,11 +82,11 @@ def openapi_types(self): """ lazy_import() return { - 'type': (QueryCollectionRequestTrackingType,), # noqa: E501 - 'query_id': (str,), # noqa: E501 - 'sequence': (int,), # noqa: E501 - 'field': (str,), # noqa: E501 - 'data': ({str: (str,)},), # noqa: E501 + "type": (QueryCollectionRequestTrackingType,), # noqa: E501 + "query_id": (str,), # noqa: E501 + "sequence": (int,), # noqa: E501 + "field": (str,), # noqa: E501 + "data": ({str: (str,)},), # noqa: E501 } @cached_property @@ -91,17 +94,23 @@ def discriminator(self): return None attribute_map = { - 'type': 'type', # noqa: E501 - 'query_id': 'query_id', # noqa: E501 - 'sequence': 'sequence', # noqa: E501 - 'field': 'field', # noqa: E501 - 'data': 'data', # noqa: E501 + "type": "type", # noqa: E501 + "query_id": "query_id", # noqa: E501 + "sequence": "sequence", # noqa: E501 + "field": "field", # noqa: E501 + "data": "data", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -145,15 +154,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 data ({str: (str,)}): Custom values to be included in tracking data.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -169,10 +179,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_collection_request_tracking_type.py b/sajari_client/model/query_collection_request_tracking_type.py index 84a4998..8583457 100644 --- a/sajari_client/model/query_collection_request_tracking_type.py +++ b/sajari_client/model/query_collection_request_tracking_type.py @@ -48,16 +48,15 @@ class QueryCollectionRequestTrackingType(ModelSimple): """ allowed_values = { - ('value',): { - 'TYPE_UNSPECIFIED': "TYPE_UNSPECIFIED", - 'NONE': "NONE", - 'CLICK': "CLICK", - 'POS_NEG': "POS_NEG", + ("value",): { + "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", + "NONE": "NONE", + "CLICK": "CLICK", + "POS_NEG": "POS_NEG", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -74,7 +73,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -85,8 +84,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -131,24 +136,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "TYPE_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -165,7 +171,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/query_collection_response.py b/sajari_client/model/query_collection_response.py index 5140113..2f2ae7d 100644 --- a/sajari_client/model/query_collection_response.py +++ b/sajari_client/model/query_collection_response.py @@ -12,7 +12,9 @@ import sys # noqa: F401 from sajari_client.model.query_aggregate_result import QueryAggregateResult -from sajari_client.model.query_collection_response_pipeline import QueryCollectionResponsePipeline +from sajari_client.model.query_collection_response_pipeline import ( + QueryCollectionResponsePipeline, +) from sajari_client.model.query_result import QueryResult from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, @@ -32,11 +34,14 @@ def lazy_import(): from sajari_client.model.query_aggregate_result import QueryAggregateResult - from sajari_client.model.query_collection_response_pipeline import QueryCollectionResponsePipeline + from sajari_client.model.query_collection_response_pipeline import ( + QueryCollectionResponsePipeline, + ) from sajari_client.model.query_result import QueryResult - globals()['QueryAggregateResult'] = QueryAggregateResult - globals()['QueryCollectionResponsePipeline'] = QueryCollectionResponsePipeline - globals()['QueryResult'] = QueryResult + + globals()["QueryAggregateResult"] = QueryAggregateResult + globals()["QueryCollectionResponsePipeline"] = QueryCollectionResponsePipeline + globals()["QueryResult"] = QueryResult class QueryCollectionResponse(ModelNormal): @@ -63,11 +68,9 @@ class QueryCollectionResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -85,13 +88,15 @@ def openapi_types(self): """ lazy_import() return { - 'pipeline': (QueryCollectionResponsePipeline,), # noqa: E501 - 'variables': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'results': ([QueryResult],), # noqa: E501 - 'total_size': (str,), # noqa: E501 - 'processing_duration': (str,), # noqa: E501 - 'aggregates': ({str: (QueryAggregateResult,)},), # noqa: E501 - 'aggregate_filters': ({str: (QueryAggregateResult,)},), # noqa: E501 + "pipeline": (QueryCollectionResponsePipeline,), # noqa: E501 + "variables": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "results": ([QueryResult],), # noqa: E501 + "total_size": (str,), # noqa: E501 + "processing_duration": (str,), # noqa: E501 + "aggregates": ({str: (QueryAggregateResult,)},), # noqa: E501 + "aggregate_filters": ({str: (QueryAggregateResult,)},), # noqa: E501 } @cached_property @@ -99,19 +104,25 @@ def discriminator(self): return None attribute_map = { - 'pipeline': 'pipeline', # noqa: E501 - 'variables': 'variables', # noqa: E501 - 'results': 'results', # noqa: E501 - 'total_size': 'total_size', # noqa: E501 - 'processing_duration': 'processing_duration', # noqa: E501 - 'aggregates': 'aggregates', # noqa: E501 - 'aggregate_filters': 'aggregate_filters', # noqa: E501 + "pipeline": "pipeline", # noqa: E501 + "variables": "variables", # noqa: E501 + "results": "results", # noqa: E501 + "total_size": "total_size", # noqa: E501 + "processing_duration": "processing_duration", # noqa: E501 + "aggregates": "aggregates", # noqa: E501 + "aggregate_filters": "aggregate_filters", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -157,15 +168,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 aggregate_filters ({str: (QueryAggregateResult,)}): The aggregates run with filters.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -181,10 +193,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_collection_response_pipeline.py b/sajari_client/model/query_collection_response_pipeline.py index e655c33..5c426e5 100644 --- a/sajari_client/model/query_collection_response_pipeline.py +++ b/sajari_client/model/query_collection_response_pipeline.py @@ -51,11 +51,9 @@ class QueryCollectionResponsePipeline(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'version': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "version": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'version': 'version', # noqa: E501 + "name": "name", # noqa: E501 + "version": "version", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -129,15 +133,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 version (str): The pipeline's version, e.g. `42`.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +158,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_result.py b/sajari_client/model/query_result.py index 79a1441..8e45ecf 100644 --- a/sajari_client/model/query_result.py +++ b/sajari_client/model/query_result.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.query_result_token import QueryResultToken - globals()['QueryResultToken'] = QueryResultToken + + globals()["QueryResultToken"] = QueryResultToken class QueryResult(ModelNormal): @@ -57,11 +58,9 @@ class QueryResult(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,10 +78,12 @@ def openapi_types(self): """ lazy_import() return { - 'record': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'score': (float,), # noqa: E501 - 'index_score': (float,), # noqa: E501 - 'token': (QueryResultToken,), # noqa: E501 + "record": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "score": (float,), # noqa: E501 + "index_score": (float,), # noqa: E501 + "token": (QueryResultToken,), # noqa: E501 } @cached_property @@ -90,16 +91,22 @@ def discriminator(self): return None attribute_map = { - 'record': 'record', # noqa: E501 - 'score': 'score', # noqa: E501 - 'index_score': 'index_score', # noqa: E501 - 'token': 'token', # noqa: E501 + "record": "record", # noqa: E501 + "score": "score", # noqa: E501 + "index_score": "index_score", # noqa: E501 + "token": "token", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -142,15 +149,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 token (QueryResultToken): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -166,10 +174,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_result_token.py b/sajari_client/model/query_result_token.py index f2934df..27d0a62 100644 --- a/sajari_client/model/query_result_token.py +++ b/sajari_client/model/query_result_token.py @@ -32,8 +32,9 @@ def lazy_import(): from sajari_client.model.query_result_token_click import QueryResultTokenClick from sajari_client.model.query_result_token_pos_neg import QueryResultTokenPosNeg - globals()['QueryResultTokenClick'] = QueryResultTokenClick - globals()['QueryResultTokenPosNeg'] = QueryResultTokenPosNeg + + globals()["QueryResultTokenClick"] = QueryResultTokenClick + globals()["QueryResultTokenPosNeg"] = QueryResultTokenPosNeg class QueryResultToken(ModelNormal): @@ -60,11 +61,9 @@ class QueryResultToken(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -82,8 +81,8 @@ def openapi_types(self): """ lazy_import() return { - 'click': (QueryResultTokenClick,), # noqa: E501 - 'pos_neg': (QueryResultTokenPosNeg,), # noqa: E501 + "click": (QueryResultTokenClick,), # noqa: E501 + "pos_neg": (QueryResultTokenPosNeg,), # noqa: E501 } @cached_property @@ -91,14 +90,20 @@ def discriminator(self): return None attribute_map = { - 'click': 'click', # noqa: E501 - 'pos_neg': 'pos_neg', # noqa: E501 + "click": "click", # noqa: E501 + "pos_neg": "pos_neg", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -139,15 +144,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 pos_neg (QueryResultTokenPosNeg): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -163,10 +169,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_result_token_click.py b/sajari_client/model/query_result_token_click.py index 8d29f38..f970345 100644 --- a/sajari_client/model/query_result_token_click.py +++ b/sajari_client/model/query_result_token_click.py @@ -51,11 +51,9 @@ class QueryResultTokenClick(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'token': (str,), # noqa: E501 + "token": (str,), # noqa: E501 } @cached_property @@ -80,13 +78,19 @@ def discriminator(self): return None attribute_map = { - 'token': 'token', # noqa: E501 + "token": "token", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -126,15 +130,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 token (str): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -150,10 +155,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/query_result_token_pos_neg.py b/sajari_client/model/query_result_token_pos_neg.py index 3facd0e..01428f0 100644 --- a/sajari_client/model/query_result_token_pos_neg.py +++ b/sajari_client/model/query_result_token_pos_neg.py @@ -51,11 +51,9 @@ class QueryResultTokenPosNeg(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'pos': (str,), # noqa: E501 - 'neg': (str,), # noqa: E501 + "pos": (str,), # noqa: E501 + "neg": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'pos': 'pos', # noqa: E501 - 'neg': 'neg', # noqa: E501 + "pos": "pos", # noqa: E501 + "neg": "neg", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -129,15 +133,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 neg (str): [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +158,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/record_key.py b/sajari_client/model/record_key.py index ac59ece..497835c 100644 --- a/sajari_client/model/record_key.py +++ b/sajari_client/model/record_key.py @@ -51,11 +51,9 @@ class RecordKey(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(self): and the value is attribute type. """ return { - 'field': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 + "field": (str,), # noqa: E501 + "value": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'field': 'field', # noqa: E501 - 'value': 'value', # noqa: E501 + "field": "field", # noqa: E501 + "value": "value", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, field, value, *args, **kwargs): # noqa: E501 @@ -131,15 +135,16 @@ def __init__(self, field, value, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -157,10 +162,12 @@ def __init__(self, field, value, *args, **kwargs): # noqa: E501 self.field = field self.value = value 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: + 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) diff --git a/sajari_client/model/schema_field.py b/sajari_client/model/schema_field.py index 3dbe58a..f64b553 100644 --- a/sajari_client/model/schema_field.py +++ b/sajari_client/model/schema_field.py @@ -32,8 +32,9 @@ def lazy_import(): from sajari_client.model.schema_field_mode import SchemaFieldMode from sajari_client.model.schema_field_type import SchemaFieldType - globals()['SchemaFieldMode'] = SchemaFieldMode - globals()['SchemaFieldType'] = SchemaFieldType + + globals()["SchemaFieldMode"] = SchemaFieldMode + globals()["SchemaFieldType"] = SchemaFieldType class SchemaField(ModelNormal): @@ -60,11 +61,9 @@ class SchemaField(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -82,12 +81,12 @@ def openapi_types(self): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'type': (SchemaFieldType,), # noqa: E501 - 'mode': (SchemaFieldMode,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'array': (bool,), # noqa: E501 - 'array_length': (int,), # noqa: E501 + "name": (str,), # noqa: E501 + "type": (SchemaFieldType,), # noqa: E501 + "mode": (SchemaFieldMode,), # noqa: E501 + "description": (str,), # noqa: E501 + "array": (bool,), # noqa: E501 + "array_length": (int,), # noqa: E501 } @cached_property @@ -95,18 +94,24 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'type': 'type', # noqa: E501 - 'mode': 'mode', # noqa: E501 - 'description': 'description', # noqa: E501 - 'array': 'array', # noqa: E501 - 'array_length': 'array_length', # noqa: E501 + "name": "name", # noqa: E501 + "type": "type", # noqa: E501 + "mode": "mode", # noqa: E501 + "description": "description", # noqa: E501 + "array": "array", # noqa: E501 + "array_length": "array_length", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, name, type, mode, *args, **kwargs): # noqa: E501 @@ -153,15 +158,16 @@ def __init__(self, name, type, mode, *args, **kwargs): # noqa: E501 array_length (int): The required length of the array, if `array` is `true`. This allows you to enforce that an array contains an exact number of items. For example, to store a 2x2 vector, you could set `type` to float, `array` to `true` and `array_length` to `4`.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -180,10 +186,12 @@ def __init__(self, name, type, mode, *args, **kwargs): # noqa: E501 self.type = type self.mode = mode 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: + 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) diff --git a/sajari_client/model/schema_field_mode.py b/sajari_client/model/schema_field_mode.py index 3dc8c37..7be5da0 100644 --- a/sajari_client/model/schema_field_mode.py +++ b/sajari_client/model/schema_field_mode.py @@ -48,16 +48,15 @@ class SchemaFieldMode(ModelSimple): """ allowed_values = { - ('value',): { - 'MODE_UNSPECIFIED': "MODE_UNSPECIFIED", - 'NULLABLE': "NULLABLE", - 'REQUIRED': "REQUIRED", - 'UNIQUE': "UNIQUE", + ("value",): { + "MODE_UNSPECIFIED": "MODE_UNSPECIFIED", + "NULLABLE": "NULLABLE", + "REQUIRED": "REQUIRED", + "UNIQUE": "UNIQUE", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -74,7 +73,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -85,8 +84,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -131,24 +136,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "MODE_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -165,7 +171,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/schema_field_type.py b/sajari_client/model/schema_field_type.py index 47b8b9d..77753ce 100644 --- a/sajari_client/model/schema_field_type.py +++ b/sajari_client/model/schema_field_type.py @@ -48,19 +48,18 @@ class SchemaFieldType(ModelSimple): """ allowed_values = { - ('value',): { - 'TYPE_UNSPECIFIED': "TYPE_UNSPECIFIED", - 'STRING': "STRING", - 'INTEGER': "INTEGER", - 'FLOAT': "FLOAT", - 'DOUBLE': "DOUBLE", - 'BOOLEAN': "BOOLEAN", - 'TIMESTAMP': "TIMESTAMP", + ("value",): { + "TYPE_UNSPECIFIED": "TYPE_UNSPECIFIED", + "STRING": "STRING", + "INTEGER": "INTEGER", + "FLOAT": "FLOAT", + "DOUBLE": "DOUBLE", + "BOOLEAN": "BOOLEAN", + "TIMESTAMP": "TIMESTAMP", }, } - validations = { - } + validations = {} additional_properties_type = None @@ -77,7 +76,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property @@ -88,8 +87,14 @@ def discriminator(self): _composed_schemas = None - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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): @@ -134,24 +139,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "TYPE_UNSPECIFIED" - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -168,7 +174,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/sajari_client/model/send_event_request.py b/sajari_client/model/send_event_request.py index e1d5b94..9f71c1d 100644 --- a/sajari_client/model/send_event_request.py +++ b/sajari_client/model/send_event_request.py @@ -51,11 +51,9 @@ class SendEventRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,10 +70,28 @@ def openapi_types(self): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'token': (str,), # noqa: E501 - 'weight': (int,), # noqa: E501 - 'metadata': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)},), + "name": (str,), # noqa: E501 + "token": (str,), # noqa: E501 + "weight": (int,), # noqa: E501 + "metadata": ( + { + str: ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) + }, + ) + }, + ), # noqa: E501 } @@ -84,16 +100,22 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'token': 'token', # noqa: E501 - 'weight': 'weight', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 + "name": "name", # noqa: E501 + "token": "token", # noqa: E501 + "weight": "weight", # noqa: E501 + "metadata": "metadata", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, name, token, *args, **kwargs): # noqa: E501 @@ -138,15 +160,16 @@ def __init__(self, name, token, *args, **kwargs): # noqa: E501 metadata ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},)}): An object made up of field-value pairs that contains additional metadata to record with the event. Every value in the object must be one of the following primitive types: - boolean - number - string. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -164,10 +187,12 @@ def __init__(self, name, token, *args, **kwargs): # noqa: E501 self.name = name self.token = token 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: + 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) diff --git a/sajari_client/model/set_default_pipeline_request.py b/sajari_client/model/set_default_pipeline_request.py index b0b84fd..5db7ef3 100644 --- a/sajari_client/model/set_default_pipeline_request.py +++ b/sajari_client/model/set_default_pipeline_request.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.pipeline_type import PipelineType - globals()['PipelineType'] = PipelineType + + globals()["PipelineType"] = PipelineType class SetDefaultPipelineRequest(ModelNormal): @@ -57,11 +58,9 @@ class SetDefaultPipelineRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,8 @@ def openapi_types(self): """ lazy_import() return { - 'type': (PipelineType,), # noqa: E501 - 'pipeline': (str,), # noqa: E501 + "type": (PipelineType,), # noqa: E501 + "pipeline": (str,), # noqa: E501 } @cached_property @@ -88,14 +87,20 @@ def discriminator(self): return None attribute_map = { - 'type': 'type', # noqa: E501 - 'pipeline': 'pipeline', # noqa: E501 + "type": "type", # noqa: E501 + "pipeline": "pipeline", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, type, pipeline, *args, **kwargs): # noqa: E501 @@ -138,15 +143,16 @@ def __init__(self, type, pipeline, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -164,10 +170,12 @@ def __init__(self, type, pipeline, *args, **kwargs): # noqa: E501 self.type = type self.pipeline = pipeline 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: + 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) diff --git a/sajari_client/model/set_default_version_request.py b/sajari_client/model/set_default_version_request.py index 91e0fef..7705c30 100644 --- a/sajari_client/model/set_default_version_request.py +++ b/sajari_client/model/set_default_version_request.py @@ -51,11 +51,9 @@ class SetDefaultVersionRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,7 +70,7 @@ def openapi_types(self): and the value is attribute type. """ return { - 'version': (str,), # noqa: E501 + "version": (str,), # noqa: E501 } @cached_property @@ -80,13 +78,19 @@ def discriminator(self): return None attribute_map = { - 'version': 'version', # noqa: E501 + "version": "version", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, version, *args, **kwargs): # noqa: E501 @@ -128,15 +132,16 @@ def __init__(self, version, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -153,10 +158,12 @@ def __init__(self, version, *args, **kwargs): # noqa: E501 self.version = version 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: + 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) diff --git a/sajari_client/model/status.py b/sajari_client/model/status.py index e388304..2919fff 100644 --- a/sajari_client/model/status.py +++ b/sajari_client/model/status.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.protobuf_any import ProtobufAny - globals()['ProtobufAny'] = ProtobufAny + + globals()["ProtobufAny"] = ProtobufAny class Status(ModelNormal): @@ -57,11 +58,9 @@ class Status(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,9 +78,9 @@ def openapi_types(self): """ lazy_import() return { - 'code': (int,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': ([ProtobufAny],), # noqa: E501 + "code": (int,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": ([ProtobufAny],), # noqa: E501 } @cached_property @@ -89,15 +88,21 @@ def discriminator(self): return None attribute_map = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -139,15 +144,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 details ([ProtobufAny]): A list of messages that carry the error details. There is a common set of message types for APIs to use.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -163,10 +169,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model/upsert_record_request.py b/sajari_client/model/upsert_record_request.py index 957320f..b50d927 100644 --- a/sajari_client/model/upsert_record_request.py +++ b/sajari_client/model/upsert_record_request.py @@ -11,7 +11,9 @@ import re # noqa: F401 import sys # noqa: F401 -from sajari_client.model.upsert_record_request_pipeline import UpsertRecordRequestPipeline +from sajari_client.model.upsert_record_request_pipeline import ( + UpsertRecordRequestPipeline, +) from sajari_client.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, @@ -29,8 +31,11 @@ def lazy_import(): - from sajari_client.model.upsert_record_request_pipeline import UpsertRecordRequestPipeline - globals()['UpsertRecordRequestPipeline'] = UpsertRecordRequestPipeline + from sajari_client.model.upsert_record_request_pipeline import ( + UpsertRecordRequestPipeline, + ) + + globals()["UpsertRecordRequestPipeline"] = UpsertRecordRequestPipeline class UpsertRecordRequest(ModelNormal): @@ -57,11 +62,9 @@ class UpsertRecordRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,9 +82,13 @@ def openapi_types(self): """ lazy_import() return { - 'record': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'pipeline': (UpsertRecordRequestPipeline,), # noqa: E501 - 'variables': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "record": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 + "pipeline": (UpsertRecordRequestPipeline,), # noqa: E501 + "variables": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 } @cached_property @@ -89,15 +96,21 @@ def discriminator(self): return None attribute_map = { - 'record': 'record', # noqa: E501 - 'pipeline': 'pipeline', # noqa: E501 - 'variables': 'variables', # noqa: E501 + "record": "record", # noqa: E501 + "pipeline": "pipeline", # noqa: E501 + "variables": "variables", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, record, *args, **kwargs): # noqa: E501 @@ -141,15 +154,16 @@ def __init__(self, record, *args, **kwargs): # noqa: E501 variables ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The initial values for the variables the pipeline operates on and transforms throughout its steps.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -166,10 +180,12 @@ def __init__(self, record, *args, **kwargs): # noqa: E501 self.record = record 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: + 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) diff --git a/sajari_client/model/upsert_record_request_pipeline.py b/sajari_client/model/upsert_record_request_pipeline.py index 4d0ca1f..1b1c80a 100644 --- a/sajari_client/model/upsert_record_request_pipeline.py +++ b/sajari_client/model/upsert_record_request_pipeline.py @@ -51,11 +51,9 @@ class UpsertRecordRequestPipeline(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -72,8 +70,8 @@ def openapi_types(): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'version': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "version": (str,), # noqa: E501 } @cached_property @@ -81,14 +79,20 @@ def discriminator(self): return None attribute_map = { - 'name': 'name', # noqa: E501 - 'version': 'version', # noqa: E501 + "name": "name", # noqa: E501 + "version": "version", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + } @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 @@ -131,15 +135,16 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 version (str): The record pipeline's version, e.g. `42`. If not provided the default version is used.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -156,10 +161,12 @@ def __init__(self, name, *args, **kwargs): # noqa: E501 self.name = name 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: + 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) diff --git a/sajari_client/model/upsert_record_response.py b/sajari_client/model/upsert_record_response.py index 40096b6..801ea4f 100644 --- a/sajari_client/model/upsert_record_response.py +++ b/sajari_client/model/upsert_record_response.py @@ -30,7 +30,8 @@ def lazy_import(): from sajari_client.model.record_key import RecordKey - globals()['RecordKey'] = RecordKey + + globals()["RecordKey"] = RecordKey class UpsertRecordResponse(ModelNormal): @@ -57,11 +58,9 @@ class UpsertRecordResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} additional_properties_type = None @@ -79,8 +78,10 @@ def openapi_types(self): """ lazy_import() return { - 'key': (RecordKey,), # noqa: E501 - 'variables': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "key": (RecordKey,), # noqa: E501 + "variables": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + ), # noqa: E501 } @cached_property @@ -88,14 +89,20 @@ def discriminator(self): return None attribute_map = { - 'key': 'key', # noqa: E501 - 'variables': 'variables', # noqa: E501 + "key": "key", # noqa: E501 + "variables": "variables", # noqa: E501 } _composed_schemas = {} - required_properties = {'_data_store', '_check_type', '_spec_property_naming', '_path_to_item', '_configuration', - '_visited_composed_classes'} + required_properties = { + "_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 @@ -136,15 +143,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 variables ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): The modified variables returned by the pipeline after it has finished processing.. [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', ()) + _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." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -160,10 +168,12 @@ def __init__(self, *args, **kwargs): # noqa: E501 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: + 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) diff --git a/sajari_client/model_utils.py b/sajari_client/model_utils.py index 5cea733..dfa6310 100644 --- a/sajari_client/model_utils.py +++ b/sajari_client/model_utils.py @@ -33,7 +33,7 @@ class cached_property(object): # this caches the result of the function call for fn with no inputs # use this as a decorator on fuction methods that you want converted # into cached properties - result_key = '_results' + result_key = "_results" def __init__(self, fn): self._fn = fn @@ -63,15 +63,12 @@ def allows_single_value_input(cls): - null TODO: lru_cache this """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: return True elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: + if not cls._composed_schemas["oneOf"]: return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"]) return False @@ -89,11 +86,11 @@ def composed_model_input_classes(cls): else: return get_discriminated_classes(cls) elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: + if not cls._composed_schemas["oneOf"]: return [] if cls.discriminator is None: input_classes = [] - for c in cls._composed_schemas['oneOf']: + for c in cls._composed_schemas["oneOf"]: input_classes.extend(composed_model_input_classes(c)) return input_classes else: @@ -116,45 +113,37 @@ def set_attribute(self, name, value): required_types_mixed = self.openapi_types[name] elif self.additional_properties_type is None: raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item + "{0} has no attribute '{1}'".format(type(self).__name__, name), + path_to_item, ) elif self.additional_properties_type is not None: required_types_mixed = self.additional_properties_type if get_simple_class(name) != str: error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True + var_name=name, var_value=name, valid_classes=(str,), key_type=True ) raise ApiTypeError( error_msg, path_to_item=path_to_item, valid_classes=(str,), - key_type=True + key_type=True, ) if self._check_type: value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), value, - self._configuration + required_types_mixed, + path_to_item, + self._spec_property_naming, + self._check_type, + configuration=self._configuration, ) - self.__dict__['_data_store'][name] = value + if (name,) in self.allowed_values: + check_allowed_values(self.allowed_values, (name,), value) + if (name,) in self.validations: + check_validations(self.validations, (name,), value, self._configuration) + self.__dict__["_data_store"][name] = value def __repr__(self): """For `print` and `pprint`""" @@ -185,14 +174,13 @@ def __new__(cls, *args, **kwargs): if issubclass(cls, ModelComposed) and allows_single_value_input(cls): model_kwargs = {} - oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) + oneof_instance = get_oneof_instance( + cls, model_kwargs, kwargs, model_arg=arg + ) return oneof_instance - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): + visited_composed_classes = kwargs.get("_visited_composed_classes", ()) + if cls.discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -222,28 +210,28 @@ def __new__(cls, *args, **kwargs): discr_value = kwargs[discr_propertyname_py] else: # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) + path_to_item = kwargs.get("_path_to_item", ()) raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" + % (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class # is a list of visited classes. get_discriminator_class may recursively # call itself and update the list of visited classes, and the initial # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) + new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) + path_to_item = kwargs.get("_path_to_item", ()) disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) + discr_propertyname_js, kwargs.get(discr_propertyname_py) + ) raise ApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" + % (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -268,13 +256,13 @@ def __new__(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) + oneof_anyof_classes = cls._composed_schemas.get( + "oneOf", () + ) + cls._composed_schemas.get("anyOf", ()) oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - if cls._composed_schemas.get('allOf') and oneof_anyof_child: + if cls._composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = super(OpenApiModel, cls).__new__(cls) @@ -302,7 +290,7 @@ def get(self, name, default=None): if name in self.required_properties: return self.__dict__[name] - return self.__dict__['_data_store'].get(name, default) + return self.__dict__["_data_store"].get(name, default) def __getitem__(self, name): """get the value of an attribute using square-bracket notation: `instance[attr]`""" @@ -310,9 +298,8 @@ def __getitem__(self, name): return self.get(name) raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) def __contains__(self, name): @@ -320,7 +307,7 @@ def __contains__(self, name): if name in self.required_properties: return name in self.__dict__ - return name in self.__dict__['_data_store'] + return name in self.__dict__["_data_store"] def to_str(self): """Returns the string representation of the model""" @@ -331,8 +318,8 @@ def __eq__(self, other): if not isinstance(other, self.__class__): return False - this_val = self._data_store['value'] - that_val = other._data_store['value'] + this_val = self._data_store["value"] + that_val = other._data_store["value"] types = set() types.add(this_val.__class__) types.add(that_val.__class__) @@ -357,7 +344,7 @@ def get(self, name, default=None): if name in self.required_properties: return self.__dict__[name] - return self.__dict__['_data_store'].get(name, default) + return self.__dict__["_data_store"].get(name, default) def __getitem__(self, name): """get the value of an attribute using square-bracket notation: `instance[attr]`""" @@ -365,9 +352,8 @@ def __getitem__(self, name): return self.get(name) raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) def __contains__(self, name): @@ -375,7 +361,7 @@ def __contains__(self, name): if name in self.required_properties: return name in self.__dict__ - return name in self.__dict__['_data_store'] + return name in self.__dict__["_data_store"] def to_dict(self): """Returns the model properties as a dict""" @@ -437,7 +423,8 @@ def __setitem__(self, name, value): # set the attribute on the correct instance model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + name, self._additional_properties_model_instances + ) if model_instances: for model_instance in model_instances: if model_instance == self: @@ -446,15 +433,12 @@ def __setitem__(self, name, value): setattr(model_instance, name, value) if name not in self._var_name_to_model_instances: # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = ( - model_instance - ) + self.__dict__["_var_name_to_model_instances"][name] = model_instance return None raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) __unset_attribute_value__ = object() @@ -466,7 +450,8 @@ def get(self, name, default=None): # get the attribute from the correct instance model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + name, self._additional_properties_model_instances + ) values = [] # A composed model stores child (oneof/anyOf/allOf) models under # self._var_name_to_model_instances. A named property can exist in @@ -488,7 +473,7 @@ def get(self, name, default=None): "Values stored for property {0} in {1} differ when looking " "at self and self's composed instances. All values must be " "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] + [e for e in [self._path_to_item, name] if e], ) def __getitem__(self, name): @@ -496,9 +481,8 @@ def __getitem__(self, name): value = self.get(name, self.__unset_attribute_value__) if value is self.__unset_attribute_value__: raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) return value @@ -509,7 +493,8 @@ def __contains__(self, name): return name in self.__dict__ model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + name, self._additional_properties_model_instances + ) if model_instances: for model_instance in model_instances: @@ -566,7 +551,10 @@ def __eq__(self, other): UPCONVERSION_TYPE_PAIRS = ( (str, datetime), (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. + ( + int, + float, + ), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), (str, ModelComposed), @@ -613,7 +601,7 @@ def __eq__(self, other): (str, date), # (int, str), # (float, str), - (str, file_type) + (str, file_type), ), } @@ -670,41 +658,41 @@ def check_allowed_values(allowed_values, input_variable_path, input_values): are checking to see if they are in allowed_values """ these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), + if isinstance(input_values, list) and not set(input_values).issubset( + set(these_allowed_values) + ): + invalid_values = ( + ", ".join(map(str, set(input_values) - set(these_allowed_values))), + ) raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( + "Invalid values for `%s` [%s], must be a subset of [%s]" + % ( input_variable_path[0], invalid_values, - ", ".join(map(str, these_allowed_values)) + ", ".join(map(str, these_allowed_values)), ) ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): + elif isinstance(input_values, dict) and not set(input_values.keys()).issubset( + set(these_allowed_values) + ): invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) + map(str, set(input_values.keys()) - set(these_allowed_values)) + ) raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( + "Invalid keys in `%s` [%s], must be a subset of [%s]" + % ( input_variable_path[0], invalid_values, - ", ".join(map(str, these_allowed_values)) + ", ".join(map(str, these_allowed_values)), ) ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): + elif ( + not isinstance(input_values, (list, dict)) + and input_values not in these_allowed_values + ): raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) + "Invalid value for `%s` (%s), must be one of %s" + % (input_variable_path[0], input_values, these_allowed_values) ) @@ -718,14 +706,16 @@ def is_json_validation_enabled(schema_keyword, configuration=None): configuration (Configuration): the configuration class. """ - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) + return ( + configuration is None + or not hasattr(configuration, "_disabled_client_side_validations") + or schema_keyword not in configuration._disabled_client_side_validations + ) def check_validations( - validations, input_variable_path, input_values, - configuration=None): + validations, input_variable_path, input_values, configuration=None +): """Raises an exception if the input_values are invalid Args: @@ -740,66 +730,65 @@ def check_validations( return current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): + if ( + is_json_validation_enabled("multipleOf", configuration) + and "multiple_of" in current_validations + and isinstance(input_values, (int, float)) + and not (float(input_values) / current_validations["multiple_of"]).is_integer() + ): # Note 'multipleOf' will be as good as the floating point arithmetic. raise ApiValueError( "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) + "`%s`" % (input_variable_path[0], current_validations["multiple_of"]) ) - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): + if ( + is_json_validation_enabled("maxLength", configuration) + and "max_length" in current_validations + and len(input_values) > current_validations["max_length"] + ): raise ApiValueError( "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) + "`%s`" % (input_variable_path[0], current_validations["max_length"]) ) - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): + if ( + is_json_validation_enabled("minLength", configuration) + and "min_length" in current_validations + and len(input_values) < current_validations["min_length"] + ): raise ApiValueError( "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) + "`%s`" % (input_variable_path[0], current_validations["min_length"]) ) - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): + if ( + is_json_validation_enabled("maxItems", configuration) + and "max_items" in current_validations + and len(input_values) > current_validations["max_items"] + ): raise ApiValueError( "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) + "equal to `%s`" % (input_variable_path[0], current_validations["max_items"]) ) - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): + if ( + is_json_validation_enabled("minItems", configuration) + and "min_items" in current_validations + and len(input_values) < current_validations["min_items"] + ): raise ValueError( "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) + "equal to `%s`" % (input_variable_path[0], current_validations["min_items"]) ) - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): + items = ( + "exclusive_maximum", + "inclusive_maximum", + "exclusive_minimum", + "inclusive_minimum", + ) + if any(item in current_validations for item in items): if isinstance(input_values, list): max_val = max(input_values) min_val = min(input_values) @@ -810,56 +799,57 @@ def check_validations( max_val = input_values min_val = input_values - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): + if ( + is_json_validation_enabled("exclusiveMaximum", configuration) + and "exclusive_maximum" in current_validations + and max_val >= current_validations["exclusive_maximum"] + ): raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) + "Invalid value for `%s`, must be a value less than `%s`" + % (input_variable_path[0], current_validations["exclusive_maximum"]) ) - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): + if ( + is_json_validation_enabled("maximum", configuration) + and "inclusive_maximum" in current_validations + and max_val > current_validations["inclusive_maximum"] + ): raise ApiValueError( "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) + "`%s`" % (input_variable_path[0], current_validations["inclusive_maximum"]) ) - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): + if ( + is_json_validation_enabled("exclusiveMinimum", configuration) + and "exclusive_minimum" in current_validations + and min_val <= current_validations["exclusive_minimum"] + ): raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) + "Invalid value for `%s`, must be a value greater than `%s`" + % (input_variable_path[0], current_validations["exclusive_maximum"]) ) - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): + if ( + is_json_validation_enabled("minimum", configuration) + and "inclusive_minimum" in current_validations + and min_val < current_validations["inclusive_minimum"] + ): raise ApiValueError( "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) + "to `%s`" + % (input_variable_path[0], current_validations["inclusive_minimum"]) ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): + flags = current_validations.get("regex", {}).get("flags", 0) + if ( + is_json_validation_enabled("pattern", configuration) + and "regex" in current_validations + and not re.search( + current_validations["regex"]["pattern"], input_values, flags=flags + ) + ): err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( input_variable_path[0], - current_validations['regex']['pattern'] + current_validations["regex"]["pattern"], ) if flags != 0: # Don't print the regex flags if the flags are not @@ -885,28 +875,31 @@ def index_getter(class_or_instance): return COERCION_INDEX_BY_TYPE[list] elif isinstance(class_or_instance, dict): return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): + elif inspect.isclass(class_or_instance) and issubclass( + class_or_instance, ModelComposed + ): return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): + elif inspect.isclass(class_or_instance) and issubclass( + class_or_instance, ModelNormal + ): return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): + elif inspect.isclass(class_or_instance) and issubclass( + class_or_instance, ModelSimple + ): return COERCION_INDEX_BY_TYPE[ModelSimple] elif class_or_instance in COERCION_INDEX_BY_TYPE: return COERCION_INDEX_BY_TYPE[class_or_instance] raise ApiValueError("Unsupported type: %s" % class_or_instance) sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) + required_types, key=lambda class_or_instance: index_getter(class_or_instance) ) return sorted_types -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): +def remove_uncoercible( + required_types_classes, current_item, spec_property_naming, must_convert=True +): """Only keeps the type conversions that are possible Args: @@ -962,7 +955,7 @@ def get_discriminated_classes(cls): if is_type_nullable(cls): possible_classes.append(cls) for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + if hasattr(discr_cls, "discriminator") and discr_cls.discriminator is not None: possible_classes.extend(get_discriminated_classes(discr_cls)) else: possible_classes.append(discr_cls) @@ -974,7 +967,7 @@ def get_possible_classes(cls, from_server_context): possible_classes = [cls] if from_server_context: return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: + if hasattr(cls, "discriminator") and cls.discriminator is not None: possible_classes = [] possible_classes.extend(get_discriminated_classes(cls)) elif issubclass(cls, ModelComposed): @@ -1016,7 +1009,9 @@ def get_required_type_classes(required_types_mixed, spec_property_naming): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) + valid_classes.extend( + get_possible_classes(required_type, spec_property_naming) + ) return tuple(valid_classes), child_req_types_by_current_type @@ -1030,11 +1025,10 @@ def change_keys_js_to_python(input_dict, model_class): document). """ - if getattr(model_class, 'attribute_map', None) is None: + if getattr(model_class, "attribute_map", None) is None: return input_dict output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} + reversed_attr_map = {value: key for key, value in model_class.attribute_map.items()} for javascript_key, value in input_dict.items(): python_key = reversed_attr_map.get(javascript_key) if python_key is None: @@ -1050,13 +1044,13 @@ def get_type_error(var_value, path_to_item, valid_classes, key_type=False): var_name=path_to_item[-1], var_value=var_value, valid_classes=valid_classes, - key_type=key_type + key_type=key_type, ) return ApiTypeError( error_msg, path_to_item=path_to_item, valid_classes=valid_classes, - key_type=key_type + key_type=key_type, ) @@ -1082,11 +1076,11 @@ def deserialize_primitive(data, klass, path_to_item): # The string should be in iso8601 datetime format. parsed_datetime = parse(data) date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 + parsed_datetime.hour == 0 + and parsed_datetime.minute == 0 + and parsed_datetime.second == 0 + and parsed_datetime.tzinfo is None + and 8 <= len(data) <= 10 ) if date_only: raise ValueError("This is a date, not a datetime") @@ -1100,7 +1094,7 @@ def deserialize_primitive(data, klass, path_to_item): if isinstance(data, str) and klass == float: if str(converted_value) != data: # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') + raise ValueError("This is not a float") return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError @@ -1108,13 +1102,11 @@ def deserialize_primitive(data, klass, path_to_item): "{0}Failed to parse {1} as {2}".format( additional_message, repr(data), klass.__name__ ), - path_to_item=path_to_item + path_to_item=path_to_item, ) from ex -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): +def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): """Returns the child class specified by the discriminator. Args: @@ -1150,22 +1142,30 @@ def get_discriminator_class(model_class, # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig # if we try to make BasquePig from mammal, we need to travel through # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) + descendant_classes = model_class._composed_schemas.get( + "oneOf", () + ) + model_class._composed_schemas.get("anyOf", ()) + ancestor_classes = model_class._composed_schemas.get("allOf", ()) possible_classes = descendant_classes + ancestor_classes for cls in possible_classes: # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: + if hasattr(cls, "discriminator") and cls.discriminator is not None: used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) + cls, discr_name, discr_value, cls_visited + ) if used_model_class is not None: return used_model_class return used_model_class -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): +def deserialize_model( + model_data, + model_class, + path_to_item, + check_type, + configuration, + spec_property_naming, +): """Deserializes model_data to model instance. Args: @@ -1189,10 +1189,12 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, ApiKeyError """ - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) + kw_args = dict( + _check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _spec_property_naming=spec_property_naming, + ) if issubclass(model_class, ModelSimple): return model_class(model_data, **kw_args) @@ -1228,23 +1230,31 @@ def deserialize_file(response_data, configuration, content_disposition=None): os.remove(path) if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + filename = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition + ).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: if isinstance(response_data, str): # change str to bytes so we can write it - response_data = response_data.encode('utf-8') + response_data = response_data.encode("utf-8") f.write(response_data) f = open(path, "rb") return f -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): +def attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + spec_property_naming, + key_type=False, + must_convert=False, + check_type=True, +): """ Args: input_value (any): the data to convert @@ -1270,23 +1280,29 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, """ valid_classes_ordered = order_response_types(valid_classes) valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) + valid_classes_ordered, input_value, spec_property_naming + ) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) + raise get_type_error( + input_value, path_to_item, valid_classes, key_type=key_type + ) for valid_class in valid_classes_coercible: try: if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) + return deserialize_model( + input_value, + valid_class, + path_to_item, + check_type, + configuration, + spec_property_naming, + ) elif valid_class == file_type: return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) + return deserialize_primitive(input_value, valid_class, path_to_item) except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: if must_convert: raise conversion_exc @@ -1318,10 +1334,12 @@ def is_type_nullable(input_type): return True if issubclass(input_type, ModelComposed): # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True + for t in input_type._composed_schemas.get("oneOf", ()): + if is_type_nullable(t): + return True + for t in input_type._composed_schemas.get("anyOf", ()): + if is_type_nullable(t): + return True return False @@ -1337,26 +1355,34 @@ def is_valid_type(input_class_simple, valid_classes): """ valid_type = input_class_simple in valid_classes if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): + issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type + ): for valid_class in valid_classes: if input_class_simple is none_type and is_type_nullable(valid_class): # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. return True - if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): + if not ( + issubclass(valid_class, OpenApiModel) and valid_class.discriminator + ): continue discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) + discriminator_classes = valid_class.discriminator[ + discr_propertyname_py + ].values() valid_type = is_valid_type(input_class_simple, discriminator_classes) if valid_type: return True return valid_type -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): +def validate_and_convert_types( + input_value, + required_types_mixed, + path_to_item, + spec_property_naming, + _check_type, + configuration=None, +): """Raises a TypeError is there is a problem, otherwise returns value Args: @@ -1401,18 +1427,20 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, key_type=False, must_convert=True, - check_type=_check_type + check_type=_check_type, ) return converted_instance else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) + raise get_type_error( + input_value, path_to_item, valid_classes, key_type=False + ) # input_value's type is in valid_classes if len(valid_classes) > 1 and configuration: # there are valid classes which are not the current class valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) + valid_classes, input_value, spec_property_naming, must_convert=False + ) if valid_classes_coercible: converted_instance = attempt_convert_item( input_value, @@ -1422,7 +1450,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, key_type=False, must_convert=False, - check_type=_check_type + check_type=_check_type, ) return converted_instance @@ -1430,9 +1458,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, # all types are of the required types and there are no more inner # variables left to look at return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) + inner_required_types = child_req_types_by_current_type.get(type(input_value)) if inner_required_types is None: # for this type, there are not more inner variables left to look at return input_value @@ -1449,7 +1475,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_path, spec_property_naming, _check_type, - configuration=configuration + configuration=configuration, ) elif isinstance(input_value, dict): if input_value == {}: @@ -1459,15 +1485,16 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) + raise get_type_error( + inner_key, inner_path, valid_classes, key_type=True + ) input_value[inner_key] = validate_and_convert_types( inner_val, inner_required_types, inner_path, spec_property_naming, _check_type, - configuration=configuration + configuration=configuration, ) return input_value @@ -1509,15 +1536,20 @@ def model_to_dict(model_instance, serialize=True): res.append(model_to_dict(v, serialize=serialize)) result[attr] = res elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: ( + item[0], + model_to_dict(item[1], serialize=serialize), + ) + if hasattr(item[1], "_data_store") + else item, + value.items(), + ) + ) elif isinstance(value, ModelSimple): result[attr] = value.value - elif hasattr(value, '_data_store'): + elif hasattr(value, "_data_store"): result[attr] = model_to_dict(value, serialize=serialize) else: result[attr] = value @@ -1525,8 +1557,9 @@ def model_to_dict(model_instance, serialize=True): return result -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): +def type_error_message( + var_value=None, var_name=None, valid_classes=None, key_type=None +): """ Keyword Args: var_value (any): the variable which has the type_error @@ -1537,9 +1570,9 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, True if it is a key in a dict False if our item is an item in a list """ - key_or_value = 'value' + key_or_value = "value" if key_type: - key_or_value = 'key' + key_or_value = "key" valid_classes_phrase = get_valid_classes_phrase(valid_classes) msg = ( "Invalid type for variable '{0}'. Required {1} type {2} and " @@ -1554,18 +1587,18 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ + """Returns a string phrase describing what types are allowed""" all_classes = list(input_classes) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) + return "is {0}".format(all_class_names[0]) return "is one of [{0}]".format(", ".join(all_class_names)) def convert_js_args_to_python_args(fn): from functools import wraps + @wraps(fn) def wrapped_init(_self, *args, **kwargs): """ @@ -1573,7 +1606,7 @@ def wrapped_init(_self, *args, **kwargs): parameter of a class method. During generation, `self` attributes are mapped to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. """ - spec_property_naming = kwargs.get('_spec_property_naming', False) + spec_property_naming = kwargs.get("_spec_property_naming", False) if spec_property_naming: kwargs = change_keys_js_to_python(kwargs, _self.__class__) return fn(_self, *args, **kwargs) @@ -1594,7 +1627,7 @@ def get_allof_instances(self, model_args, constant_args): composed_instances (list) """ composed_instances = [] - for allof_class in self._composed_schemas['allOf']: + for allof_class in self._composed_schemas["allOf"]: # no need to handle changing js keys to python because # for composed schemas, allof parameters are included in the @@ -1615,11 +1648,12 @@ def get_allof_instances(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( + "schema '%s'. Error=%s" + % ( allof_class.__name__, allof_class.__name__, self.__class__.__name__, - str(ex) + str(ex), ) ) from ex return composed_instances @@ -1653,13 +1687,13 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): Returns oneof_instance (instance) """ - if len(cls._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas["oneOf"]) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas["oneOf"]: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1671,8 +1705,7 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): if not single_value_input: # transform js keys from input data to python keys in fixed_model_args - fixed_model_args = change_keys_js_to_python( - model_kwargs, oneof_class) + fixed_model_args = change_keys_js_to_python(model_kwargs, oneof_class) # Extract a dict with the properties that are declared in the oneOf schema. # Undeclared properties (e.g. properties that are allowed because of the @@ -1701,10 +1734,10 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): oneof_instance = validate_and_convert_types( model_arg, (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] + constant_kwargs["_path_to_item"], + constant_kwargs["_spec_property_naming"], + constant_kwargs["_check_type"], + configuration=constant_kwargs["_configuration"], ) oneof_instances.append(oneof_instance) except Exception: @@ -1712,14 +1745,13 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): if len(oneof_instances) == 0: raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ + "of the oneOf schemas matched the input data." % cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ + "oneOf schemas matched the inputs, but a max of one is allowed." + % cls.__name__ ) return oneof_instances[0] @@ -1739,10 +1771,10 @@ def get_anyof_instances(self, model_args, constant_args): anyof_instances (list) """ anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: + if len(self._composed_schemas["anyOf"]) == 0: return anyof_instances - for anyof_class in self._composed_schemas['anyOf']: + for anyof_class in self._composed_schemas["anyOf"]: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if anyof_class is none_type: @@ -1774,14 +1806,12 @@ def get_anyof_instances(self, model_args, constant_args): if len(anyof_instances) == 0: raise ApiValueError( "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ + "anyOf schemas matched the inputs." % self.__class__.__name__ ) return anyof_instances -def get_additional_properties_model_instances( - composed_instances, self): +def get_additional_properties_model_instances(composed_instances, self): additional_properties_model_instances = [] all_instances = [self] all_instances.extend(composed_instances) @@ -1812,7 +1842,7 @@ def get_unused_args(self, composed_instances, model_args): if var_name_py in unused_args: del unused_args[var_name_py] for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: + if instance.__class__ in self._composed_schemas["allOf"]: for var_name_py in instance.attribute_map: if var_name_py in unused_args: del unused_args[var_name_py] @@ -1867,19 +1897,23 @@ def validate_get_composed_info(constant_args, model_args, self): # map variable names to composed_instances var_name_to_model_instances = get_var_name_to_model_instances( - self, composed_instances) + self, composed_instances + ) # set additional_properties_model_instances - additional_properties_model_instances = ( - get_additional_properties_model_instances(composed_instances, self) + additional_properties_model_instances = get_additional_properties_model_instances( + composed_instances, self ) # set any remaining values unused_args = get_unused_args(self, composed_instances, model_args) - if len(unused_args) > 0 and \ - len(additional_properties_model_instances) == 0 and \ - (self._configuration is None or - not self._configuration.discard_unknown_keys): + if ( + len(unused_args) > 0 + and len(additional_properties_model_instances) == 0 + and ( + self._configuration is None or not self._configuration.discard_unknown_keys + ) + ): raise ApiValueError( "Invalid input arguments input when making an instance of " "class %s. Not all inputs were used. The unused input data " @@ -1895,5 +1929,5 @@ def validate_get_composed_info(constant_args, model_args, self): composed_instances, var_name_to_model_instances, additional_properties_model_instances, - unused_args + unused_args, ] diff --git a/sajari_client/models/__init__.py b/sajari_client/models/__init__.py index f512bce..9cdbfdc 100644 --- a/sajari_client/models/__init__.py +++ b/sajari_client/models/__init__.py @@ -8,4 +8,3 @@ # or import this package, but before doing it, use: # import sys # sys.setrecursionlimit(n) - diff --git a/sajari_client/rest.py b/sajari_client/rest.py index 92d722b..a85b506 100644 --- a/sajari_client/rest.py +++ b/sajari_client/rest.py @@ -17,14 +17,19 @@ import urllib3 -from sajari_client.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, \ - ServiceException, ApiValueError +from sajari_client.exceptions import ( + ApiException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException, + ApiValueError, +) logger = logging.getLogger(__name__) class RESTResponse(io.IOBase): - def __init__(self, resp): self.urllib3_response = resp self.status = resp.status @@ -41,7 +46,6 @@ def getheader(self, name, default=None): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 @@ -57,13 +61,15 @@ def __init__(self, configuration, pools_size=4, maxsize=None): addition_pool_args = {} if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + addition_pool_args[ + "assert_hostname" + ] = configuration.assert_hostname # noqa: E501 if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + addition_pool_args["retries"] = configuration.retries if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + addition_pool_args["socket_options"] = configuration.socket_options if maxsize is None: if configuration.connection_pool_maxsize is not None: @@ -95,9 +101,17 @@ def __init__(self, configuration, pools_size=4, maxsize=None): **addition_pool_args ) - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + def request( + self, + method, + url, + query_params=None, + headers=None, + body=None, + post_params=None, + _preload_content=True, + _request_timeout=None, + ): """Perform requests. :param method: http request method @@ -117,8 +131,7 @@ def request(self, method, url, query_params=None, headers=None, (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] if post_params and body: raise ApiValueError( @@ -132,60 +145,70 @@ def request(self, method, url, query_params=None, headers=None, if _request_timeout: if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], read=_request_timeout[1] + ) - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): + url += "?" + urlencode(query_params) + if re.search("json", headers["Content-Type"], re.IGNORECASE): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + ) + elif ( + headers["Content-Type"] == "application/x-www-form-urlencoded" + ): # noqa: E501 r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + ) + elif headers["Content-Type"] == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. - del headers['Content-Type'] + del headers["Content-Type"] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + ) # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( - method, url, + method, + url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + ) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -194,11 +217,14 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers, + ) except urllib3.exceptions.SSLError as e: msg = "{0}\n{1}".format(type(e).__name__, str(e)) raise ApiException(status=0, reason=msg) @@ -226,67 +252,139 @@ def request(self, method, url, query_params=None, headers=None, return r - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + def GET( + self, + url, + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "GET", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + def HEAD( + self, + url, + headers=None, + query_params=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "HEAD", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + def OPTIONS( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "OPTIONS", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def DELETE( + self, + url, + headers=None, + query_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "DELETE", + url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def POST( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "POST", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def PUT( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "PUT", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def PATCH( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "PATCH", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) diff --git a/setup.py b/setup.py index 20cd98b..b642d85 100644 --- a/setup.py +++ b/setup.py @@ -21,8 +21,8 @@ # http://pypi.python.org/pypi/setuptools REQUIRES = [ - "urllib3 >= 1.25.3", - "python-dateutil", + "urllib3 >= 1.25.3", + "python-dateutil", ] setup( @@ -39,5 +39,5 @@ include_package_data=True, long_description="""\ Sajari is a smart, highly-configurable, real-time search service that enables thousands of businesses worldwide to provide amazing search experiences on their websites, stores, and applications. # noqa: E501 - """ + """, ) diff --git a/test/test_batch_create_schema_fields_request.py b/test/test_batch_create_schema_fields_request.py index ccc3550..eb418a7 100644 --- a/test/test_batch_create_schema_fields_request.py +++ b/test/test_batch_create_schema_fields_request.py @@ -14,8 +14,11 @@ import sajari_client from sajari_client.model.schema_field import SchemaField -globals()['SchemaField'] = SchemaField -from sajari_client.model.batch_create_schema_fields_request import BatchCreateSchemaFieldsRequest + +globals()["SchemaField"] = SchemaField +from sajari_client.model.batch_create_schema_fields_request import ( + BatchCreateSchemaFieldsRequest, +) class TestBatchCreateSchemaFieldsRequest(unittest.TestCase): @@ -34,5 +37,5 @@ def testBatchCreateSchemaFieldsRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_create_schema_fields_response.py b/test/test_batch_create_schema_fields_response.py index 88e3cf6..8d58158 100644 --- a/test/test_batch_create_schema_fields_response.py +++ b/test/test_batch_create_schema_fields_response.py @@ -13,11 +13,16 @@ import unittest import sajari_client -from sajari_client.model.batch_create_schema_fields_response_error import BatchCreateSchemaFieldsResponseError +from sajari_client.model.batch_create_schema_fields_response_error import ( + BatchCreateSchemaFieldsResponseError, +) from sajari_client.model.schema_field import SchemaField -globals()['BatchCreateSchemaFieldsResponseError'] = BatchCreateSchemaFieldsResponseError -globals()['SchemaField'] = SchemaField -from sajari_client.model.batch_create_schema_fields_response import BatchCreateSchemaFieldsResponse + +globals()["BatchCreateSchemaFieldsResponseError"] = BatchCreateSchemaFieldsResponseError +globals()["SchemaField"] = SchemaField +from sajari_client.model.batch_create_schema_fields_response import ( + BatchCreateSchemaFieldsResponse, +) class TestBatchCreateSchemaFieldsResponse(unittest.TestCase): @@ -36,5 +41,5 @@ def testBatchCreateSchemaFieldsResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_create_schema_fields_response_error.py b/test/test_batch_create_schema_fields_response_error.py index f74f006..36dcf4c 100644 --- a/test/test_batch_create_schema_fields_response_error.py +++ b/test/test_batch_create_schema_fields_response_error.py @@ -14,8 +14,11 @@ import sajari_client from sajari_client.model.status import Status -globals()['Status'] = Status -from sajari_client.model.batch_create_schema_fields_response_error import BatchCreateSchemaFieldsResponseError + +globals()["Status"] = Status +from sajari_client.model.batch_create_schema_fields_response_error import ( + BatchCreateSchemaFieldsResponseError, +) class TestBatchCreateSchemaFieldsResponseError(unittest.TestCase): @@ -34,5 +37,5 @@ def testBatchCreateSchemaFieldsResponseError(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_upsert_records_request.py b/test/test_batch_upsert_records_request.py index cb0ae10..b287300 100644 --- a/test/test_batch_upsert_records_request.py +++ b/test/test_batch_upsert_records_request.py @@ -13,8 +13,11 @@ import unittest import sajari_client -from sajari_client.model.batch_upsert_records_request_pipeline import BatchUpsertRecordsRequestPipeline -globals()['BatchUpsertRecordsRequestPipeline'] = BatchUpsertRecordsRequestPipeline +from sajari_client.model.batch_upsert_records_request_pipeline import ( + BatchUpsertRecordsRequestPipeline, +) + +globals()["BatchUpsertRecordsRequestPipeline"] = BatchUpsertRecordsRequestPipeline from sajari_client.model.batch_upsert_records_request import BatchUpsertRecordsRequest @@ -34,5 +37,5 @@ def testBatchUpsertRecordsRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_upsert_records_request_pipeline.py b/test/test_batch_upsert_records_request_pipeline.py index 2e98f0f..1795666 100644 --- a/test/test_batch_upsert_records_request_pipeline.py +++ b/test/test_batch_upsert_records_request_pipeline.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.batch_upsert_records_request_pipeline import BatchUpsertRecordsRequestPipeline +from sajari_client.model.batch_upsert_records_request_pipeline import ( + BatchUpsertRecordsRequestPipeline, +) class TestBatchUpsertRecordsRequestPipeline(unittest.TestCase): @@ -32,5 +34,5 @@ def testBatchUpsertRecordsRequestPipeline(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_upsert_records_response.py b/test/test_batch_upsert_records_response.py index b9c905b..2f4f582 100644 --- a/test/test_batch_upsert_records_response.py +++ b/test/test_batch_upsert_records_response.py @@ -13,12 +13,19 @@ import unittest import sajari_client -from sajari_client.model.batch_upsert_records_response_error import BatchUpsertRecordsResponseError -from sajari_client.model.batch_upsert_records_response_key import BatchUpsertRecordsResponseKey -from sajari_client.model.batch_upsert_records_response_variables import BatchUpsertRecordsResponseVariables -globals()['BatchUpsertRecordsResponseError'] = BatchUpsertRecordsResponseError -globals()['BatchUpsertRecordsResponseKey'] = BatchUpsertRecordsResponseKey -globals()['BatchUpsertRecordsResponseVariables'] = BatchUpsertRecordsResponseVariables +from sajari_client.model.batch_upsert_records_response_error import ( + BatchUpsertRecordsResponseError, +) +from sajari_client.model.batch_upsert_records_response_key import ( + BatchUpsertRecordsResponseKey, +) +from sajari_client.model.batch_upsert_records_response_variables import ( + BatchUpsertRecordsResponseVariables, +) + +globals()["BatchUpsertRecordsResponseError"] = BatchUpsertRecordsResponseError +globals()["BatchUpsertRecordsResponseKey"] = BatchUpsertRecordsResponseKey +globals()["BatchUpsertRecordsResponseVariables"] = BatchUpsertRecordsResponseVariables from sajari_client.model.batch_upsert_records_response import BatchUpsertRecordsResponse @@ -38,5 +45,5 @@ def testBatchUpsertRecordsResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_upsert_records_response_error.py b/test/test_batch_upsert_records_response_error.py index 424a570..d823fe5 100644 --- a/test/test_batch_upsert_records_response_error.py +++ b/test/test_batch_upsert_records_response_error.py @@ -14,8 +14,11 @@ import sajari_client from sajari_client.model.status import Status -globals()['Status'] = Status -from sajari_client.model.batch_upsert_records_response_error import BatchUpsertRecordsResponseError + +globals()["Status"] = Status +from sajari_client.model.batch_upsert_records_response_error import ( + BatchUpsertRecordsResponseError, +) class TestBatchUpsertRecordsResponseError(unittest.TestCase): @@ -34,5 +37,5 @@ def testBatchUpsertRecordsResponseError(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_upsert_records_response_key.py b/test/test_batch_upsert_records_response_key.py index 6282828..7bb9598 100644 --- a/test/test_batch_upsert_records_response_key.py +++ b/test/test_batch_upsert_records_response_key.py @@ -14,8 +14,11 @@ import sajari_client from sajari_client.model.record_key import RecordKey -globals()['RecordKey'] = RecordKey -from sajari_client.model.batch_upsert_records_response_key import BatchUpsertRecordsResponseKey + +globals()["RecordKey"] = RecordKey +from sajari_client.model.batch_upsert_records_response_key import ( + BatchUpsertRecordsResponseKey, +) class TestBatchUpsertRecordsResponseKey(unittest.TestCase): @@ -34,5 +37,5 @@ def testBatchUpsertRecordsResponseKey(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_batch_upsert_records_response_variables.py b/test/test_batch_upsert_records_response_variables.py index 1ad534e..a8f3dfb 100644 --- a/test/test_batch_upsert_records_response_variables.py +++ b/test/test_batch_upsert_records_response_variables.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.batch_upsert_records_response_variables import BatchUpsertRecordsResponseVariables +from sajari_client.model.batch_upsert_records_response_variables import ( + BatchUpsertRecordsResponseVariables, +) class TestBatchUpsertRecordsResponseVariables(unittest.TestCase): @@ -32,5 +34,5 @@ def testBatchUpsertRecordsResponseVariables(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_collection.py b/test/test_collection.py index 38e6726..2381b1a 100644 --- a/test/test_collection.py +++ b/test/test_collection.py @@ -32,5 +32,5 @@ def testCollection(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_collections_api.py b/test/test_collections_api.py index 09d2f98..8da079e 100644 --- a/test/test_collections_api.py +++ b/test/test_collections_api.py @@ -67,5 +67,5 @@ def test_update_collection(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_delete_record_request.py b/test/test_delete_record_request.py index 62f6994..7a12693 100644 --- a/test/test_delete_record_request.py +++ b/test/test_delete_record_request.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.record_key import RecordKey -globals()['RecordKey'] = RecordKey + +globals()["RecordKey"] = RecordKey from sajari_client.model.delete_record_request import DeleteRecordRequest @@ -34,5 +35,5 @@ def testDeleteRecordRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_error.py b/test/test_error.py index f136f84..0de8104 100644 --- a/test/test_error.py +++ b/test/test_error.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.protobuf_any import ProtobufAny -globals()['ProtobufAny'] = ProtobufAny + +globals()["ProtobufAny"] = ProtobufAny from sajari_client.model.error import Error @@ -34,5 +35,5 @@ def testError(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_events_api.py b/test/test_events_api.py index 153e3cc..6818fa3 100644 --- a/test/test_events_api.py +++ b/test/test_events_api.py @@ -32,5 +32,5 @@ def test_send_event(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_generate_pipelines_request.py b/test/test_generate_pipelines_request.py index 46451aa..b01376b 100644 --- a/test/test_generate_pipelines_request.py +++ b/test/test_generate_pipelines_request.py @@ -32,5 +32,5 @@ def testGeneratePipelinesRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_generate_pipelines_response.py b/test/test_generate_pipelines_response.py index 6398023..bf73740 100644 --- a/test/test_generate_pipelines_response.py +++ b/test/test_generate_pipelines_response.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.pipeline import Pipeline -globals()['Pipeline'] = Pipeline + +globals()["Pipeline"] = Pipeline from sajari_client.model.generate_pipelines_response import GeneratePipelinesResponse @@ -34,5 +35,5 @@ def testGeneratePipelinesResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_get_default_pipeline_response.py b/test/test_get_default_pipeline_response.py index e765c48..35acc1d 100644 --- a/test/test_get_default_pipeline_response.py +++ b/test/test_get_default_pipeline_response.py @@ -32,5 +32,5 @@ def testGetDefaultPipelineResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_get_default_version_request_view.py b/test/test_get_default_version_request_view.py index 035b297..8419e24 100644 --- a/test/test_get_default_version_request_view.py +++ b/test/test_get_default_version_request_view.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.get_default_version_request_view import GetDefaultVersionRequestView +from sajari_client.model.get_default_version_request_view import ( + GetDefaultVersionRequestView, +) class TestGetDefaultVersionRequestView(unittest.TestCase): @@ -32,5 +34,5 @@ def testGetDefaultVersionRequestView(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_get_pipeline_request_view.py b/test/test_get_pipeline_request_view.py index f19c0df..45e0db6 100644 --- a/test/test_get_pipeline_request_view.py +++ b/test/test_get_pipeline_request_view.py @@ -32,5 +32,5 @@ def testGetPipelineRequestView(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_get_record_request.py b/test/test_get_record_request.py index 6c12399..890b238 100644 --- a/test/test_get_record_request.py +++ b/test/test_get_record_request.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.record_key import RecordKey -globals()['RecordKey'] = RecordKey + +globals()["RecordKey"] = RecordKey from sajari_client.model.get_record_request import GetRecordRequest @@ -34,5 +35,5 @@ def testGetRecordRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_list_collections_response.py b/test/test_list_collections_response.py index b72ab0f..3a088ab 100644 --- a/test/test_list_collections_response.py +++ b/test/test_list_collections_response.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.collection import Collection -globals()['Collection'] = Collection + +globals()["Collection"] = Collection from sajari_client.model.list_collections_response import ListCollectionsResponse @@ -34,5 +35,5 @@ def testListCollectionsResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_list_pipelines_request_view.py b/test/test_list_pipelines_request_view.py index b646266..93bc0d2 100644 --- a/test/test_list_pipelines_request_view.py +++ b/test/test_list_pipelines_request_view.py @@ -32,5 +32,5 @@ def testListPipelinesRequestView(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_list_pipelines_response.py b/test/test_list_pipelines_response.py index fb2c7e2..25ba519 100644 --- a/test/test_list_pipelines_response.py +++ b/test/test_list_pipelines_response.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.pipeline import Pipeline -globals()['Pipeline'] = Pipeline + +globals()["Pipeline"] = Pipeline from sajari_client.model.list_pipelines_response import ListPipelinesResponse @@ -34,5 +35,5 @@ def testListPipelinesResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_list_schema_fields_response.py b/test/test_list_schema_fields_response.py index bf91316..ddb02fe 100644 --- a/test/test_list_schema_fields_response.py +++ b/test/test_list_schema_fields_response.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.schema_field import SchemaField -globals()['SchemaField'] = SchemaField + +globals()["SchemaField"] = SchemaField from sajari_client.model.list_schema_fields_response import ListSchemaFieldsResponse @@ -34,5 +35,5 @@ def testListSchemaFieldsResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_percentile_data_point.py b/test/test_percentile_data_point.py index 4638666..9618278 100644 --- a/test/test_percentile_data_point.py +++ b/test/test_percentile_data_point.py @@ -32,5 +32,5 @@ def testPercentileDataPoint(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_pipeline.py b/test/test_pipeline.py index 3f96b10..90fcbb9 100644 --- a/test/test_pipeline.py +++ b/test/test_pipeline.py @@ -15,8 +15,9 @@ import sajari_client from sajari_client.model.pipeline_step import PipelineStep from sajari_client.model.pipeline_type import PipelineType -globals()['PipelineStep'] = PipelineStep -globals()['PipelineType'] = PipelineType + +globals()["PipelineStep"] = PipelineStep +globals()["PipelineType"] = PipelineType from sajari_client.model.pipeline import Pipeline @@ -36,5 +37,5 @@ def testPipeline(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_pipeline_step.py b/test/test_pipeline_step.py index c38d8a9..1aaff1c 100644 --- a/test/test_pipeline_step.py +++ b/test/test_pipeline_step.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.pipeline_step_param_binding import PipelineStepParamBinding -globals()['PipelineStepParamBinding'] = PipelineStepParamBinding + +globals()["PipelineStepParamBinding"] = PipelineStepParamBinding from sajari_client.model.pipeline_step import PipelineStep @@ -34,5 +35,5 @@ def testPipelineStep(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_pipeline_step_param_binding.py b/test/test_pipeline_step_param_binding.py index 91c7ce8..6820d4a 100644 --- a/test/test_pipeline_step_param_binding.py +++ b/test/test_pipeline_step_param_binding.py @@ -32,5 +32,5 @@ def testPipelineStepParamBinding(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_pipeline_type.py b/test/test_pipeline_type.py index 4c20d8a..e7b9f02 100644 --- a/test/test_pipeline_type.py +++ b/test/test_pipeline_type.py @@ -32,5 +32,5 @@ def testPipelineType(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_pipelines_api.py b/test/test_pipelines_api.py index 47b8dac..613ea12 100644 --- a/test/test_pipelines_api.py +++ b/test/test_pipelines_api.py @@ -81,5 +81,5 @@ def test_set_default_version(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_protobuf_any.py b/test/test_protobuf_any.py index 473d76a..e5e67a7 100644 --- a/test/test_protobuf_any.py +++ b/test/test_protobuf_any.py @@ -32,5 +32,5 @@ def testProtobufAny(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_protobuf_null_value.py b/test/test_protobuf_null_value.py index 11e2059..bf9fb03 100644 --- a/test/test_protobuf_null_value.py +++ b/test/test_protobuf_null_value.py @@ -32,5 +32,5 @@ def testProtobufNullValue(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result.py b/test/test_query_aggregate_result.py index 1c2ef4c..a017757 100644 --- a/test/test_query_aggregate_result.py +++ b/test/test_query_aggregate_result.py @@ -13,18 +13,25 @@ import unittest import sajari_client -from sajari_client.model.query_aggregate_result_analysis import QueryAggregateResultAnalysis -from sajari_client.model.query_aggregate_result_buckets import QueryAggregateResultBuckets +from sajari_client.model.query_aggregate_result_analysis import ( + QueryAggregateResultAnalysis, +) +from sajari_client.model.query_aggregate_result_buckets import ( + QueryAggregateResultBuckets, +) from sajari_client.model.query_aggregate_result_count import QueryAggregateResultCount from sajari_client.model.query_aggregate_result_date import QueryAggregateResultDate from sajari_client.model.query_aggregate_result_metric import QueryAggregateResultMetric -from sajari_client.model.query_aggregate_result_percentile import QueryAggregateResultPercentile -globals()['QueryAggregateResultAnalysis'] = QueryAggregateResultAnalysis -globals()['QueryAggregateResultBuckets'] = QueryAggregateResultBuckets -globals()['QueryAggregateResultCount'] = QueryAggregateResultCount -globals()['QueryAggregateResultDate'] = QueryAggregateResultDate -globals()['QueryAggregateResultMetric'] = QueryAggregateResultMetric -globals()['QueryAggregateResultPercentile'] = QueryAggregateResultPercentile +from sajari_client.model.query_aggregate_result_percentile import ( + QueryAggregateResultPercentile, +) + +globals()["QueryAggregateResultAnalysis"] = QueryAggregateResultAnalysis +globals()["QueryAggregateResultBuckets"] = QueryAggregateResultBuckets +globals()["QueryAggregateResultCount"] = QueryAggregateResultCount +globals()["QueryAggregateResultDate"] = QueryAggregateResultDate +globals()["QueryAggregateResultMetric"] = QueryAggregateResultMetric +globals()["QueryAggregateResultPercentile"] = QueryAggregateResultPercentile from sajari_client.model.query_aggregate_result import QueryAggregateResult @@ -44,5 +51,5 @@ def testQueryAggregateResult(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_analysis.py b/test/test_query_aggregate_result_analysis.py index 72fd137..adcfa74 100644 --- a/test/test_query_aggregate_result_analysis.py +++ b/test/test_query_aggregate_result_analysis.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.query_aggregate_result_analysis import QueryAggregateResultAnalysis +from sajari_client.model.query_aggregate_result_analysis import ( + QueryAggregateResultAnalysis, +) class TestQueryAggregateResultAnalysis(unittest.TestCase): @@ -32,5 +34,5 @@ def testQueryAggregateResultAnalysis(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_buckets.py b/test/test_query_aggregate_result_buckets.py index 45610c3..43c6270 100644 --- a/test/test_query_aggregate_result_buckets.py +++ b/test/test_query_aggregate_result_buckets.py @@ -13,9 +13,14 @@ import unittest import sajari_client -from sajari_client.model.query_aggregate_result_buckets_bucket import QueryAggregateResultBucketsBucket -globals()['QueryAggregateResultBucketsBucket'] = QueryAggregateResultBucketsBucket -from sajari_client.model.query_aggregate_result_buckets import QueryAggregateResultBuckets +from sajari_client.model.query_aggregate_result_buckets_bucket import ( + QueryAggregateResultBucketsBucket, +) + +globals()["QueryAggregateResultBucketsBucket"] = QueryAggregateResultBucketsBucket +from sajari_client.model.query_aggregate_result_buckets import ( + QueryAggregateResultBuckets, +) class TestQueryAggregateResultBuckets(unittest.TestCase): @@ -34,5 +39,5 @@ def testQueryAggregateResultBuckets(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_buckets_bucket.py b/test/test_query_aggregate_result_buckets_bucket.py index a8d86ef..a8f2b21 100644 --- a/test/test_query_aggregate_result_buckets_bucket.py +++ b/test/test_query_aggregate_result_buckets_bucket.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.query_aggregate_result_buckets_bucket import QueryAggregateResultBucketsBucket +from sajari_client.model.query_aggregate_result_buckets_bucket import ( + QueryAggregateResultBucketsBucket, +) class TestQueryAggregateResultBucketsBucket(unittest.TestCase): @@ -32,5 +34,5 @@ def testQueryAggregateResultBucketsBucket(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_count.py b/test/test_query_aggregate_result_count.py index 80f59df..0fdc33c 100644 --- a/test/test_query_aggregate_result_count.py +++ b/test/test_query_aggregate_result_count.py @@ -32,5 +32,5 @@ def testQueryAggregateResultCount(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_date.py b/test/test_query_aggregate_result_date.py index 1ace494..8fce603 100644 --- a/test/test_query_aggregate_result_date.py +++ b/test/test_query_aggregate_result_date.py @@ -32,5 +32,5 @@ def testQueryAggregateResultDate(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_metric.py b/test/test_query_aggregate_result_metric.py index 4ec85d4..a283217 100644 --- a/test/test_query_aggregate_result_metric.py +++ b/test/test_query_aggregate_result_metric.py @@ -32,5 +32,5 @@ def testQueryAggregateResultMetric(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_aggregate_result_percentile.py b/test/test_query_aggregate_result_percentile.py index 980c719..3a8840f 100644 --- a/test/test_query_aggregate_result_percentile.py +++ b/test/test_query_aggregate_result_percentile.py @@ -14,8 +14,11 @@ import sajari_client from sajari_client.model.percentile_data_point import PercentileDataPoint -globals()['PercentileDataPoint'] = PercentileDataPoint -from sajari_client.model.query_aggregate_result_percentile import QueryAggregateResultPercentile + +globals()["PercentileDataPoint"] = PercentileDataPoint +from sajari_client.model.query_aggregate_result_percentile import ( + QueryAggregateResultPercentile, +) class TestQueryAggregateResultPercentile(unittest.TestCase): @@ -34,5 +37,5 @@ def testQueryAggregateResultPercentile(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_collection_request.py b/test/test_query_collection_request.py index 9843590..dbc580e 100644 --- a/test/test_query_collection_request.py +++ b/test/test_query_collection_request.py @@ -13,10 +13,15 @@ import unittest import sajari_client -from sajari_client.model.query_collection_request_pipeline import QueryCollectionRequestPipeline -from sajari_client.model.query_collection_request_tracking import QueryCollectionRequestTracking -globals()['QueryCollectionRequestPipeline'] = QueryCollectionRequestPipeline -globals()['QueryCollectionRequestTracking'] = QueryCollectionRequestTracking +from sajari_client.model.query_collection_request_pipeline import ( + QueryCollectionRequestPipeline, +) +from sajari_client.model.query_collection_request_tracking import ( + QueryCollectionRequestTracking, +) + +globals()["QueryCollectionRequestPipeline"] = QueryCollectionRequestPipeline +globals()["QueryCollectionRequestTracking"] = QueryCollectionRequestTracking from sajari_client.model.query_collection_request import QueryCollectionRequest @@ -36,5 +41,5 @@ def testQueryCollectionRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_collection_request_pipeline.py b/test/test_query_collection_request_pipeline.py index f3677bf..ab8e304 100644 --- a/test/test_query_collection_request_pipeline.py +++ b/test/test_query_collection_request_pipeline.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.query_collection_request_pipeline import QueryCollectionRequestPipeline +from sajari_client.model.query_collection_request_pipeline import ( + QueryCollectionRequestPipeline, +) class TestQueryCollectionRequestPipeline(unittest.TestCase): @@ -32,5 +34,5 @@ def testQueryCollectionRequestPipeline(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_collection_request_tracking.py b/test/test_query_collection_request_tracking.py index 7586c55..e4e903b 100644 --- a/test/test_query_collection_request_tracking.py +++ b/test/test_query_collection_request_tracking.py @@ -13,9 +13,14 @@ import unittest import sajari_client -from sajari_client.model.query_collection_request_tracking_type import QueryCollectionRequestTrackingType -globals()['QueryCollectionRequestTrackingType'] = QueryCollectionRequestTrackingType -from sajari_client.model.query_collection_request_tracking import QueryCollectionRequestTracking +from sajari_client.model.query_collection_request_tracking_type import ( + QueryCollectionRequestTrackingType, +) + +globals()["QueryCollectionRequestTrackingType"] = QueryCollectionRequestTrackingType +from sajari_client.model.query_collection_request_tracking import ( + QueryCollectionRequestTracking, +) class TestQueryCollectionRequestTracking(unittest.TestCase): @@ -34,5 +39,5 @@ def testQueryCollectionRequestTracking(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_collection_request_tracking_type.py b/test/test_query_collection_request_tracking_type.py index 78860b3..1a6601d 100644 --- a/test/test_query_collection_request_tracking_type.py +++ b/test/test_query_collection_request_tracking_type.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.query_collection_request_tracking_type import QueryCollectionRequestTrackingType +from sajari_client.model.query_collection_request_tracking_type import ( + QueryCollectionRequestTrackingType, +) class TestQueryCollectionRequestTrackingType(unittest.TestCase): @@ -32,5 +34,5 @@ def testQueryCollectionRequestTrackingType(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_collection_response.py b/test/test_query_collection_response.py index 0de85a0..786e942 100644 --- a/test/test_query_collection_response.py +++ b/test/test_query_collection_response.py @@ -14,11 +14,14 @@ import sajari_client from sajari_client.model.query_aggregate_result import QueryAggregateResult -from sajari_client.model.query_collection_response_pipeline import QueryCollectionResponsePipeline +from sajari_client.model.query_collection_response_pipeline import ( + QueryCollectionResponsePipeline, +) from sajari_client.model.query_result import QueryResult -globals()['QueryAggregateResult'] = QueryAggregateResult -globals()['QueryCollectionResponsePipeline'] = QueryCollectionResponsePipeline -globals()['QueryResult'] = QueryResult + +globals()["QueryAggregateResult"] = QueryAggregateResult +globals()["QueryCollectionResponsePipeline"] = QueryCollectionResponsePipeline +globals()["QueryResult"] = QueryResult from sajari_client.model.query_collection_response import QueryCollectionResponse @@ -38,5 +41,5 @@ def testQueryCollectionResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_collection_response_pipeline.py b/test/test_query_collection_response_pipeline.py index b664aca..802d047 100644 --- a/test/test_query_collection_response_pipeline.py +++ b/test/test_query_collection_response_pipeline.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.query_collection_response_pipeline import QueryCollectionResponsePipeline +from sajari_client.model.query_collection_response_pipeline import ( + QueryCollectionResponsePipeline, +) class TestQueryCollectionResponsePipeline(unittest.TestCase): @@ -32,5 +34,5 @@ def testQueryCollectionResponsePipeline(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_result.py b/test/test_query_result.py index c13f31b..57bb564 100644 --- a/test/test_query_result.py +++ b/test/test_query_result.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.query_result_token import QueryResultToken -globals()['QueryResultToken'] = QueryResultToken + +globals()["QueryResultToken"] = QueryResultToken from sajari_client.model.query_result import QueryResult @@ -34,5 +35,5 @@ def testQueryResult(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_result_token.py b/test/test_query_result_token.py index 987f93c..0a13143 100644 --- a/test/test_query_result_token.py +++ b/test/test_query_result_token.py @@ -15,8 +15,9 @@ import sajari_client from sajari_client.model.query_result_token_click import QueryResultTokenClick from sajari_client.model.query_result_token_pos_neg import QueryResultTokenPosNeg -globals()['QueryResultTokenClick'] = QueryResultTokenClick -globals()['QueryResultTokenPosNeg'] = QueryResultTokenPosNeg + +globals()["QueryResultTokenClick"] = QueryResultTokenClick +globals()["QueryResultTokenPosNeg"] = QueryResultTokenPosNeg from sajari_client.model.query_result_token import QueryResultToken @@ -36,5 +37,5 @@ def testQueryResultToken(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_result_token_click.py b/test/test_query_result_token_click.py index 59e7064..3fe9c1f 100644 --- a/test/test_query_result_token_click.py +++ b/test/test_query_result_token_click.py @@ -32,5 +32,5 @@ def testQueryResultTokenClick(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_query_result_token_pos_neg.py b/test/test_query_result_token_pos_neg.py index 23d3328..b9dd453 100644 --- a/test/test_query_result_token_pos_neg.py +++ b/test/test_query_result_token_pos_neg.py @@ -32,5 +32,5 @@ def testQueryResultTokenPosNeg(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_record_key.py b/test/test_record_key.py index aea7aef..1194172 100644 --- a/test/test_record_key.py +++ b/test/test_record_key.py @@ -32,5 +32,5 @@ def testRecordKey(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_records_api.py b/test/test_records_api.py index 39ac75b..8147f98 100644 --- a/test/test_records_api.py +++ b/test/test_records_api.py @@ -53,5 +53,5 @@ def test_upsert_record(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_schema_api.py b/test/test_schema_api.py index cba171c..7fedee4 100644 --- a/test/test_schema_api.py +++ b/test/test_schema_api.py @@ -46,5 +46,5 @@ def test_list_schema_fields(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_schema_field.py b/test/test_schema_field.py index aa2a657..c25dd0c 100644 --- a/test/test_schema_field.py +++ b/test/test_schema_field.py @@ -15,8 +15,9 @@ import sajari_client from sajari_client.model.schema_field_mode import SchemaFieldMode from sajari_client.model.schema_field_type import SchemaFieldType -globals()['SchemaFieldMode'] = SchemaFieldMode -globals()['SchemaFieldType'] = SchemaFieldType + +globals()["SchemaFieldMode"] = SchemaFieldMode +globals()["SchemaFieldType"] = SchemaFieldType from sajari_client.model.schema_field import SchemaField @@ -36,5 +37,5 @@ def testSchemaField(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_schema_field_mode.py b/test/test_schema_field_mode.py index 0bb96b1..adce904 100644 --- a/test/test_schema_field_mode.py +++ b/test/test_schema_field_mode.py @@ -32,5 +32,5 @@ def testSchemaFieldMode(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_schema_field_type.py b/test/test_schema_field_type.py index 90a3dbd..e038aa7 100644 --- a/test/test_schema_field_type.py +++ b/test/test_schema_field_type.py @@ -32,5 +32,5 @@ def testSchemaFieldType(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_send_event_request.py b/test/test_send_event_request.py index c078733..4a69f4e 100644 --- a/test/test_send_event_request.py +++ b/test/test_send_event_request.py @@ -32,5 +32,5 @@ def testSendEventRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_set_default_pipeline_request.py b/test/test_set_default_pipeline_request.py index b8a36e6..a22fa0a 100644 --- a/test/test_set_default_pipeline_request.py +++ b/test/test_set_default_pipeline_request.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.pipeline_type import PipelineType -globals()['PipelineType'] = PipelineType + +globals()["PipelineType"] = PipelineType from sajari_client.model.set_default_pipeline_request import SetDefaultPipelineRequest @@ -34,5 +35,5 @@ def testSetDefaultPipelineRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_set_default_version_request.py b/test/test_set_default_version_request.py index 82297ad..681bab3 100644 --- a/test/test_set_default_version_request.py +++ b/test/test_set_default_version_request.py @@ -32,5 +32,5 @@ def testSetDefaultVersionRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_status.py b/test/test_status.py index 2de424b..82df671 100644 --- a/test/test_status.py +++ b/test/test_status.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.protobuf_any import ProtobufAny -globals()['ProtobufAny'] = ProtobufAny + +globals()["ProtobufAny"] = ProtobufAny from sajari_client.model.status import Status @@ -34,5 +35,5 @@ def testStatus(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_upsert_record_request.py b/test/test_upsert_record_request.py index e1ccb8d..65b6a7e 100644 --- a/test/test_upsert_record_request.py +++ b/test/test_upsert_record_request.py @@ -13,8 +13,11 @@ import unittest import sajari_client -from sajari_client.model.upsert_record_request_pipeline import UpsertRecordRequestPipeline -globals()['UpsertRecordRequestPipeline'] = UpsertRecordRequestPipeline +from sajari_client.model.upsert_record_request_pipeline import ( + UpsertRecordRequestPipeline, +) + +globals()["UpsertRecordRequestPipeline"] = UpsertRecordRequestPipeline from sajari_client.model.upsert_record_request import UpsertRecordRequest @@ -34,5 +37,5 @@ def testUpsertRecordRequest(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_upsert_record_request_pipeline.py b/test/test_upsert_record_request_pipeline.py index 6991d6a..7dbcfb0 100644 --- a/test/test_upsert_record_request_pipeline.py +++ b/test/test_upsert_record_request_pipeline.py @@ -13,7 +13,9 @@ import unittest import sajari_client -from sajari_client.model.upsert_record_request_pipeline import UpsertRecordRequestPipeline +from sajari_client.model.upsert_record_request_pipeline import ( + UpsertRecordRequestPipeline, +) class TestUpsertRecordRequestPipeline(unittest.TestCase): @@ -32,5 +34,5 @@ def testUpsertRecordRequestPipeline(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/test/test_upsert_record_response.py b/test/test_upsert_record_response.py index 959e4ff..5b89753 100644 --- a/test/test_upsert_record_response.py +++ b/test/test_upsert_record_response.py @@ -14,7 +14,8 @@ import sajari_client from sajari_client.model.record_key import RecordKey -globals()['RecordKey'] = RecordKey + +globals()["RecordKey"] = RecordKey from sajari_client.model.upsert_record_response import UpsertRecordResponse @@ -34,5 +35,5 @@ def testUpsertRecordResponse(self): pass -if __name__ == '__main__': +if __name__ == "__main__": unittest.main()