From ca8b1facbf5a46750bfaf5c22d4fcb4118f40c59 Mon Sep 17 00:00:00 2001 From: cloudant-sdks-automation <71659186+cloudant-sdks-automation@users.noreply.github.com> Date: Tue, 6 Jan 2026 08:42:28 +0000 Subject: [PATCH] feat(generated): update API definition to 1.0.0-dev0.1.32 Generated SDK source code using: - Generator version 3.108.0 - Specification version 1.0.0-dev0.1.32 - Automation (cloudant-sdks) version e4adb30 --- ibmcloudant/cloudant_v1.py | 100 ++++++++++++++++----------- test/integration/test_cloudant_v1.py | 1 + test/unit/test_cloudant_v1.py | 12 +++- 3 files changed, 68 insertions(+), 45 deletions(-) diff --git a/ibmcloudant/cloudant_v1.py b/ibmcloudant/cloudant_v1.py index c53f68d1..ec2496f2 100644 --- a/ibmcloudant/cloudant_v1.py +++ b/ibmcloudant/cloudant_v1.py @@ -5692,9 +5692,9 @@ def post_index( :param IndexDefinition index: Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties that do not apply to `json` indexes, these are: - * `default_analyzer` - the default text analyzer to use * `default_field` - - whether to index the text in all document fields and what analyzer to use - for that purpose. + * `default_analyzer` - the default text analyzer to use + * `default_field` - whether to index the text in all document fields and + what analyzer to use for that purpose. :param str ddoc: (optional) Specifies the design document name in which the index will be created. The design document name is the design document ID excluding the `_design/` prefix. @@ -9645,9 +9645,9 @@ class Analyzer: :param str name: Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: - * For search indexes the default is `standard` * For query text indexes the - default is `keyword` * For a query text index default_field the default is - `standard`. + * For search indexes the default is `standard` + * For query text indexes the default is `keyword` + * For a query text index default_field the default is `standard`. :param List[str] stopwords: (optional) Custom stopwords to use with the named analyzer. """ @@ -9664,9 +9664,9 @@ def __init__( :param str name: Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: - * For search indexes the default is `standard` * For query text indexes the - default is `keyword` * For a query text index default_field the default is - `standard`. + * For search indexes the default is `standard` + * For query text indexes the default is `keyword` + * For a query text index default_field the default is `standard`. :param List[str] stopwords: (optional) Custom stopwords to use with the named analyzer. """ @@ -9721,9 +9721,9 @@ class NameEnum(str, Enum): """ Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: - * For search indexes the default is `standard` * For query text indexes the - default is `keyword` * For a query text index default_field the default is - `standard`. + * For search indexes the default is `standard` + * For query text indexes the default is `keyword` + * For a query text index default_field the default is `standard`. """ CLASSIC = 'classic' @@ -9773,15 +9773,17 @@ class NameEnum(str, Enum): class AnalyzerConfiguration: """ - Schema for a search analyzer configuration. + Analyzer configuration for search indexes. The default and fields properties are only + applicable for the `perfield` analyzer name. :param str name: Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: - * For search indexes the default is `standard` * For query text indexes the - default is `keyword` * For a query text index default_field the default is - `standard`. + * For search indexes the default is `standard` + * For query text indexes the default is `keyword` + * For a query text index default_field the default is `standard`. :param List[str] stopwords: (optional) Custom stopwords to use with the named analyzer. + :param Analyzer default: (optional) Schema for a full text search analyzer. :param dict fields: (optional) Schema for mapping a field name to a per field analyzer. """ @@ -9791,6 +9793,7 @@ def __init__( name: str, *, stopwords: Optional[List[str]] = None, + default: Optional['Analyzer'] = None, fields: Optional[dict] = None, ) -> None: """ @@ -9799,16 +9802,18 @@ def __init__( :param str name: Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: - * For search indexes the default is `standard` * For query text indexes the - default is `keyword` * For a query text index default_field the default is - `standard`. + * For search indexes the default is `standard` + * For query text indexes the default is `keyword` + * For a query text index default_field the default is `standard`. :param List[str] stopwords: (optional) Custom stopwords to use with the named analyzer. + :param Analyzer default: (optional) Schema for a full text search analyzer. :param dict fields: (optional) Schema for mapping a field name to a per field analyzer. """ self.name = name self.stopwords = stopwords + self.default = default self.fields = fields @classmethod @@ -9821,6 +9826,8 @@ def from_dict(cls, _dict: Dict) -> 'AnalyzerConfiguration': raise ValueError('Required property \'name\' not present in AnalyzerConfiguration JSON') if (stopwords := _dict.get('stopwords')) is not None: args['stopwords'] = stopwords + if (default := _dict.get('default')) is not None: + args['default'] = Analyzer.from_dict(default) if (fields := _dict.get('fields')) is not None: args['fields'] = {k: Analyzer.from_dict(v) for k, v in fields.items()} return cls(**args) @@ -9837,6 +9844,11 @@ def to_dict(self) -> Dict: _dict['name'] = self.name if hasattr(self, 'stopwords') and self.stopwords is not None: _dict['stopwords'] = self.stopwords + if hasattr(self, 'default') and self.default is not None: + if isinstance(self.default, dict): + _dict['default'] = self.default + else: + _dict['default'] = self.default.to_dict() if hasattr(self, 'fields') and self.fields is not None: fields_map = {} for k, v in self.fields.items(): @@ -9869,9 +9881,9 @@ class NameEnum(str, Enum): """ Schema for the name of the Apache Lucene analyzer to use for text indexing. The default value varies depending on the analyzer usage: - * For search indexes the default is `standard` * For query text indexes the - default is `keyword` * For a query text index default_field the default is - `standard`. + * For search indexes the default is `standard` + * For query text indexes the default is `keyword` + * For a query text index default_field the default is `standard`. """ CLASSIC = 'classic' @@ -14740,8 +14752,9 @@ class IndexDefinition: """ Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties that do not apply to `json` indexes, these are: - * `default_analyzer` - the default text analyzer to use * `default_field` - whether to - index the text in all document fields and what analyzer to use for that purpose. + * `default_analyzer` - the default text analyzer to use + * `default_field` - whether to index the text in all document fields and what analyzer + to use for that purpose. :param Analyzer default_analyzer: (optional) Schema for a full text search analyzer. @@ -14757,9 +14770,10 @@ class IndexDefinition: :param bool index_array_lengths: (optional) Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if: - * You do not need to know the length of an array. * You do not use the `$size` - operator. * The documents in your database are complex, or not completely under - your control. As a result, it is difficult to estimate the impact of the extra + * You do not need to know the length of an array. + * You do not use the `$size` operator. + * The documents in your database are complex, or not completely under your + control. As a result, it is difficult to estimate the impact of the extra processing that is needed to determine and store the arrays lengths. :param dict partial_filter_selector: (optional) JSON object describing criteria used to select documents. The selector specifies fields in the document, and @@ -14824,11 +14838,11 @@ def __init__( :param bool index_array_lengths: (optional) Whether to scan every document for arrays and store the length for each array found. Set the index_array_lengths field to false if: - * You do not need to know the length of an array. * You do not use the - `$size` operator. * The documents in your database are complex, or not - completely under your control. As a result, it is difficult to estimate the - impact of the extra processing that is needed to determine and store the - arrays lengths. + * You do not need to know the length of an array. + * You do not use the `$size` operator. + * The documents in your database are complex, or not completely under your + control. As a result, it is difficult to estimate the impact of the extra + processing that is needed to determine and store the arrays lengths. :param dict partial_filter_selector: (optional) JSON object describing criteria used to select documents. The selector specifies fields in the document, and provides an expression to evaluate with the field content or @@ -15067,9 +15081,9 @@ class IndexInformation: :param IndexDefinition def_: Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties that do not apply to `json` indexes, these are: - * `default_analyzer` - the default text analyzer to use * `default_field` - - whether to index the text in all document fields and what analyzer to use for - that purpose. + * `default_analyzer` - the default text analyzer to use + * `default_field` - whether to index the text in all document fields and what + analyzer to use for that purpose. :param str name: Index name. :param bool partitioned: (optional) Indicates if index is partitioned. :param str type: Schema for the type of an index. @@ -15092,9 +15106,9 @@ def __init__( :param IndexDefinition def_: Schema for a `json` or `text` query index definition. Indexes of type `text` have additional configuration properties that do not apply to `json` indexes, these are: - * `default_analyzer` - the default text analyzer to use * `default_field` - - whether to index the text in all document fields and what analyzer to use - for that purpose. + * `default_analyzer` - the default text analyzer to use + * `default_field` - whether to index the text in all document fields and + what analyzer to use for that purpose. :param str name: Index name. :param str type: Schema for the type of an index. :param bool partitioned: (optional) Indicates if index is partitioned. @@ -17993,8 +18007,9 @@ class SearchIndexDefinition: """ Schema for a search index definition. - :param AnalyzerConfiguration analyzer: (optional) Schema for a search analyzer - configuration. + :param AnalyzerConfiguration analyzer: (optional) Analyzer configuration for + search indexes. The default and fields properties are only applicable for the + `perfield` analyzer name. :param str index: String form of a JavaScript function that is called for each document in the database. The function takes the document as a parameter, extracts some data from it, and then calls the `index` function to index that @@ -18047,8 +18062,9 @@ def __init__( * `store` - boolean, default `true` - If true, the value is returned in the search result; otherwise, the value is not returned. - :param AnalyzerConfiguration analyzer: (optional) Schema for a search - analyzer configuration. + :param AnalyzerConfiguration analyzer: (optional) Analyzer configuration + for search indexes. The default and fields properties are only applicable + for the `perfield` analyzer name. """ self.analyzer = analyzer self.index = index diff --git a/test/integration/test_cloudant_v1.py b/test/integration/test_cloudant_v1.py index 841232ce..29ee803f 100644 --- a/test/integration/test_cloudant_v1.py +++ b/test/integration/test_cloudant_v1.py @@ -744,6 +744,7 @@ def test_put_design_document(self): analyzer_configuration_model = { 'name': 'standard', 'stopwords': ['testString'], + 'default': analyzer_model, 'fields': {'key1': analyzer_model}, } # Construct a dict representation of a SearchIndexDefinition model diff --git a/test/unit/test_cloudant_v1.py b/test/unit/test_cloudant_v1.py index 88189dfe..7c3ce166 100644 --- a/test/unit/test_cloudant_v1.py +++ b/test/unit/test_cloudant_v1.py @@ -4709,7 +4709,7 @@ def test_get_design_document_all_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": true, "_deleted_conflicts": ["deleted_conflicts"], "_id": "_id", "_local_seq": "_local_seq", "_rev": "_rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "autoupdate": true, "filters": {"mapKey": "inner"}, "indexes": {"mapKey": {"analyzer": {"name": "classic", "stopwords": ["stopwords"], "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "reduce": "reduce"}}}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": true, "_deleted_conflicts": ["deleted_conflicts"], "_id": "_id", "_local_seq": "_local_seq", "_rev": "_rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "autoupdate": true, "filters": {"mapKey": "inner"}, "indexes": {"mapKey": {"analyzer": {"name": "classic", "stopwords": ["stopwords"], "default": {"name": "classic", "stopwords": ["stopwords"]}, "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "reduce": "reduce"}}}' responses.add( responses.GET, url, @@ -4784,7 +4784,7 @@ def test_get_design_document_required_params(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": true, "_deleted_conflicts": ["deleted_conflicts"], "_id": "_id", "_local_seq": "_local_seq", "_rev": "_rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "autoupdate": true, "filters": {"mapKey": "inner"}, "indexes": {"mapKey": {"analyzer": {"name": "classic", "stopwords": ["stopwords"], "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "reduce": "reduce"}}}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": true, "_deleted_conflicts": ["deleted_conflicts"], "_id": "_id", "_local_seq": "_local_seq", "_rev": "_rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "autoupdate": true, "filters": {"mapKey": "inner"}, "indexes": {"mapKey": {"analyzer": {"name": "classic", "stopwords": ["stopwords"], "default": {"name": "classic", "stopwords": ["stopwords"]}, "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "reduce": "reduce"}}}' responses.add( responses.GET, url, @@ -4824,7 +4824,7 @@ def test_get_design_document_value_error(self): """ # Set up mock url = preprocess_url('/testString/_design/testString') - mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": true, "_deleted_conflicts": ["deleted_conflicts"], "_id": "_id", "_local_seq": "_local_seq", "_rev": "_rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "autoupdate": true, "filters": {"mapKey": "inner"}, "indexes": {"mapKey": {"analyzer": {"name": "classic", "stopwords": ["stopwords"], "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "reduce": "reduce"}}}' + mock_response = '{"_attachments": {"mapKey": {"content_type": "content_type", "data": "VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4=", "digest": "digest", "encoded_length": 0, "encoding": "encoding", "follows": false, "length": 0, "revpos": 1, "stub": true}}, "_conflicts": ["conflicts"], "_deleted": true, "_deleted_conflicts": ["deleted_conflicts"], "_id": "_id", "_local_seq": "_local_seq", "_rev": "_rev", "_revisions": {"ids": ["ids"], "start": 1}, "_revs_info": [{"rev": "rev", "status": "available"}], "autoupdate": true, "filters": {"mapKey": "inner"}, "indexes": {"mapKey": {"analyzer": {"name": "classic", "stopwords": ["stopwords"], "default": {"name": "classic", "stopwords": ["stopwords"]}, "fields": {"mapKey": {"name": "classic", "stopwords": ["stopwords"]}}}, "index": "index"}}, "language": "javascript", "options": {"partitioned": false}, "validate_doc_update": "validate_doc_update", "views": {"mapKey": {"map": "map", "reduce": "reduce"}}}' responses.add( responses.GET, url, @@ -4909,6 +4909,7 @@ def test_put_design_document_all_params(self): analyzer_configuration_model = {} analyzer_configuration_model['name'] = 'standard' analyzer_configuration_model['stopwords'] = ['testString'] + analyzer_configuration_model['default'] = analyzer_model analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a dict representation of a SearchIndexDefinition model @@ -5039,6 +5040,7 @@ def test_put_design_document_required_params(self): analyzer_configuration_model = {} analyzer_configuration_model['name'] = 'standard' analyzer_configuration_model['stopwords'] = ['testString'] + analyzer_configuration_model['default'] = analyzer_model analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a dict representation of a SearchIndexDefinition model @@ -5155,6 +5157,7 @@ def test_put_design_document_value_error(self): analyzer_configuration_model = {} analyzer_configuration_model['name'] = 'standard' analyzer_configuration_model['stopwords'] = ['testString'] + analyzer_configuration_model['default'] = analyzer_model analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a dict representation of a SearchIndexDefinition model @@ -14076,6 +14079,7 @@ def test_analyzer_configuration_serialization(self): analyzer_configuration_model_json = {} analyzer_configuration_model_json['name'] = 'classic' analyzer_configuration_model_json['stopwords'] = ['testString'] + analyzer_configuration_model_json['default'] = analyzer_model analyzer_configuration_model_json['fields'] = {'key1': analyzer_model} # Construct a model instance of AnalyzerConfiguration by calling from_dict on the json representation @@ -15371,6 +15375,7 @@ def test_design_document_serialization(self): analyzer_configuration_model = {} # AnalyzerConfiguration analyzer_configuration_model['name'] = 'classic' analyzer_configuration_model['stopwords'] = ['testString'] + analyzer_configuration_model['default'] = analyzer_model analyzer_configuration_model['fields'] = {'key1': analyzer_model} search_index_definition_model = {} # SearchIndexDefinition @@ -17619,6 +17624,7 @@ def test_search_index_definition_serialization(self): analyzer_configuration_model = {} # AnalyzerConfiguration analyzer_configuration_model['name'] = 'classic' analyzer_configuration_model['stopwords'] = ['testString'] + analyzer_configuration_model['default'] = analyzer_model analyzer_configuration_model['fields'] = {'key1': analyzer_model} # Construct a json representation of a SearchIndexDefinition model